[PATCH 1/3] libxl: Implement virDomainObjCheckIsActive

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

 



Add function which raises error if domain is
not active

Signed-off-by: Sagar Ghuge <ghugesss@xxxxxxxxx>
---
 src/conf/domain_conf.c | 15 +++++++++++++++
 src/conf/domain_conf.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 97d42fe..a44454c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2997,6 +2997,21 @@ virDomainObjWait(virDomainObjPtr vm)
 }
 
 
+int
+virDomainObjCheckIsActive(virDomainObjPtr vm)
+{
+    if (!virDomainObjIsActive(vm)) {
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("domain is not running"));
+        return -1;
+    }
+
+    return 0;
+}
+
+
+
+
 /**
  * Waits for domain condition to be triggered for a specific period of time.
  *
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1e53cc3..cfeb1ba 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2559,6 +2559,7 @@ bool virDomainObjTaint(virDomainObjPtr obj,
 
 void virDomainObjBroadcast(virDomainObjPtr vm);
 int virDomainObjWait(virDomainObjPtr vm);
+int virDomainObjCheckIsActive(virDomainObjPtr vm);
 int virDomainObjWaitUntil(virDomainObjPtr vm,
                           unsigned long long whenms);
 
-- 
2.9.3

--
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]
  Powered by Linux