]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Properly detect crash of a rebooted domain
authorJiri Denemark <jdenemar@redhat.com>
Tue, 13 Sep 2011 16:48:13 +0000 (18:48 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 16 Sep 2011 15:18:20 +0000 (17:18 +0200)
When a domain is rebooted using libvirt API, we use fake reboot
consisting of shutting down and resetting the domain. Thus we see a
SHUTDOWN event and set gotShutdown flag. But we never reset it back and
if the domain crashes after it was rebooted this way, we consider it was
a normal shutdown and not a crash.

src/qemu/qemu_process.c

index 8462cf06e763c05af4d3c7ed579786a40cd7ebb2..5f7f0e6f6a29b3b604bd2c527d3097d97dfb2f7e 100644 (file)
@@ -405,6 +405,7 @@ qemuProcessFakeReboot(void *opaque)
                             "%s", _("resume operation failed"));
         goto endjob;
     }
+    priv->gotShutdown = false;
     event = virDomainEventNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_RESUMED,
                                      VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);