[PATCH 9/9] Check for active domain in virDomainObjWait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 67415fa..f68a8d9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
 }
 
-- 
2.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]