From 7ccad0b16d12d7616c7c21b1359f6a55a9677521 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 28 Feb 2013 12:18:48 +0000 Subject: [PATCH] Fix crash in QEMU auto-destroy with transient guests When the auto-destroy callback runs it is supposed to return NULL if the virDomainObjPtr is no longer valid. It was not doing this for transient guests, so we tried to virObjectUnlock a mutex which had been freed. This often led to a crash. Signed-off-by: Daniel P. Berrange --- src/qemu/qemu_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index db95d6ee1c..1b9eedec4c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4629,8 +4629,10 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver, if (!qemuDomainObjEndJob(driver, dom)) dom = NULL; - if (dom && !dom->persistent) + if (dom && !dom->persistent) { qemuDomainRemoveInactive(driver, dom); + dom = NULL; + } if (event) qemuDomainEventQueue(driver, event);