[libvirt-glib] [PATCH] GVirDomainSnapshot: add gvir_domain_snapshot_delete

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

 



---
 libvirt-gobject/libvirt-gobject-domain-snapshot.c | 21 +++++++++++++++++++++
 libvirt-gobject/libvirt-gobject-domain-snapshot.h |  3 +++
 libvirt-gobject/libvirt-gobject.sym               |  5 +++++
 3 files changed, 29 insertions(+)

diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
index ab23342..f46c99b 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
@@ -206,3 +206,24 @@ GVirConfigDomainSnapshot *gvir_domain_snapshot_get_config
     free(xml);
     return conf;
 }
+
+/**
+ * gvir_domain_snapshot_delete:
+ * @snapshot: the domain_snapshot
+ * @error: (allow-none): Place-holder for error or NULL
+ */
+void gvir_domain_snapshot_delete(GVirDomainSnapshot *snapshot, GError **error)
+{
+    GVirDomainSnapshotPrivate *priv;
+    int status;
+
+    g_return_if_fail(GVIR_IS_DOMAIN_SNAPSHOT (snapshot));
+    g_return_if_fail(error == NULL || *error == NULL);
+
+    priv = snapshot->priv;
+    status = virDomainSnapshotDelete(priv->handle, 0);
+    if (status < 0) {
+        gvir_set_error_literal(error, GVIR_DOMAIN_SNAPSHOT_ERROR, 0,
+                               "Unable to delete snapshot");
+    }
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h
index 5bd827c..575f56f 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h
@@ -69,6 +69,9 @@ GVirConfigDomainSnapshot *gvir_domain_snapshot_get_config
                                  guint flags,
                                  GError **err);
 
+void gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot, GError **error);
+
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GOBJECT_DOMAIN_SNAPSHOT_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index f2419ac..5d12a6a 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -234,4 +234,9 @@ LIBVIRT_GOBJECT_0.1.5 {
 	gvir_connection_open_read_only_finish;
 } LIBVIRT_GOBJECT_0.1.4;
 
+LIBVIRT_GOBJECT_0.1.9 {
+  global:
+  gvir_domain_shapshot_delete;
+} LIBVIRT_GOBJECT_0.1.5;
+
 # .... define new API here using predicted next version number ....
-- 
1.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]