]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use proper agent entering function when freezing filesystems
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Oct 2012 15:58:29 +0000 (17:58 +0200)
committerCole Robinson <crobinso@redhat.com>
Thu, 18 Oct 2012 17:10:53 +0000 (13:10 -0400)
When doing snapshots, the filesystem freeze function used the agent
entering function that expects the qemud_driver unlocked. This might
cause a deadlock of the qemu driver if the agent does not respond.

The only call path of this function has the qemud_driver locked, so this
patch changes the entering functions to those expecting the driver
locked.
(cherry picked from commit e0316b5ebd85ca7c20db9a3fe8f6062b4b5e051d)

src/qemu/qemu_driver.c

index c9aa8cb38dbac2a73e2b4f12d74588e576ae1432..291cc057baf675270616810ecd4cc3839c3fb7bf 100644 (file)
@@ -10390,6 +10390,7 @@ qemuDomainSnapshotIsAllowed(virDomainObjPtr vm)
     return true;
 }
 
+/* this function expects the driver lock to be held by the caller */
 static int
 qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
                            virDomainObjPtr vm) {
@@ -10408,9 +10409,9 @@ qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
         return -1;
     }
 
-    qemuDomainObjEnterAgent(driver, vm);
+    qemuDomainObjEnterAgentWithDriver(driver, vm);
     freezed = qemuAgentFSFreeze(priv->agent);
-    qemuDomainObjExitAgent(driver, vm);
+    qemuDomainObjExitAgentWithDriver(driver, vm);
 
     return freezed;
 }