Received: from eggs.gnu.org ([2001:4830:134:3::10]:59648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8vsG-0007TQ-2t for qemu-devel@nongnu.org; Mon, 21 Nov 2016 16:11:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8vsE-0007Ef-Sp for qemu-devel@nongnu.org; Mon, 21 Nov 2016 16:11:36 -0500 References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-9-git-send-email-eblake@redhat.com> <3ae2a9aa-df53-fab2-aa98-a87787d5853e@redhat.com> From: Eric Blake Message-ID: <52021069-625d-6712-cc7c-1c1b26673bbe@redhat.com> Date: Mon, 21 Nov 2016 15:11:26 -0600 MIME-Version: 1.0 In-Reply-To: <3ae2a9aa-df53-fab2-aa98-a87787d5853e@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ILELFS4tad2Ah4vin7IqNekhirW1c1pRm" Subject: Re: [Qemu-devel] [PATCH v2 8/9] blkdebug: Add ability to override unmap geometries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ILELFS4tad2Ah4vin7IqNekhirW1c1pRm From: Eric Blake To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, Markus Armbruster Message-ID: <52021069-625d-6712-cc7c-1c1b26673bbe@redhat.com> Subject: Re: [PATCH v2 8/9] blkdebug: Add ability to override unmap geometries References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-9-git-send-email-eblake@redhat.com> <3ae2a9aa-df53-fab2-aa98-a87787d5853e@redhat.com> In-Reply-To: <3ae2a9aa-df53-fab2-aa98-a87787d5853e@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2016 05:02 PM, Max Reitz wrote: > On 17.11.2016 21:14, Eric Blake wrote: >> Make it easier to simulate the Dell Equallogic iSCSI with its >=20 > Somehow I feel bad putting company and product names into commit messag= es... Not the first time I've done it - see commit b8d0a980. Keeping it in the commit message is one thing (so I probably won't change this one), but having it in the iotest is another (so I probably will rework the comments in 9/9 to avoid the specific mention). >=20 >> unusual 15M preferred and maximum unmap and write zero sizing, >> or to simulate Linux loopback block devices enforcing a small >> max_transfer of 64k, by allowing blkdebug to wrap any other >> device with further restrictions on various alignments. >> >> + { >> + .name =3D "opt-write-zero", >> + .type =3D QEMU_OPT_SIZE, >> + .help =3D "Optimum write zero size in bytes", >=20 > s/size/alignment/? Yes, will fix. >> @@ -398,6 +429,53 @@ static int blkdebug_open(BlockDriverState *bs, QD= ict *options, int flags, >> ret =3D -EINVAL; >> goto fail_unref; >> } >> + max_transfer =3D qemu_opt_get_size(opts, "max-transfer", 0); >> + if (max_transfer < INT_MAX && >> + QEMU_IS_ALIGNED(max_transfer, MAX(align, BDRV_SECTOR_SIZE))) = { >> + s->max_transfer =3D max_transfer; >> + } else if (max_transfer) { >> + error_setg(errp, "Invalid argument"); >=20 > Could you be more specific? Same in all of the error_setg() calls below= =2E >=20 >> + ret =3D -EINVAL; >> + goto fail_unref; >> + } >=20 > Also, the way this is formatted seems not intuitive to me. I know it's > the same as it's been done for "align", but normally I'd use the follow= ing: >=20 > s->value =3D qemu_opt_get_size(...); > if (s->value is set and invalid) { > /* error out */ > } I'll see what I can do. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ILELFS4tad2Ah4vin7IqNekhirW1c1pRm 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/ iQEcBAEBCAAGBQJYM2L+AAoJEKeha0olJ0NqUf8H/0p5VXn87snCWVpFKKd5k32R x1RHpz03nukIIp3GVW3G0Scj4Lx4QwgSQf7uWs/7ceNd2uVpaQKJSJEgZ9KzFRtm 3yFJExTSFP+fM36ruqxaUm/dI0P9E7vqM5JDaV1kWnkBTuRASbKpecoSWrkQyl20 W6Su7PUaG1wDDi5GBCCX4+yH+LsgKd8YGBl8nf/0Dvj5w4Rrcgvywv+5ipycqS4Z zf2R3hHRa66a0AhFFjXfT4wfJizoG16BfFJcfV+ygSyiix1tPNKVTg+BxPrcGv0E EGUT3NeWJcJDhxTtpQEQkaKhAFXLFqBIj3DkQsc2EPeXRAQVhhwEm+qWTRtq8Qc= =a3K2 -----END PGP SIGNATURE----- --ILELFS4tad2Ah4vin7IqNekhirW1c1pRm--