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

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Thu Apr 19 13:24:35 UTC 2012


On Thu, Apr 19, 2012 at 11:52 AM, Christophe Fergeau
<cfergeau at redhat.com> wrote:
> On Thu, Apr 19, 2012 at 03:12:01AM +0300, Zeeshan Ali (Khattak) wrote:
>> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
>> +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);
>
> Shouldn't the last parameter be gvir_domain_info_free?

No, we give this info to user in the finalize call:

>> +
>> +    if (g_simple_async_result_propagate_error(res, err))
>> +        return NULL;
>> +
>> +    return g_simple_async_result_get_op_res_gpointer(res);
>> +}

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the libvir-list mailing list