From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfysT-0004Zd-Nu for qemu-devel@nongnu.org; Thu, 01 May 2014 17:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfysP-0006fi-9N for qemu-devel@nongnu.org; Thu, 01 May 2014 17:50:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfysP-0006fe-1F for qemu-devel@nongnu.org; Thu, 01 May 2014 17:50:45 -0400 Message-ID: <5362C1B3.7000704@redhat.com> Date: Thu, 01 May 2014 15:50:43 -0600 From: Eric Blake MIME-Version: 1.0 References: <1398762656-26079-1-git-send-email-cyliu@suse.com> <1398762656-26079-20-git-send-email-cyliu@suse.com> In-Reply-To: <1398762656-26079-20-git-send-email-cyliu@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kNjUPiNSpRP6weeQ7MseHAnDu8SV1G0s8" Subject: Re: [Qemu-devel] [PATCH V26 19/32] qcow2.c: replace QEMUOptionParameter with QemuOpts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu , qemu-devel@nongnu.org Cc: stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kNjUPiNSpRP6weeQ7MseHAnDu8SV1G0s8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/29/2014 03:10 AM, Chunyan Liu wrote: > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu > --- > block/qcow2.c | 265 +++++++++++++++++++++++++++---------------= -------- > include/qemu/option.h | 1 + > util/qemu-option.c | 2 +- > 3 files changed, 143 insertions(+), 125 deletions(-) >=20 > @@ -2375,10 +2392,10 @@ static BlockDriver bdrv_qcow2 =3D { > .bdrv_open =3D qcow2_open, > .bdrv_close =3D qcow2_close, > .bdrv_reopen_prepare =3D qcow2_reopen_prepare, > - .bdrv_create =3D qcow2_create, > - .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > + .bdrv_create2 =3D qcow2_create, > + .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > .bdrv_co_get_block_status =3D qcow2_co_get_block_status, > - .bdrv_set_key =3D qcow2_set_key, > + .bdrv_set_key =3D qcow2_set_key, Looks odd to be re-indenting some, but not all, of the existing elements, particularly when you aren't reindenting them to the same depth. But as the indentation is already a mess here, you aren't making it worse, so it doesn't impact my review. > +++ b/include/qemu/option.h > @@ -130,6 +130,7 @@ char *qemu_opt_get_del(QemuOpts *opts, const char *= name); > * Returns: true if @opts includes 'help' or equivalent. > */ > bool qemu_opt_has_help_opt(QemuOpts *opts); > +QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name); > bool qemu_opt_get_bool(QemuOpts *opts, const char *name, bool defval);= > uint64_t qemu_opt_get_number(QemuOpts *opts, const char *name, uint64_= t defval); > uint64_t qemu_opt_get_size(QemuOpts *opts, const char *name, uint64_t = defval); > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 2667e16..cb92b42 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -568,7 +568,7 @@ void qemu_opts_print_help(QemuOptsList *list) > } > /* ------------------------------------------------------------------ = */ > =20 > -static QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name) > +QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name) > { I would have used a separate commit for exporting qemu_opt_find as a non-static function. But I can live with it here, if it will get this in the tree sooner. Reviewed-by: Eric Blake But if you DO respin this series, then when you split the function export into its own patch, please also consider adding documentation to the function (undocumented static functions are generally okay, because you already have the file open and can just read the function; but undocumented exported functions risk a caller expecting one semantic, but the implementation providing another, and the two getting out of sync because there was nothing written to document what was expected). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --kNjUPiNSpRP6weeQ7MseHAnDu8SV1G0s8 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/ iQEcBAEBCAAGBQJTYsGzAAoJEKeha0olJ0NqLoAH/Arak8MRNFcTYjOd9vAul6Da NkRMkUn9r56DIOkfN1LVtJqgfbUvTlH65MloFrsiN85lROzEPwwBcnpUH1xopKyf I9jvYIT/vzFmJ2+LLqc4C6ni/Y1xYM2awgcjMf6zBCWNnBWNuyOsM5cm5iaVebbu 2iNskdv42PF7IQkXxLSpDhJ235gTXyvmr6EG74/XAsucvwDgyoAhkfC3F5kLwPha J6LBZ7GW3UZcdKnvCRACoql0AKvJsLsJ53jXGfIEHsT1IQNPGELkEvTBCbbl1KJG hW1Plh32YyTYgfmLhCxIxJTNiIGMQ9q9BvaCwWwbDPkERt3dXb4h6Jry3TYAJAU= =KYfF -----END PGP SIGNATURE----- --kNjUPiNSpRP6weeQ7MseHAnDu8SV1G0s8--