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

[libvirt] [libvirt-glib] Add gvir_domain_get_saved()



From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>

Binding for virDomainHasManagedSaveImage().
---
 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 d9e4c00..5f26dcd 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -854,3 +854,16 @@ gboolean gvir_domain_get_persistent(GVirDomain *dom)
 
     return virDomainIsPersistent(dom->priv->handle) == 1;
 }
+
+/**
+ * gvir_domain_get_saved:
+ * @dom: the domain
+ *
+ * Returns: TRUE if domain is in a saved state, FALSE otherwise.
+ */
+gboolean gvir_domain_get_saved(GVirDomain *dom)
+{
+    g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+
+    return virDomainHasManagedSaveImage(dom->priv->handle, 0) == 1;
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 20388f2..bdff32e 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -167,6 +167,7 @@ gboolean gvir_domain_save_finish (GVirDomain *dom,
                                   GAsyncResult *result,
                                   GError **err);
 gboolean gvir_domain_get_persistent(GVirDomain *dom);
+gboolean gvir_domain_get_saved(GVirDomain *dom);
 
 G_END_DECLS
 
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 468bf65..7a2f65d 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -64,6 +64,7 @@ LIBVIRT_GOBJECT_0.0.4 {
 	gvir_domain_set_config;
 	gvir_domain_get_info;
 	gvir_domain_get_persistent;
+	gvir_domain_get_saved;
 	gvir_domain_screenshot;
 
 	gvir_domain_snapshot_get_type;
-- 
1.7.7.6


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