---
libvirt-gobject/libvirt-gobject-domain-snapshot.c | 59 +++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain-snapshot.h | 11 +++++
libvirt-gobject/libvirt-gobject.sym | 2 +
3 files changed, 72 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
index 62efce0..4e74f92 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
@@ -302,6 +302,65 @@ gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot
*snapshot,
return TRUE;
}
+static void _revert_to_async_thread(GTask *task,
+ gpointer source_object,
+ gpointer task_data,
+ GCancellable *cancellable) {
+ GError *error = NULL;
+ gboolean status;
+
+ status = gvir_domain_snapshot_revert_to(source_object,
+ GPOINTER_TO_UINT(task_data),
+ &error);
+
+ if (status)
+ g_task_return_boolean(task, TRUE);
+ else
+ g_task_return_error(task, error);
+}
+
+
+/**
+ * gvir_domain_snapshot_revert_to_async:
+ * @snapshot: A #GVirDomainSnapshot
+ * @flags: Bitwise OR of #GVirDomainSnapshotRevertFlags
+ * @cancellable: (allow-none) (transfer none): cancellation object
+ * @callback: (scope async): The callback
+ * @user_data: (closure): Opaque data for callback
+ */
+void gvir_domain_snapshot_revert_to_async(GVirDomainSnapshot *snapshot,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data) {
+ GTask *task;
+
+ g_return_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot));
+
+ task = g_task_new(snapshot, cancellable, callback, user_data);
+ g_task_set_task_data(task, GUINT_TO_POINTER(flags), NULL);
+ g_task_run_in_thread(task, _revert_to_async_thread);
+ g_object_unref(task);
+}
+
+
+
+/**
+ * gvir_domain_snapshot_revert_to_finish:
+ * @snapshot: The domain snapshot
+ * @result: (transfer none): The result
+ *
+ * Returns: %TRUE on success, %FALSE otherwise.
+ */
+gboolean gvir_domain_snapshot_revert_to_finish(GVirDomainSnapshot *snapshot,
+ GAsyncResult *result,
+ GError **error) {
+ g_return_val_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot), FALSE);
+ g_return_val_if_fail(g_task_is_valid(result, snapshot), FALSE);
+
+ return g_task_propagate_boolean(G_TASK(result), error);
+}
+
/**
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h
b/libvirt-gobject/libvirt-gobject-domain-snapshot.h
index 5ab3025..b1dcf20 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h
@@ -107,6 +107,17 @@ gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot
*snapshot,
guint flags,
GError **error);
+void gvir_domain_snapshot_revert_to_async(GVirDomainSnapshot *snapshot,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean gvir_domain_snapshot_revert_to_finish(GVirDomainSnapshot *snapshot,
+ GAsyncResult *result,
+ GError **error);
+
+
gboolean gvir_domain_snapshot_set_config(GVirDomainSnapshot *snapshot,
GVirConfigDomainSnapshot *conf,
GError **error);
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 68e9b58..ebb9418 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -247,6 +247,8 @@ LIBVIRT_GOBJECT_0.1.9 {
gvir_domain_snapshot_list_flags_get_type;
gvir_domain_snapshot_revert_flags_get_type;
gvir_domain_snapshot_revert_to;
+ gvir_domain_snapshot_revert_to_async;
+ gvir_domain_snapshot_revert_to_finish;
gvir_domain_snapshot_set_config;
gvir_storage_pool_state_get_type;
gvir_storage_vol_resize_flags_get_type;
--
2.1.0