]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Ignore shutdown event from destroyed domain
authorJiri Denemark <jdenemar@redhat.com>
Wed, 7 Dec 2011 11:52:59 +0000 (12:52 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 7 Dec 2011 13:45:22 +0000 (14:45 +0100)
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

index 5e8a20a18788fdc2a34494d7f52a0885dd2b092e..93097613ece089ca6ba2efc817054bd1b623b7d2 100644 (file)
@@ -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;