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(a)redhat.com>
---
src/qemu/qemu_driver.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cda85f65fc98..866580705493 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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);
--
2.9.0