Received: from eggs.gnu.org ([2001:4830:134:3::10]:48142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKmi6-0006ZT-26 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 09:17:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKmi5-0000We-61 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 09:17:50 -0400 References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-3-git-send-email-clord@redhat.com> From: Max Reitz Message-ID: Date: Wed, 6 Jul 2016 15:17:38 +0200 MIME-Version: 1.0 In-Reply-To: <1467732272-23368-3-git-send-email-clord@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kFUb19r1jfCjSiCvK5ACaurG8VNqkUNcw" Subject: Re: [Qemu-devel] [PATCH v3 02/32] blockdev: Add dynamic generation of module_block.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, Marc Mari This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kFUb19r1jfCjSiCvK5ACaurG8VNqkUNcw From: Max Reitz To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, Marc Mari Message-ID: Subject: Re: [PATCH v3 02/32] blockdev: Add dynamic generation of module_block.h References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-3-git-send-email-clord@redhat.com> In-Reply-To: <1467732272-23368-3-git-send-email-clord@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05.07.2016 17:24, Colin Lord wrote: > From: Marc Mari >=20 > To simplify the addition of new block modules, add a script that genera= tes > module_block.h automatically from the modules' source code. >=20 > This script assumes that the QEMU coding style rules are followed. But the script itself doesn't follow it. :-P ("ERROR: code indent should never use tabs", to quote checkpatch.pl) >=20 > Signed-off-by: Marc Mar=C3=AD > Signed-off-by: Colin Lord > --- > Makefile | 7 +++ > scripts/modules/module_block.py | 122 ++++++++++++++++++++++++++++++++= ++++++++ > 2 files changed, 129 insertions(+) > create mode 100644 scripts/modules/module_block.py >=20 [...] > diff --git a/scripts/modules/module_block.py b/scripts/modules/module_b= lock.py > new file mode 100644 > index 0000000..4075574 > --- /dev/null > +++ b/scripts/modules/module_block.py > @@ -0,0 +1,122 @@ [...] > +def add_module(fheader, library, format_name, protocol_name, > + probe, probe_device): > + lines =3D [] > + lines.append('.library_name =3D "' + library + '",') > + if format_name !=3D "": > + lines.append('.format_name =3D "' + format_name + '",') > + if protocol_name !=3D "": > + lines.append('.protocol_name =3D "' + protocol_name + '",') > + if probe: > + lines.append('.has_probe =3D true,') > + if probe_device: > + lines.append('.has_probe_device =3D true,') > + > + text =3D '\n\t'.join(lines) > + fheader.write('\n\t{\n\t' + text + '\n\t},') I think our normal coding style would be met with: text =3D '\n '.join(lines) fheader.write('\n {\n ' + text + '\n },') Rest looks good, so with that fixed (or maybe we don't need to fix it because it's just a generated header, I don't know): Reviewed-by: Max Reitz --kFUb19r1jfCjSiCvK5ACaurG8VNqkUNcw 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 iQEvBAEBCAAZBQJXfQTyEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisreLH B/96lL3ZNJ/4CAdinYnc4eSAW0suqGpjswj46Ghzj8/36FN96744+a7D/YtKd8jH oC5A/xkTHemNiXrzOVu37jXDlzbLZi4U+L33wW3kkfLo8irtGWx+QojBF0VlSvDS ugBq3RAKYi2So8DyLONfs+BYiRFJWaj1oXVydu58Jmws6skLDX2K3JP7/nVBNxk1 qv2GavpKAazyvomFBf4v7XD8CIVCt6LP7rLRpKCe6grctag2mh9c3pHRIFUy2nLh hQF0OJ6b0DA9khFpLG1AFG4EpuxC7F0VVatBZZrd+/M3M5zTD5YBLk9AoMARTMzD dG5rvRAw8OobZovM+/L+YEzR =YppB -----END PGP SIGNATURE----- --kFUb19r1jfCjSiCvK5ACaurG8VNqkUNcw--