]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/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)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Oct 2012 09:40:32 +0000 (11:40 +0200)
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.

src/qemu/qemu_driver.c

index b0a0bb5390c3c41045de6c33f5c7af9bbf2e225b..50f44ce70bebdcd1b16205ac72ff6055a443c133 100644 (file)
@@ -10375,6 +10375,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) {
@@ -10393,9 +10394,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;
 }