]> xenbits.xensource.com Git - libvirt.git/commitdiff
Check for active domain in virDomainObjWait
authorJiri Denemark <jdenemar@redhat.com>
Tue, 16 Feb 2016 09:49:26 +0000 (10:49 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 19 Feb 2016 14:41:57 +0000 (15:41 +0100)
virDomainObjWait is designed to be called in a loop. Make sure we break
the loop in case the domain dies to avoid waiting for an event which
will never happen.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/conf/domain_conf.c

index acd58a1b6175a6d30866ad72486a978f4c858c01..ba67433c5c28259408231ff0f6ef2ff418c84713 100644 (file)
@@ -2749,6 +2749,13 @@ virDomainObjWait(virDomainObjPtr vm)
                              _("failed to wait for domain condition"));
         return -1;
     }
+
+    if (!virDomainObjIsActive(vm)) {
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("domain is not running"));
+        return -1;
+    }
+
     return 0;
 }