Received: from eggs.gnu.org ([2001:4830:134:3::10]:36236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayiGr-0005uK-DR for qemu-devel@nongnu.org; Fri, 06 May 2016 12:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayiGf-0000r3-ND for qemu-devel@nongnu.org; Fri, 06 May 2016 12:06:23 -0400 References: <1462419759-14694-1-git-send-email-eblake@redhat.com> <1462419759-14694-5-git-send-email-eblake@redhat.com> From: Max Reitz Message-ID: Date: Fri, 6 May 2016 18:05:40 +0200 MIME-Version: 1.0 In-Reply-To: <1462419759-14694-5-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CKsawX1KRAbJuhpCp6GShM0XXUoA1h4WM" Subject: Re: [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CKsawX1KRAbJuhpCp6GShM0XXUoA1h4WM Content-Type: multipart/mixed; boundary="EmPJhmPEn8xO9jaXq4TNIKg0CvUS0rPAc" From: Max Reitz To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com Message-ID: Subject: Re: [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag References: <1462419759-14694-1-git-send-email-eblake@redhat.com> <1462419759-14694-5-git-send-email-eblake@redhat.com> In-Reply-To: <1462419759-14694-5-git-send-email-eblake@redhat.com> --EmPJhmPEn8xO9jaXq4TNIKg0CvUS0rPAc Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 05.05.2016 05:42, Eric Blake wrote: > Make it easier to test block drivers with BDRV_REQ_FUA in > .supported_write_flags, by adding the '-f' flag to qemu-io to > conditionally pass the flag through to specific writes ('write', > 'write -z', 'writev', 'aio_write', 'aio_write -z'). You'll want > to use 'qemu-io -t none' to actually make -f useful (as > otherwise, the default writethrough mode automatically sets the > FUA bit on every write). >=20 > Signed-off-by: Eric Blake > --- > qemu-io-cmds.c | 57 +++++++++++++++++++++++++++++++++++++++++---------= ------- > 1 file changed, 41 insertions(+), 16 deletions(-) >=20 > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index 8bcf742..ba811fe 100644 > --- a/qemu-io-cmds.c > +++ b/qemu-io-cmds.c [...] > @@ -1010,6 +1018,11 @@ static int write_f(BlockBackend *blk, int argc, = char **argv) > return 0; > } >=20 > + if ((flags & BDRV_REQ_FUA) && (bflag + cflag)) { || would do the same job as +, except it looks nicer. Although technically correct, I'm very hesitant to give an R-b for boolean arithmetics. Max > + printf("-f and -b or -c cannot be specified at the same time\n= "); > + return 0; > + } > + > if (zflag && Pflag) { > printf("-z and -P cannot be specified at the same time\n"); > return 0; --EmPJhmPEn8xO9jaXq4TNIKg0CvUS0rPAc-- --CKsawX1KRAbJuhpCp6GShM0XXUoA1h4WM 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 iQEcBAEBCAAGBQJXLMDUAAoJEDuxQgLoOKytTWYH/R2va3NcH0/gJGbDj/UUmOiT onJFue72hbAylCwiKdth435wV3DedPnsCbmPLO46FYYbm02ctLFtK+IfI7W/ZcJC uDnJMBciK96qiT7q1CSg6TjBjoPGopnFQ5XOg4IEMSRkPyBs20k3xvpIU/tZLFb6 b/hkt4E4ddLMLADCpGsyv/pyje3MLxqljGfJnENbxlKxGuCT1AW+rLwsaXF6Ckqb ZNvZ+hk7S6YvvNf8ftsvt1Jbc+dFPtWsaOBgKD+4gA8r6q8Hx0xEvMbPmFCQH/hW un65rKz6QMCyGjc9pGn76BQfEMEAF0rQpKvx2sxU4RBM3u4cimwyyXhrLLJQgTI= =FtFe -----END PGP SIGNATURE----- --CKsawX1KRAbJuhpCp6GShM0XXUoA1h4WM--