Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
freeze: Cleanup snapshot using freeze() and thaw()
Snapshot code was written before libvirt.virDomain.fsFreeze() and libvirt.virDomain.fsThaw() were available. We used the quiesce flag (VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) to request freezing of guest filesystems during the snapshot. Because libvirt error reporting was not good enough, the code assumed that *any* exception raised from snapshotCreateXML() means failure to freeze the guest filesystems, and tried to take a snapshot again without the quiesce flag. This error handling is evil and wrong, and requesting snapshot twice after a failure sounds like a bad idea. This patches cleans up the code using the new freeze() and thaw() methods. We freeze() the guest before the snapshot, and thaw() afterwards, invoking snapshot exactly once. We handle only libvirtError around snapshotCreateXML(). Any other error is not expected and will fail loudly. When taking a memory snapshot, we are not freezing the guest, because qemu is pausing the vm in this case. We keep this behavior for now. Change-Id: Ice74b5619246c979f24909f4ffc3688b3adef6cb Signed-off-by: Nir Soffer <nsoffer@redhat.com> Reviewed-on: https://gerrit.ovirt.org/43298 Reviewed-by: Francesco Romani <fromani@redhat.com> Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg <danken@redhat.com>
- Loading branch information