[libvirt] [PATCHv4 26/51] snapshot: refactor some qemu code