1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: Use proper agent entering function when freezing filesystems

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.
This commit is contained in:
Peter Krempa 2012-10-01 17:58:29 +02:00
parent 0dddd680c2
commit e0316b5ebd

View File

@ -10375,6 +10375,7 @@ qemuDomainSnapshotIsAllowed(virDomainObjPtr vm)
return true; return true;
} }
/* this function expects the driver lock to be held by the caller */
static int static int
qemuDomainSnapshotFSFreeze(struct qemud_driver *driver, qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
virDomainObjPtr vm) { virDomainObjPtr vm) {
@ -10393,9 +10394,9 @@ qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
return -1; return -1;
} }
qemuDomainObjEnterAgent(driver, vm); qemuDomainObjEnterAgentWithDriver(driver, vm);
freezed = qemuAgentFSFreeze(priv->agent); freezed = qemuAgentFSFreeze(priv->agent);
qemuDomainObjExitAgent(driver, vm); qemuDomainObjExitAgentWithDriver(driver, vm);
return freezed; return freezed;
} }