This questions asks how one can make a backup of a live virtual machine.
The accepted answer says it is possible with QEMU/libvirt.
My question (since the answer doesn't explain it) is how to do a proper backup of a live machine using only QEMU.
QEMU Machine Protocol primitives for one way to do a qemu backup are documented as Dirty Bitmaps and Incremental Backup. block-dirty-bitmap-add
and such.
As that page suggests, "The intended audience for this document is developers who are adding QEMU backup features to management applications." As an API, its a bit ugly, a proper script should be more focused and robust. In environments using libvirt already, their backup is an obvious choice.
Due to the popularity of qemu, I would be surprised if there wasn't an alternative implementation of just backup. And indeed I found one: qmpbackup, although beware I have not used it and indeed just found it now. Study it as an example of a QMP client.
And as always, you must test backup restores to know how to recover. Regularly, and especially when changing backup procedures.