From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4X9a-0003J2-1z for qemu-devel@nongnu.org; Thu, 03 Dec 2015 11:54:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4X9V-0004Qi-3o for qemu-devel@nongnu.org; Thu, 03 Dec 2015 11:54:45 -0500 References: <1449160660-3777-1-git-send-email-armbru@redhat.com> <1449160660-3777-3-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <566073CE.8090601@redhat.com> Date: Thu, 3 Dec 2015 09:54:38 -0700 MIME-Version: 1.0 In-Reply-To: <1449160660-3777-3-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HO7JA97Wpbf6ugp5l9W4SiIPCVGCHr29E" Subject: Re: [Qemu-devel] [PATCH for-2.5 2/3] spapr_drc: Change value of property "fdt" from null back to {} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org, agraf@suse.de, david@gibson.dropbear.id.au This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HO7JA97Wpbf6ugp5l9W4SiIPCVGCHr29E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/03/2015 09:37 AM, Markus Armbruster wrote: > prop_get_fdt() misuses the visitor API: when fdt is null, it doesn't > visit anything. object_property_get_qobject() happily > object_property_get_qobject(). Amazingly, the latter survives the Something got lost or otherwise corrupted in that sentence. Were you trying to say one function happily calls another? If so, which of the two "object_property_get_qobject()" strings should be changed, to what? > misuse. Turns out we've papered over it long before prop_get_fdt() > existed, in commit 1d10b44. >=20 > However, commit 6c2f9a1 changed how we paper over it, and as a side > effect changed qom-get's value from {} to null. Change it right back > by fixing the visitor misuse. >=20 > Signed-off-by: Markus Armbruster > --- > hw/ppc/spapr_drc.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c > index 4e7a1d3..dad157f 100644 > --- a/hw/ppc/spapr_drc.c > +++ b/hw/ppc/spapr_drc.c > @@ -259,6 +259,11 @@ static void prop_get_fdt(Object *obj, Visitor *v, = void *opaque, > void *fdt; > =20 > if (!drc->fdt) { > + visit_start_struct(v, NULL, NULL, name, 0, &err); visit_start_struct(v, NULL, "fdt", name, 0, &err) would give a nicer error message, but only if there were an error message to give. As already mentioned on 1/3, we are only using this for output visitors which don't raise errors (in fact, &error_abort would do, rather than worrying about error propagation). But I'm fine with the patch as you proposed it, once the commit message is fixed. Reviewed-by: Eric Blake > + if (!err) { > + visit_end_struct(v, &err); > + } > + error_propagate(errp, err); > return; > } > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --HO7JA97Wpbf6ugp5l9W4SiIPCVGCHr29E 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/ iQEcBAEBCAAGBQJWYHPOAAoJEKeha0olJ0NqkSgH+gM7HVtHGVI9AcdoyotxP/Pc mwwK4GUokGLKDfY2q5lEpIuz6qUkIureE6mJ/68+kW1GiFdCO5GFXd06cGhO1NVI ori1uslNadZ7JYaRThpPwp4TffF9g89N/kM2CnS3t5s5fyRRkL8hTp46pVd/eJyf fqVAzI4QipcX/XG2P8cSvr3rjXcHybDSQ5GByApQjlqoGAuXE397yAgCV3yf13Q7 oxkT5RMAzrOFOBknWeuW14FHDk/rXj2UFmXXcfjXk4jXeZGsM2T0rvQhU/mLVVn6 Uf6vflXWSwhBHd4qb/ZXcS0qulx/5O7HT0OuNn7OQKkgjWJ5J1Wu4hSmo4PbxVM= =yU+H -----END PGP SIGNATURE----- --HO7JA97Wpbf6ugp5l9W4SiIPCVGCHr29E--