]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Allow ACPI shutdown only for running domains
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 13 Jun 2016 12:33:42 +0000 (14:33 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 14 Jun 2016 09:13:03 +0000 (11:13 +0200)
If the domain is not running, but for example the CPUs are stopped, the
ACPI event gets queued and resume of the domain will just shut it off.

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

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

index 67471c0371e1381aecf3d9b84f50c656fe665049..52df21e283e74709f68d80cbef725c1f6ce62d1a 100644 (file)
@@ -2042,7 +2042,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
 
-    if (!virDomainObjIsActive(vm)) {
+    if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
         virReportError(VIR_ERR_OPERATION_INVALID,
                        "%s", _("domain is not running"));
         goto endjob;