[libvirt] [PATCHv2 15/26] snapshot: refactor some qemu code