qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: stefanha@redhat.com, famz@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
Date: Tue, 7 Jun 2016 08:32:10 -0600	[thread overview]
Message-ID: <5756DAEA.4030001@redhat.com> (raw)
In-Reply-To: <1465307797-28378-1-git-send-email-kwolf@redhat.com>

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

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 <kwolf@redhat.com>
> ---
>  block/io.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Reviewed-by: Eric Blake <eblake@redhat.com>

> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-06-07 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 13:56 [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags Kevin Wolf
2016-06-07 14:32 ` Eric Blake [this message]
2016-06-08 14:11 ` Stefan Hajnoczi
2016-06-08 14:12 ` Stefan Hajnoczi

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=5756DAEA.4030001@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).