[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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 <address@hidden>
>> ---
>> 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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v4 0/6] qemu-io: UI enhancements, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v4 2/6] qemu-io: Use bool for command line flags, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v4 6/6] qemu-io: Add 'write -z -u' to test MAY_UNMAP flag, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v4 3/6] qemu-io: Allow unaligned access by default, Eric Blake, 2016/05/04
- [Qemu-devel] [PATCH v4 5/6] qemu-io: Add 'open -u' to set BDRV_O_UNMAP after the fact, Eric Blake, 2016/05/04