[libvirt] [PATCH 4/4] GVirDomain: Add _get_has_current_snapshot

Christophe Fergeau cfergeau at redhat.com
Fri Aug 8 16:01:38 UTC 2014


On Fri, Aug 08, 2014 at 05:07:32PM +0200, Timm Bäder wrote:
> ... which uses virDomainHasCurrentSnapshot to determine if the given
> domain has a current snapshot or not.
> ---
>  libvirt-gobject/libvirt-gobject-domain.c | 34 ++++++++++++++++++++++++++++++++
>  libvirt-gobject/libvirt-gobject-domain.h |  4 ++++
>  libvirt-gobject/libvirt-gobject.sym      |  1 +
>  3 files changed, 39 insertions(+)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
> index 5399892..feac6f0 100644
> --- a/libvirt-gobject/libvirt-gobject-domain.c
> +++ b/libvirt-gobject/libvirt-gobject-domain.c
> @@ -1686,3 +1686,37 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom,
>  
>      return g_task_propagate_boolean(G_TASK(res), error);
>  }
> +
> +
> +/**
> + * gvir_domain_get_has_current_snapshot:
> + * @dom: a #GVirDomain
> + * @flags: Unused, pass 0
> + * @has_current_snapshot: (out): Will be set to %TRUE if the given domain
> + * has a current snapshot and to %FALSE otherwise.
> + * @error: (allow-none): Place-holder for error or %NULL
> + *
> + * Returns: %TRUE on success, %FALSE otherwise.
> + */
> +gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom,
> +                                              guint flags,
> +                                              gboolean *has_current_snapshot,
> +                                              GError **error) {
> +    int status;
> +    g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
> +    g_return_val_if_fail(error == NULL || *error == NULL, FALSE);


We could also have a g_return_if_fail(has_current_snapshot != NULL);

ACK!

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/20140808/10f8aba5/attachment-0001.sig>


More information about the libvir-list mailing list