Received: from eggs.gnu.org ([2001:4830:134:3::10]:56059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4Vm-0002kv-Um for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn4Vj-0004pv-Pe for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:58:02 -0400 References: <20160922130905.4720-1-marcandre.lureau@redhat.com> <20160922130905.4720-2-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <6cc16d15-a030-0308-2663-df7a4133cd5a@redhat.com> Date: Thu, 22 Sep 2016 08:57:57 -0500 MIME-Version: 1.0 In-Reply-To: <20160922130905.4720-2-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="B5EMJ8IMghip4aeqSsq9NTvJLpxFaUTIq" Subject: Re: [Qemu-devel] [PATCH v2 1/3] qmp: fix object-add assert() without props List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: paolo.bonzini@gmail.com, berrange@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --B5EMJ8IMghip4aeqSsq9NTvJLpxFaUTIq From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: paolo.bonzini@gmail.com, berrange@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com Message-ID: <6cc16d15-a030-0308-2663-df7a4133cd5a@redhat.com> Subject: Re: [PATCH v2 1/3] qmp: fix object-add assert() without props References: <20160922130905.4720-1-marcandre.lureau@redhat.com> <20160922130905.4720-2-marcandre.lureau@redhat.com> In-Reply-To: <20160922130905.4720-2-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2016 08:09 AM, Marc-Andr=C3=A9 Lureau wrote: > Since commit ad739706bbadee49, user_creatable_add_type() expects to be > given a qdict. However, if object-add is called without props, you reac= h > the assert: "qemu/qom/object_interfaces.c:115: user_creatable_add_type:= > Assertion `qdict' failed.", because the qdict isn't created in this > case (it's optional). >=20 > Furthermore, qmp_input_visitor_new() is not meant to be called without = a > dict, and a further commit will assert in this situation. >=20 > If none given, create an empty qdict in qmp to avoid the > user_creatable_add_type() assert(qdict). >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > qmp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 Looks nicer than v1. Thanks. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --B5EMJ8IMghip4aeqSsq9NTvJLpxFaUTIq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX4+NlAAoJEKeha0olJ0NqhDUIAJIxrToDkD5nwVcnaI3fQgVf tw0ahTE2YnGZssgvNl8ffxWkSmC/iw+NHFHj1kV775in7z6Jg3CBP5fpyaoThLoe ND4TrMOYi1jeIt2UXDvA6g4PDcZg6hCS/+vYt7WlNelCNjyyah0avbjKDchjeEb+ u+0302UYJ342mkHgyN5M4+STH9vMWfWIDP5cNN6NDCXUqZLio1aoLDss6GTpxvCj b6x8TZpBt3pAt42g1P+KSdWJM6IDfjo1GlejPvbduhoUnhax4cCcYAS3YNBTjgwV 6K3sC4yAf2YLTXb2NzWaOc0ggt+ChDTBwQ4VFGqOHbuBchMi/Xc1/T9p2ThF2AM= =iOAT -----END PGP SIGNATURE----- --B5EMJ8IMghip4aeqSsq9NTvJLpxFaUTIq--