* [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
@ 2016-06-07 13:56 Kevin Wolf
2016-06-07 14:32 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kevin Wolf @ 2016-06-07 13:56 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, eblake, stefanha, famz, qemu-devel
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(-)
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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
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
2016-06-08 14:11 ` Stefan Hajnoczi
2016-06-08 14:12 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2016-06-07 14:32 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: stefanha, famz, qemu-devel
[-- 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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
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
@ 2016-06-08 14:11 ` Stefan Hajnoczi
2016-06-08 14:12 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-06-08 14:11 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, eblake, famz, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 623 bytes --]
On Tue, Jun 07, 2016 at 03:56:37PM +0200, 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: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags
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
2016-06-08 14:11 ` Stefan Hajnoczi
@ 2016-06-08 14:12 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-06-08 14:12 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, eblake, famz, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 664 bytes --]
On Tue, Jun 07, 2016 at 03:56:37PM +0200, 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(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-08 14:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-06-08 14:11 ` Stefan Hajnoczi
2016-06-08 14:12 ` Stefan Hajnoczi
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).