Re: [libvirt-glib] Add async variant of gvir_domain_get_info()

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

 



On Thu, Apr 19, 2012 at 04:45:29PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> ---
>  libvirt-gobject/libvirt-gobject-domain.c |   74 ++++++++++++++++++++++++++++++
>  libvirt-gobject/libvirt-gobject-domain.h |    7 +++
>  libvirt-gobject/libvirt-gobject.sym      |    4 +-
>  3 files changed, 84 insertions(+), 1 deletions(-)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
> index 0bafa7e..c1a2086 100644
> --- a/libvirt-gobject/libvirt-gobject-domain.c
> +++ b/libvirt-gobject/libvirt-gobject-domain.c
> @@ -572,6 +572,80 @@ GVirDomainInfo *gvir_domain_get_info(GVirDomain *dom,
>      return ret;
>  }
>  
> +static void
> +gvir_domain_get_info_helper(GSimpleAsyncResult *res,
> +                            GObject *object,
> +                            GCancellable *cancellable G_GNUC_UNUSED)
> +{
> +    GVirDomain *dom = GVIR_DOMAIN(object);
> +    GVirDomainInfo *info;
> +    GError *err = NULL;
> +
> +    info = gvir_domain_get_info(dom, &err);
> +    if (err)
> +        g_simple_async_result_take_error(res, err);
> +    else
> +        g_simple_async_result_set_op_res_gpointer(res, info, NULL);

I still think this can leak memory in error cases/corner cases, see my answer to
your first patch.

Christophe

Attachment: pgp2tsNOSa32e.pgp
Description: PGP signature

--
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]