From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayiVI-00084M-Ip for qemu-devel@nongnu.org; Fri, 06 May 2016 12:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayiV6-0004f4-PK for qemu-devel@nongnu.org; Fri, 06 May 2016 12:21:19 -0400 References: <1462419759-14694-1-git-send-email-eblake@redhat.com> <1462419759-14694-5-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <572CC454.3020605@redhat.com> Date: Fri, 6 May 2016 10:20:36 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cUaU6qSMtnKaH00S3Jp9VjOeFsOwxKuc1" 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: 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) --cUaU6qSMtnKaH00S3Jp9VjOeFsOwxKuc1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/06/2016 10:05 AM, Max Reitz wrote: > 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). >> >> Signed-off-by: Eric Blake >> --- >> qemu-io-cmds.c | 57 +++++++++++++++++++++++++++++++++++++++++--------= -------- >> 1 file changed, 41 insertions(+), 16 deletions(-) >> >> 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 >=20 > [...] >=20 >> @@ -1010,6 +1018,11 @@ static int write_f(BlockBackend *blk, int argc,= char **argv) >> return 0; >> } >> >> + if ((flags & BDRV_REQ_FUA) && (bflag + cflag)) { >=20 > || would do the same job as +, except it looks nicer. Holdover from rebasing the s/int/bool/ change earlier in the series. Will fix. >=20 > Although technically correct, I'm very hesitant to give an R-b for > boolean arithmetics. Well-defined by C doesn't mean well-understood :) I'm also more comfortable with boolean operators for boolean variables; and I even know of a recent patch to GNU coreutils due to gcc 7 starting to warn about constructs on bool that look fishy because of promotion-to-int when using non-bool operators. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cUaU6qSMtnKaH00S3Jp9VjOeFsOwxKuc1 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/ iQEcBAEBCAAGBQJXLMRUAAoJEKeha0olJ0NqmrEH/1Tq8vVK1s3Yeeltwk34y5bc ImfhOtNLRffgmKpDoQDrph2Rv9QrbYLOEyzegkLCCfeuuin4yWZ4PrhayZn7+awN 0E/S5Ff16jaugytq0GpDiJzL3YT5jVjyUmi87avpsNfgbfae861bvIXoahNa4L4l SaKuPWCYr09YnM421JsCVTc+tUdjcYM4qIub8FxjW/DIASuxLzb6e2ShSj42ksRe V98XvQp1ImRdYUxtkV90AMf8IZsy+1IG2lXwfGfcRLQgpnOb9dPBP20q9HzL5bsZ R0k8ARigDfpx2TAwlzTy7ifQEceXHkcw/sq5hVSKl23EPgKDvgbePT5TruatUOw= =rzn2 -----END PGP SIGNATURE----- --cUaU6qSMtnKaH00S3Jp9VjOeFsOwxKuc1--