by ori_b · 1y ago · 0 comments
Here's the implementation I did for openbsd; it's around 700 lines, including the gunk to interface with the hypervisor.
https://github.com/openbsd/src/blob/master/usr.sbin/vmd/vioq...
It's not a good choice for computing diffs, but you can run your VM directly off a read-only base qcow2, with all deltas going into a separate file. That file can either be shipped around or discarded. And multiple VMs can share the same read only base.
So, it probably would have been better to write the code for the hypervisor, and end up with something far more efficient overall.
I use it to back up external disks, usb sticks etc. Because the resulting qcow2 images are sparse and compressed they use less storage which is great for backups.