qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
Date: Tue, 7 Jun 2016 08:32:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/07/2016 07:56 AM, Kevin Wolf wrote:
> Drivers that implement .bdrv_co_pwritev() get the flags passed as an
> argument to said function, but we also unconditionally emulate the flags
> anyway. We shouldn't do that.
> 
> Fix this by clearing all flags that the driver supports natively after
> it returns from .bdrv_co_pwritev().
> 
> Fixes: 4df863f3 ('block: Make supported_write_flags a per-bds property')
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block/io.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Reviewed-by: Eric Blake <address@hidden>

> diff --git a/block/io.c b/block/io.c
> index 2b10870..dec30e3 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -816,7 +816,9 @@ static int coroutine_fn 
> bdrv_driver_pwritev(BlockDriverState *bs,
>      int ret;
>  
>      if (drv->bdrv_co_pwritev) {
> -        ret = drv->bdrv_co_pwritev(bs, offset, bytes, qiov, flags);
> +        ret = drv->bdrv_co_pwritev(bs, offset, bytes, qiov,
> +                                   flags & bs->supported_write_flags);
> +        flags &= ~bs->supported_write_flags;
>          goto emulate_flags;
>      }
>  
> 

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