From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOvzD-0006SE-Nd for qemu-devel@nongnu.org; Tue, 02 Sep 2014 17:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOvz7-0006Dt-PQ for qemu-devel@nongnu.org; Tue, 02 Sep 2014 17:51:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOvz7-0006Dl-GZ for qemu-devel@nongnu.org; Tue, 02 Sep 2014 17:51:29 -0400 Message-ID: <54063BDB.4070203@redhat.com> Date: Tue, 02 Sep 2014 15:51:23 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TP7xGbmNhDrOVrh7a0VHKa2fMsDcLrbJB" Subject: Re: [Qemu-devel] [PATCH v13 4/6] qapi: introduce PreallocMode and a new PreallocMode full. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , "Richard W.M. Jones" , Max Reitz , Stefan Hajnoczi , Yasunori Goto This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TP7xGbmNhDrOVrh7a0VHKa2fMsDcLrbJB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/29/2014 02:33 AM, Hu Tao wrote: > This patch prepares for the subsequent patches. >=20 > Signed-off-by: Hu Tao > --- > block/qcow2.c | 23 +++++++++++++++-------- > qapi/block-core.json | 16 ++++++++++++++++ > tests/qemu-iotests/049.out | 2 +- > 3 files changed, 32 insertions(+), 9 deletions(-) >=20 > @@ -1958,6 +1958,13 @@ static int qcow2_create(const char *filename, Qe= muOpts *opts, Error **errp) > flags |=3D BLOCK_FLAG_LAZY_REFCOUNTS; > } > =20 > + if (prealloc && prealloc !=3D PREALLOC_MODE_METADATA) { I find it a bit awkward that you are checking for PREALLOC_MODE_OFF implicitly ('prealloc &&') vs. checking for prealloc mode METADATA explicitly. Since there are only three modes, would it be any simpler to just have written: if (prealloc =3D=3D PREALLOC_MODE_FULL) { --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --TP7xGbmNhDrOVrh7a0VHKa2fMsDcLrbJB 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 iQEcBAEBCAAGBQJUBjvbAAoJEKeha0olJ0Nq1vQH/11xzIc3boIpR78EeiJzQVqk Ic6SruRUAczlnuwuXopRAnnuJpsqr33f85pQ3FimSQDV4shhZVk25CAQISEfQ4hr F7yvxGEM9lJKTib8n9ylkYz6eNv/o6FadL5LygCIilNOMMCtFjbxG3emFJzE49ru jmuLv0viksxfE0UwBPdLXw1V9msZOFxjhn7Dt2dGOL1EqoFaFISPpw6eIcatsPbI ggpvhSUD6C7xkcOcdu0y4jU5292cxT2CsW3rnW4ggnX1b90lJ/ypxxko9/NK8PY6 6I3dtRpTdeweviThQHCJD77TaOLkMKrDwXBVGkx+AB1yWuKTvwNghe1ol3SSKVg= =X8RH -----END PGP SIGNATURE----- --TP7xGbmNhDrOVrh7a0VHKa2fMsDcLrbJB--