All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag
Date: Fri, 6 May 2016 10:20:36 -0600	[thread overview]
Message-ID: <572CC454.3020605@redhat.com> (raw)
In-Reply-To: <df0b3b3f-c405-2a39-e74b-781d1dfc115e@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

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 <eblake@redhat.com>
>> ---
>>  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
> 
> [...]
> 
>> @@ -1010,6 +1018,11 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
>>          return 0;
>>      }
>>
>> +    if ((flags & BDRV_REQ_FUA) && (bflag + cflag)) {
> 
> || would do the same job as +, except it looks nicer.

Holdover from rebasing the s/int/bool/ change earlier in the series.
Will fix.

> 
> 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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-05-06 16:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05  3:42 [Qemu-devel] [PATCH v4 0/6] qemu-io: UI enhancements Eric Blake
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 1/6] qemu-io: Add missing option documentation Eric Blake
2016-05-06 15:34   ` Max Reitz
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 2/6] qemu-io: Use bool for command line flags Eric Blake
2016-05-06 15:39   ` Max Reitz
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 3/6] qemu-io: Allow unaligned access by default Eric Blake
2016-05-06 15:59   ` Max Reitz
2016-05-06 16:14     ` Eric Blake
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag Eric Blake
2016-05-06 16:05   ` Max Reitz
2016-05-06 16:20     ` Eric Blake [this message]
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 5/6] qemu-io: Add 'open -u' to set BDRV_O_UNMAP after the fact Eric Blake
2016-05-06 16:08   ` Max Reitz
2016-05-06 16:21     ` Eric Blake
2016-05-06 17:01       ` Eric Blake
2016-05-05  3:42 ` [Qemu-devel] [PATCH v4 6/6] qemu-io: Add 'write -z -u' to test MAY_UNMAP flag Eric Blake
2016-05-06 16:11   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572CC454.3020605@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.