From: Martin Kletzander Date: Mon, 13 Jun 2016 12:33:42 +0000 (+0200) Subject: qemu: Allow ACPI shutdown only for running domains X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b842741ba467b97f3c1ac63ec9bc550edf037690;p=libvirt.git qemu: Allow ACPI shutdown only for running domains 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 67471c0371..52df21e283 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;