From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMkxq-0007L8-Dd for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:36:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMkxn-0007ae-JU for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:36:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMkxn-0007aY-BV for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:36:35 -0400 Message-ID: <523B604C.4080801@redhat.com> Date: Thu, 19 Sep 2013 14:36:28 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379425736-11326-1-git-send-email-pl@kamp.de> <1379425736-11326-19-git-send-email-pl@kamp.de> In-Reply-To: <1379425736-11326-19-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9taAGxVqqO0j68Cgmn6x6914UVRqbqg6s" Subject: Re: [Qemu-devel] [PATCHv2 18/20] qemu-img: add support for fully allocated images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9taAGxVqqO0j68Cgmn6x6914UVRqbqg6s Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/17/2013 07:48 AM, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > qemu-img.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index 3e5e388..7600b58 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -100,8 +100,10 @@ static void help(void) > " '-h' with or without a command shows this help and lists= the supported formats\n" > " '-p' show progress of command (only certain commands)\n"= > " '-q' use Quiet mode - do not print any output (except er= rors)\n" > - " '-S' indicates the consecutive number of bytes that must= contain only zeros\n" > - " for qemu-img to create a sparse image during conver= sion\n" > + " '-S' indicates the consecutive number of bytes (defaults= to 4096) that must\n" > + " contain only zeros for qemu-img to create a sparse = image during\n" > + " conversion. if the number of bytes is 0 sparse file= s are disabled and\n" s/if/If/ s/0/0,/ > + " images will always be fully allocated\n" IIRC correctly, on NTFS file system, the minimum hole size for a sparse file is 64k. Can you please make this option accept a suffixed number (-S 64k) instead of forcing me to spell it out (-S 65536)? > " '--output' takes the format in which the output must be = done (human or json)\n" > " '-n' skips the target volume creation (useful if the vol= ume is created\n" > " prior to running qemu-img)\n" > @@ -1468,7 +1470,7 @@ static int img_convert(int argc, char **argv) > /* signal EOF to align */ > bdrv_write_compressed(out_bs, 0, NULL, 0); > } else { > - int has_zero_init =3D bdrv_has_zero_init(out_bs); > + int has_zero_init =3D min_sparse ? bdrv_has_zero_init(out_bs) = : 0; Is this another function that should be returning bool instead of int? But that's a question for a separate patch. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9taAGxVqqO0j68Cgmn6x6914UVRqbqg6s 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSO2BMAAoJEKeha0olJ0NqmeEIAK2deptlfAiY4fsRIXKy9uWO 76/09q8Lm67bfTU9wAtfG0g6h+Op10vJhPq664l1Ipy8ovjyXSkofeRfYm7hC9K/ tpBtzIA0XVrufBUmOo3pvYuPDE6Kki9VW0fz5yTWuaDlv/2KPuhusChzQkY87mVa gJRWuIWRBCjq87jk2suqmTm3mRBmu+OeYpx9TpVVwK9ti6wd/vAIVJvPpTpXSq0p lEHzlpUzDlNy9tppU3/B2HmsDN5z9YSKnye+21jLBGqMyDIKGv0A0fZRuXkmHmfL cvfwU0E1Wplx02B4f8NvaNyEWqj4BMt2z5f07ouLZgX5WPJWKMwzK7RvLhdsofI= =9rxy -----END PGP SIGNATURE----- --9taAGxVqqO0j68Cgmn6x6914UVRqbqg6s--