On 02/21/2014 07:09 PM, Benoît Canet wrote:

>>> +    if (ret < 0) {
>>> +        QDict *dict = qobject_to_qdict(data);
>>> +        qdict_put(dict, "error", qstring_from_str(strerror(-ret)));
>>> +    }
>>
>> This puts it in dict, but never modifies data...
> 
> qobject_to_qdict is an enhanced cast.
> 
> /**
>  * qobject_to_qdict(): Convert a QObject into a QDict
>  */
> QDict *qobject_to_qdict(const QObject *obj)
> {
>     if (qobject_type(obj) != QTYPE_QDICT)
>         return NULL;
> 
>     return container_of(obj, QDict, base);
> }
> 
> Also I took this snippet of code from what you pointed me as an example for 
> the
> error handling.

Oh - now I see.  Slick.  In that case,

Reviewed-by: Eric Blake <[email protected]>

I'll let Kevin review 3/3.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to