[libvirt] [PATCHv3 14/43] snapshot: refactor some qemu code