[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palat
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable. |
Date: |
Fri, 21 Feb 2014 19:15:12 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
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 <address@hidden>
I'll let Kevin review 3/3.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature