[libvirt-glib] Add gvir_domain_get_persistent()

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

 



From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>

A predicate to check if domain is persistent or not.
---
 libvirt-gobject/libvirt-gobject-domain.c |   13 +++++++++++++
 libvirt-gobject/libvirt-gobject-domain.h |    1 +
 libvirt-gobject/libvirt-gobject.sym      |    1 +
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 967ff67..e3d6a46 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -821,3 +821,16 @@ gboolean gvir_domain_save_finish (GVirDomain *dom,
 
     return TRUE;
 }
+
+/**
+ * gvir_domain_get_persistent:
+ * @dom: the domain
+ *
+ * Returns: TRUE if domain is persistent, FALSE otherwise.
+ */
+gboolean gvir_domain_get_persistent(GVirDomain *dom)
+{
+    g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+
+    return virDomainIsPersistent(dom->priv->handle);
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index a3649cd..20388f2 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -166,6 +166,7 @@ void gvir_domain_save_async (GVirDomain *dom,
 gboolean gvir_domain_save_finish (GVirDomain *dom,
                                   GAsyncResult *result,
                                   GError **err);
+gboolean gvir_domain_get_persistent(GVirDomain *dom);
 
 G_END_DECLS
 
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 0e0f34d..4c98c93 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -63,6 +63,7 @@ LIBVIRT_GOBJECT_0.0.3 {
 	gvir_domain_get_config;
 	gvir_domain_set_config;
 	gvir_domain_get_info;
+	gvir_domain_get_persistent;
 	gvir_domain_screenshot;
 
 	gvir_domain_snapshot_get_type;
-- 
1.7.7.5

--
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]