qemu-devel
[Top][All Lists]
Advanced

[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: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v4 4/6] qemu-io: Add 'write -f' to test FUA flag
Date: Fri, 6 May 2016 18:05:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

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.

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;

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]