]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Check if domain is running in qemuDomainAgentIsAvailable
authorJán Tomko <jtomko@redhat.com>
Thu, 26 Feb 2015 13:00:47 +0000 (14:00 +0100)
committerCole Robinson <crobinso@redhat.com>
Tue, 28 Apr 2015 15:06:36 +0000 (11:06 -0400)
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

index d719f6022c71f585796fea660001fcbd46b36722..3303c0c6f8aebc7c173fe0761383803a02e58cf0 100644 (file)
@@ -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;
 }