[libvirt] [libvirt-glib] [PATCH 4/4] GVirDomainSnapshot: Add async version of _delete
Christophe Fergeau
cfergeau at redhat.com
Mon Aug 18 10:20:50 UTC 2014
On Fri, Aug 15, 2014 at 12:05:47PM +0200, Timm Bäder wrote:
> ---
> libvirt-gobject/libvirt-gobject-domain-snapshot.c | 56 +++++++++++++++++++++++
> libvirt-gobject/libvirt-gobject-domain-snapshot.h | 9 ++++
> libvirt-gobject/libvirt-gobject.sym | 2 +
> 3 files changed, 67 insertions(+)
>
> diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
> index 61ca53e..46aa70f 100644
> --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
> +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
> @@ -237,6 +237,62 @@ gboolean gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot,
> }
>
>
> +
> +static void _delete_async_thread(GTask *task,
> + gpointer source_object,
> + gpointer task_data,
> + GCancellable *cancellable) {
> + GError *error = NULL;
> + gboolean status;
> +
> + status = gvir_domain_snapshot_delete(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_delete_async:
> + * @snapshot: A #GVirDomainSnapshot
> + * @flags: Bitwise-OR of #GVirDomainSnapshotDeleteFlags
> + * @callback: (scope async): completion callback
> + * @user_data: (closure): opaque data for callback
> + */
> +void gvir_domain_snapshot_delete_async(GVirDomainSnapshot *snapshot,
> + guint flags,
> + GAsyncReadyCallback callback,
> + gpointer user_data) {
Usual question about the lack of cancellable, ACK otherwise.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140818/cb9f8aec/attachment-0001.sig>
More information about the libvir-list
mailing list