From: Ján Tomko Date: Thu, 26 Feb 2015 13:00:47 +0000 (+0100) Subject: Check if domain is running in qemuDomainAgentIsAvailable X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=723522328f2d92e4c2d5de35b3b3ec0302bb06ac;p=libvirt.git Check if domain is running in qemuDomainAgentIsAvailable If the domain is not running, the agent will not respond. Do not even try. https://bugzilla.redhat.com/show_bug.cgi?id=872424 --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 551a897216..d8a2087141 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2824,6 +2824,13 @@ qemuDomainAgentAvailable(virDomainObjPtr vm, } return false; } + if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) { + if (reportError) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); + } + return false; + } return true; }