This script will let you make backups of live VMs running on KVM, using libvirt.
The backup job will suspend the VM for the time it takes to copy the RAM to disk.
Credits: Luca Lazzeroni
Edited to detect and check the image format is qcow2 using qemu-img, rather than rely on the file extension being .qcow2