Being a stacked review, part 3 is the one that contains all the changes for a successful build and a successful test environment.
Start the guest vm with: bhyve -c 1 -m 256M -H -A -P -s 0:0,hostbridge -s 1:0,lpc -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 2:0,virtio-net,tap0 -s 3:0,ahci-hd,main.img -l com1,stdio -t <path_to_the_directory_to_save_snapshot_files> freebsd_guest
For testing the functionality open two processes at the same time on the guest vm:
- one copy process of a 500MB file
- one ping process
While the processes mentioned above are running:
- suspend the guest with the command: bhyvectl --suspend file.ckp --vm=freebsd_guestand (because after the changes on part 3 the checkpoint directory is specified at boot time this command only needs the name of the snapshot file, not the full path)
- restore its state with the command: bhyve -c 1 -m 256M -H -A -P -s 0:0,hostbridge -s 1:0,lpc -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 2:0,virtio-net,tap0 -s 3:0,ahci-hd,main.img -l com1,stdio -r file.ckp freebsd_guest.
After the restore command, both processes should finish successfully and the guest can be used without errors.