On Thu, Feb 16, 2012 at 05:49:48PM +0200, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Binding for virDomainHasManagedSaveImage().
---
libvirt-gobject/libvirt-gobject-domain.c | 14 ++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 1 +
libvirt-gobject/libvirt-gobject.sym | 1 +
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c
b/libvirt-gobject/libvirt-gobject-domain.c
index 3eb5942..0cbb0fe 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -854,3 +854,17 @@ gboolean gvir_domain_get_persistent(GVirDomain *dom)
return virDomainIsPersistent(dom->priv->handle) == 1;
}
+
+/**
+ * gvir_domain_get_saved:
+ * @dom: the domain
+ *
+ * Returns: TRUE if a stopped domain has a saved state to which it can be
+ * restored to using #gvir_domain_resume, 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;
ACK
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|