From: Eric Blake Subject: Re: [Qemu-devel] [PATCH v2 2/6] qdict: Add convenience helpers for wrapped puts Date: Tue, 4 Apr 2017 17:41:08 -0500 Message-ID: <274218e6-5539-9eef-56bc-c2de4d11a593@redhat.com> References: <20170118161653.19296-1-eblake@redhat.com> <20170118161653.19296-3-eblake@redhat.com> <87lgu7flkc.fsf@dusky.pond.sub.org> <9e16eb02-dc8b-b25f-0aba-d4a9ff3b5a02@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CC8q7utnXC2rDTsL2oMBJU1QCquFOrQGv" Return-path: In-Reply-To: <9e16eb02-dc8b-b25f-0aba-d4a9ff3b5a02@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-block-bounces+gceqb-qemu-block=m.gmane.org@nongnu.org Sender: "Qemu-block" To: Markus Armbruster Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Alexander Graf , Gerd Hoffmann , Stefano Stabellini , "open list:Block layer core" , Michael Roth , Anthony Perard , Fam Zheng , Chrysostomos Nanakos , Stefan Weil , Peter Lieven , "Dr. David Alan Gilbert" , "open list:X86" , Ronnie Sahlberg , Richard Henderson , Kevin Wolf , "Richard W.M. Jones" , Max Reitz , Paolo Bonzini List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CC8q7utnXC2rDTsL2oMBJU1QCquFOrQGv Content-Type: multipart/mixed; boundary="9CHoAmem7XjC3IR3HNTVkMLm23edbVSO0"; protected-headers="v1" From: Eric Blake To: Markus Armbruster Cc: Ronnie Sahlberg , Jeff Cody , qemu-devel@nongnu.org, Alexander Graf , Gerd Hoffmann , Stefano Stabellini , Alberto Garcia , "open list:Block layer core" , Michael Roth , Anthony Perard , Fam Zheng , Chrysostomos Nanakos , Stefan Weil , Peter Lieven , "Dr. David Alan Gilbert" , "open list:X86" , Stefan Hajnoczi , Richard Henderson , Kevin Wolf , "Richard W.M. Jones" , Max Reitz , Paolo Bonzini Message-ID: <274218e6-5539-9eef-56bc-c2de4d11a593@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/6] qdict: Add convenience helpers for wrapped puts References: <20170118161653.19296-1-eblake@redhat.com> <20170118161653.19296-3-eblake@redhat.com> <87lgu7flkc.fsf@dusky.pond.sub.org> <9e16eb02-dc8b-b25f-0aba-d4a9ff3b5a02@redhat.com> In-Reply-To: <9e16eb02-dc8b-b25f-0aba-d4a9ff3b5a02@redhat.com> --9CHoAmem7XjC3IR3HNTVkMLm23edbVSO0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/19/2017 08:38 AM, Eric Blake wrote: > On 01/19/2017 03:25 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Quite a few users of qdict_put() were manually wrapping a >>> non-QObject. We can make such call-sites shorter, by providing >>> common macros to do the tedious work. Also shorten nearby >>> qdict_put_obj(,,QOBJECT()) sequences. >>> >>> Signed-off-by: Eric Blake >>> Reviewed-by: Alberto Garcia >>> >>> --- >>> >>> v2: rebase to current master >>> >>> I'm okay if you want me to break this patch into smaller pieces. >> >> I guess I'm okay with a single piece, but I'd like to know how you did= >> the conversion. Coccinelle? Manually? >=20 > Manual, via grepping for put_obj.*QOBJECT. I'll see if I can do the sam= e > under Coccinelle (at which point, committing the script will make it > easier to rerun cleanups if later code reintroduces poor usage > patterns), so maybe I have a v3 coming up. I've got a Coccinelle patch (mostly) working now - but it has one shortfall - I found places in tests/check-qdict.c that coccinelle didn't, and traced it to the fact that our use of g_assert_cmpint(expr, =3D=3D, expr) throws off the coccinelle parser so badly that it silently ignores the entire function body containing the use of that macro. v3 will be posted soon, with the best of both worlds (coccinelle caught spots that I missed, not to mention recent code base changes; and my manual search found the spots in tests/ that coccinelle missed). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9CHoAmem7XjC3IR3HNTVkMLm23edbVSO0-- --CC8q7utnXC2rDTsL2oMBJU1QCquFOrQGv 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/ iQEcBAEBCAAGBQJY5CEEAAoJEKeha0olJ0Nq3EkH/0Oq+K4IoD5nqLL4pz2vb4k0 X8G+asQgxxSI0B8QNRDZa3zyZmUPSNCO1ADwELy+GtrJVnlm/eAirrs+3idFvu8a Z4ijZZ2gnnagXq3vaOSLVYNg0TLddjvJv/Mud3kZO7JdTTTie+RukgCOSp/1M81v EjssWuSsKOFw40vxFIQM5JvxIeYrdJxEpl57z/WmemQRd/V61dYiDMwd3nixMUr3 sFcxwdJeAOBHtIHaZGIHBo/TRQomJL8lz84BXNFJ9RnBOVNvH4TgCtcF0c1ax0xk t09WOGiPCvifeLKTJ+yNNA2FW9ons3rhCUoYFBEYUIEJ6yl2LKGFndXHAg4fSeA= =Ewpr -----END PGP SIGNATURE----- --CC8q7utnXC2rDTsL2oMBJU1QCquFOrQGv--