diff options
Diffstat (limited to 'src/qemu/qemu_process.c')
-rw-r--r-- | src/qemu/qemu_process.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f67495f34..f30493877 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -128,7 +128,8 @@ qemuProcessHandleAgentEOF(qemuAgentPtr agent, virDomainObjLock(vm); priv = vm->privateData; - priv->agent = NULL; + if (priv->agent == agent) + priv->agent = NULL; virDomainObjUnlock(vm); qemuDriverUnlock(driver); @@ -166,16 +167,9 @@ qemuProcessHandleAgentError(qemuAgentPtr agent ATTRIBUTE_UNUSED, static void qemuProcessHandleAgentDestroy(qemuAgentPtr agent, virDomainObjPtr vm) { - qemuDomainObjPrivatePtr priv; - VIR_DEBUG("Received destroy agent=%p vm=%p", agent, vm); - virDomainObjLock(vm); - priv = vm->privateData; - if (priv->agent == agent) - priv->agent = NULL; - if (virObjectUnref(vm)) - virDomainObjUnlock(vm); + virObjectUnref(vm); } |