From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH27d-00024f-BW for qemu-devel@nongnu.org; Fri, 21 Feb 2014 21:15:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WH27Y-0008M2-DM for qemu-devel@nongnu.org; Fri, 21 Feb 2014 21:15:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WH27Y-0008La-3p for qemu-devel@nongnu.org; Fri, 21 Feb 2014 21:15:16 -0500 Message-ID: <53080830.4090708@redhat.com> Date: Fri, 21 Feb 2014 19:15:12 -0700 From: Eric Blake MIME-Version: 1.0 References: <1393032048-17982-1-git-send-email-benoit.canet@irqsave.net> <1393032048-17982-3-git-send-email-benoit.canet@irqsave.net> <53080069.8080600@redhat.com> <20140222020929.GA14498@irqsave.net> In-Reply-To: <20140222020929.GA14498@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="e7KevjhKHffJCg21tm7pMGohl12j2PMSj" Subject: Re: [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --e7KevjhKHffJCg21tm7pMGohl12j2PMSj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/21/2014 07:09 PM, Beno=C3=AEt Canet wrote: >>> + if (ret < 0) { >>> + QDict *dict =3D qobject_to_qdict(data); >>> + qdict_put(dict, "error", qstring_from_str(strerror(-ret))); >>> + } >> >> This puts it in dict, but never modifies data... >=20 > qobject_to_qdict is an enhanced cast. >=20 > /** > * qobject_to_qdict(): Convert a QObject into a QDict > */ > QDict *qobject_to_qdict(const QObject *obj) > { > if (qobject_type(obj) !=3D QTYPE_QDICT) > return NULL; >=20 > return container_of(obj, QDict, base); > } >=20 > 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 I'll let Kevin review 3/3. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --e7KevjhKHffJCg21tm7pMGohl12j2PMSj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTCAgwAAoJEKeha0olJ0NqXTYH/3HkkF+ftXEWzQaCzgjs1BkH iqCkdWoebmcbeyGYEafbApv0Gu83w0lwIp3rb7QP1fdUnRRgAeXfKhiQdZQdGQnX j5Z3rtH1YCbo2gGqu2Z23LAcffZmEN1aPXDa6oD8dCxvNbho0zL+lzLKyyi9GkYn S4Ivu4VgPcY3dwh1G9qKP2w3JwbkyKyN6/1AGfATiAL3v/e3LIJi6ZiA6i5Q98pZ wT72CzYciYuiRYrSQqh9XRqrzcYTg5KaV9IlsDb9l6L9sXuZxVVzQiojjCFi7s2+ Jvqi0kYXZiKC0OuckpEr6/i1+kJfARfH5yOY++NCzPjk9qedeVbSVYqKZHpG6Fw= =B66Z -----END PGP SIGNATURE----- --e7KevjhKHffJCg21tm7pMGohl12j2PMSj--