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.
This commit is contained in:
Michal Privoznik 2012-09-14 10:53:00 +02:00
parent 6e73850b01
commit 1020a5041b

View File

@ -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);
}