]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix domain state after reset
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 13 Jul 2016 14:13:58 +0000 (16:13 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 2 Aug 2016 11:21:01 +0000 (13:21 +0200)
When reset was called from a domain that crashed we didn't change the
crashed state into a paused one which could confuse users.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1269575

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c

index abb777ac1c90b10710105415e709f7cac0c30b60..2250d376c622252311c695e650c26a97671c6492 100644 (file)
@@ -2139,6 +2139,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
     virDomainObjPtr vm;
     int ret = -1;
     qemuDomainObjPrivatePtr priv;
+    virDomainState state;
 
     virCheckFlags(0, -1);
 
@@ -2165,6 +2166,10 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
 
     priv->fakeReboot = false;
 
+    state = virDomainObjGetState(vm, NULL);
+    if (state == VIR_DOMAIN_CRASHED)
+        virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_CRASHED);
+
  endjob:
     qemuDomainObjEndJob(driver, vm);