[libvirt] [PATCH] qemu: Ignore shutdown event from destroyed domain

During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to SIGTERM and since domain object is still locked, the event is processed after the domain is destroyed. We need to ignore this event in such case to avoid changing domain state from shutoff to shutdown. --- src/qemu/qemu_process.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 5e8a20a..9309761 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -471,6 +471,10 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED, VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s", vm->def->name); goto unlock; + } else if (!virDomainObjIsActive(vm)) { + VIR_DEBUG("Ignoring SHUTDOWN event from inactive domain %s", + vm->def->name); + goto unlock; } priv->gotShutdown = true; -- 1.7.8

On 12/07/2011 12:59 PM, Jiri Denemark wrote:
During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to SIGTERM and since domain object is still locked, the event is processed after the domain is destroyed. We need to ignore this event in such case to avoid changing domain state from shutoff to shutdown. ---
ACK. It fixes the stuck domains after destroy for me. Peter

On Wed, Dec 07, 2011 at 13:58:36 +0100, Peter Krempa wrote:
On 12/07/2011 12:59 PM, Jiri Denemark wrote:
During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to SIGTERM and since domain object is still locked, the event is processed after the domain is destroyed. We need to ignore this event in such case to avoid changing domain state from shutoff to shutdown. ---
ACK. It fixes the stuck domains after destroy for me.
Thanks; pushed. Jirka
participants (2)
-
Jiri Denemark
-
Peter Krempa