From 37448a868efb71344fe4913bc7c14e4021d4ea2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 26 Feb 2015 14:00:47 +0100 Subject: [PATCH] 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 (cherry picked from commit 723522328f2d92e4c2d5de35b3b3ec0302bb06ac) --- src/qemu/qemu_domain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d719f6022c..3303c0c6f8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2819,6 +2819,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; }