Nir Soffer has uploaded a new change for review.

Change subject: freeze: Freeze guest even when creating memory snapshot
......................................................................

freeze: Freeze guest even when creating memory snapshot

We used to skip freezing the guest if creating memory snapshot. This was
probably done because qemu is pausing the vm for creating memory
snapshot.

However, this is not consistent with snapshots of external disks such as
network disks, where we always freeze the vm before taking the snapshot.
Also, it is probably safer to freeze even when creating memory snapshot,
giving applications on the guest chance to pause in consistent state.

This patch removes the check for memory snapshot, and freeze the guest
unless it is already frozen.

Change-Id: I8aa7ac0dea8690ca33df8067f84734d788da8bf8
Signed-off-by: Nir Soffer <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/43299/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 332281b..ecbbe1d 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3093,9 +3093,6 @@
         else:
             snapFlags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY
 
-        # When creating memory snapshot libvirt will pause the vm
-        should_freeze = not (memoryParams or frozen)
-
         snapxml = snap.toprettyxml()
         # TODO: this is debug information. For 3.6.x we still need to
         # see the XML even with 'info' as default level.
@@ -3109,7 +3106,7 @@
         self.stopDisksStatsCollection()
 
         try:
-            if should_freeze:
+            if not frozen:
                 freezed = self.freeze()
             try:
                 self._dom.snapshotCreateXML(snapxml, snapFlags)
@@ -3120,7 +3117,7 @@
                 # Must always thaw, even if freeze failed; in case the guest
                 # did freeze the filesystems, but failed to reply in time.
                 # Libvirt is using same logic (see src/qemu/qemu_driver.c).
-                if should_freeze:
+                if not frozen:
                     self.thaw()
 
             # We are padding the memory volume with block size of zeroes
@@ -3148,7 +3145,7 @@
         # Returning quiesce to notify the manager whether the guest agent
         # froze and flushed the filesystems or not.
         return {'status': doneCode,
-                'quiesce': should_freeze and freezed["status"]["code"] == 0}
+                'quiesce': not frozen and freezed["status"]["code"] == 0}
 
     def diskReplicateStart(self, srcDisk, dstDisk):
         try:


-- 
To view, visit https://gerrit.ovirt.org/43299
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8aa7ac0dea8690ca33df8067f84734d788da8bf8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to