aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2012-09-14 10:53:00 +0200
committerMichal Privoznik <mprivozn@redhat.com>2012-09-18 09:24:06 +0200
commit1020a5041b0eb575f65b53cb1ca9cee2447a50cd (patch)
tree95a43b4861c4045b1adee1c4c63514dfa7d491aa
parentqemu: Use disk wwn in qemu command line (diff)
downloadlibvirt-1020a5041b0eb575f65b53cb1ca9cee2447a50cd.tar.gz
libvirt-1020a5041b0eb575f65b53cb1ca9cee2447a50cd.tar.bz2
libvirt-1020a5041b0eb575f65b53cb1ca9cee2447a50cd.zip
qemu: Avoid deadlock on HandleAgentEOF
On agent EOF the qemuProcessHandleAgentEOF() callback is called which locks virDomainObjPtr. Then qemuAgentClose() is called (with domain object locked) which eventually calls qemuAgentDispose() and qemuProcessHandleAgentDestroy(). This tries to lock the domain object again. Hence the deadlock.
-rw-r--r--src/qemu/qemu_process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index abbe1f9ce..5095381b7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -116,7 +116,7 @@ extern struct qemud_driver *qemu_driver;
* performed
*/
static void
-qemuProcessHandleAgentEOF(qemuAgentPtr agent ATTRIBUTE_UNUSED,
+qemuProcessHandleAgentEOF(qemuAgentPtr agent,
virDomainObjPtr vm)
{
struct qemud_driver *driver = qemu_driver;
@@ -128,12 +128,12 @@ qemuProcessHandleAgentEOF(qemuAgentPtr agent ATTRIBUTE_UNUSED,
virDomainObjLock(vm);
priv = vm->privateData;
-
- qemuAgentClose(agent);
priv->agent = NULL;
virDomainObjUnlock(vm);
qemuDriverUnlock(driver);
+
+ qemuAgentClose(agent);
}