From: Eric Blake <eblake@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com,
mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable.
Date: Fri, 21 Feb 2014 19:15:12 -0700 [thread overview]
Message-ID: <53080830.4090708@redhat.com> (raw)
In-Reply-To: <20140222020929.GA14498@irqsave.net>
[-- Attachment #1: Type: text/plain, Size: 900 bytes --]
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 <eblake@redhat.com>
I'll let Kevin review 3/3.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-22 2:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-22 1:20 [Qemu-devel] [PATCH V2 0/3] Fix some quorum nits after merge Benoît Canet
2014-02-22 1:20 ` [Qemu-devel] [PATCH V2 1/3] qmp: Fix BlockdevOptionQuorum Benoît Canet
2014-02-22 1:20 ` [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable Benoît Canet
2014-02-22 1:42 ` Eric Blake
2014-02-22 2:09 ` Benoît Canet
2014-02-22 2:15 ` Eric Blake [this message]
2014-02-22 1:20 ` [Qemu-devel] [PATCH V2 3/3] qemu-io-test: Disable Quorum test when not compiled in Benoît Canet
2014-02-22 7:38 ` Fam Zheng
2014-02-22 11:58 ` Benoît Canet
2014-02-22 16:00 ` Fam Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53080830.4090708@redhat.com \
--to=eblake@redhat.com \
--cc=benoit.canet@irqsave.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.