qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PULL 64/69] qemu-io: Add 'write -f' to te


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PULL 64/69] qemu-io: Add 'write -f' to test FUA flag
Date: Thu, 12 May 2016 15:23:59 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 05/12/2016 08:35 AM, Kevin Wolf wrote:
> From: Eric Blake <address@hidden>
> 
> 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>
> Message-id: address@hidden
> Reviewed-by: Max Reitz <address@hidden>
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  qemu-io-cmds.c | 57 +++++++++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 41 insertions(+), 16 deletions(-)
> 

> @@ -935,6 +938,7 @@ static void write_help(void)
> +" -f, -- use Force Unit Access semantics\n"

> @@ -951,7 +955,7 @@ static const cmdinfo_t write_cmd = {
> -    .args       = "[-bcCqz] [-P pattern] off len",
> +    .args       = "[-bcCfqz] [-P pattern] off len",

> @@ -969,7 +974,7 @@ static int write_f(BlockBackend *blk, int argc, char 
> **argv)
> -    while ((c = getopt(argc, argv, "bcCpP:qz")) != -1) {
> +    while ((c = getopt(argc, argv, "bcCfpP:qz")) != -1) {

> @@ -980,6 +985,9 @@ static int write_f(BlockBackend *blk, int argc, char 
> **argv)
>          case 'C':
>              Cflag = true;
>              break;
> +        case 'f':

Four places to touch per added option.  'write -f' is okay...

> @@ -1097,6 +1110,7 @@ writev_help(void)
> +" -f, -- use Force Unit Access semantics\n"

> @@ -1108,7 +1122,7 @@ static const cmdinfo_t writev_cmd = {
> -    .args       = "[-Cq] [-P pattern] off len [len..]",
> +    .args       = "[-Cfq] [-P pattern] off len [len..]",

> @@ -1131,6 +1146,9 @@ static int writev_f(BlockBackend *blk, int argc, char 
> **argv)
> +        case 'f':

Whoops - forgot to update getopt() for 'writev -f'. Followup patch
coming shortly.  I also botched it in 65/69, for 'aio_write -z -u'.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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