From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayiPI-0008VV-Av for qemu-devel@nongnu.org; Fri, 06 May 2016 12:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayiP6-00037H-Ek for qemu-devel@nongnu.org; Fri, 06 May 2016 12:15:06 -0400 References: <1462419759-14694-1-git-send-email-eblake@redhat.com> <1462419759-14694-4-git-send-email-eblake@redhat.com> <9ee1be0b-439c-0344-5523-91c7def32676@redhat.com> From: Eric Blake Message-ID: <572CC2E0.4060501@redhat.com> Date: Fri, 6 May 2016 10:14:24 -0600 MIME-Version: 1.0 In-Reply-To: <9ee1be0b-439c-0344-5523-91c7def32676@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RMUEfOjTotId0bWnObV9c9ju7hbrILgta" Subject: Re: [Qemu-devel] [PATCH v4 3/6] qemu-io: Allow unaligned access by default 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RMUEfOjTotId0bWnObV9c9ju7hbrILgta Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/06/2016 09:59 AM, Max Reitz wrote: > On 05.05.2016 05:42, Eric Blake wrote: >> There's no reason to require the user to specify a flag just so >> they can pass in unaligned numbers. Keep 'read -p' and 'write -p' >> as no-ops so that I don't have to hunt down and update all users >> of qemu-io, but otherwise make their behavior default as 'read' and >> 'write'. Also fix 'write -z', 'readv', 'writev', 'writev', >> 'aio_read', 'aio_write', and 'aio_write -z'. For now, 'read -b', >> 'multiwrite', 'write -b', and 'write -c' still require alignment. >> >> qemu-iotest 23 is updated to match, as the only test that was >> previously explicitly expecting an error on an unaligned request. >> >> -" -p, -- allow unaligned access\n" >> +" -p, -- ignored for back-compat\n" >=20 > We're not so close to the 80 character limit here to justify shortening= > this as much. ;-) >=20 > I really wouldn't mind a full "backwards compatibility". sure, in all affected spots. >> @@ -968,7 +951,7 @@ static const cmdinfo_t write_cmd =3D { >> .cfunc =3D write_f, >> .argmin =3D 2, >> .argmax =3D -1, >> - .args =3D "[-bcCpqz] [-P pattern ] off len", >> + .args =3D "[-bcCqz] [-P pattern ] off len", >=20 > Would you mind removing the space after "pattern" along with this chang= e? Done >> - if (bflag + pflag + zflag > 1) { >> - printf("-b, -p, or -z cannot be specified at the same time\n"= ); >> + if (bflag + zflag > 1) { >=20 > Could you make that "bflag && zflag" instead? >=20 > Adding booleans was fine for the meantime between patch 2 and this one,= > but I'd rather not keep it in the long run. Testing that at most one of three booleans is set really needs addition (the same expression using && and || is ugly and long); but you are correct that for just two booleans, && is so much more legible. Will fix= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RMUEfOjTotId0bWnObV9c9ju7hbrILgta 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/ iQEcBAEBCAAGBQJXLMLgAAoJEKeha0olJ0NqyVIH/jRwnKnQkO4cWLbSnjcw83av JXATtAjFW1k/MixGIzp/5GPla88h3ufQv9OXHaHLSz8KMTyOdpsFriPuhiAfgVKR KqlLTsHIJOM6ZhQvKWUkTJFctNK4kGv38GD6mdYt+GlMgXVxHW4EWAP/DVHQixB2 x4v3N8noB+4fbtGmrl/kZ9sVwm52sw4ZxVrNdfL2LIXf8KRrV6JPaGV/bCIUhLWw qslgOcXqAP3G/ZeUJO/iVoUxzbV+C12ygTriPxVoiGzcKtm+gM9Iz2kne77BrpEC CFtyUPYbKdq7mTJL6zg1eTk6OA4sXN4f4zkcqPCPk7ozJyxp7H/lA703WX3CWSI= =7jUO -----END PGP SIGNATURE----- --RMUEfOjTotId0bWnObV9c9ju7hbrILgta--