block: Don't emulate natively supported pwritev flags
PATCH 1/1 block: Don't emulate natively supported pwritev flags
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().
--- block/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
block/io.c +3 -1
@@ -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; }
Signature · 1 line
1.8.3.1
Quoted 4 lines · Kevin Wolf
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.
Quoted 9 lines
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 <[email protected]>--- block/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 16 lines
block/io.c +3
-1@@ -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; }
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 4 lines · Kevin Wolf
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.
Quoted 8 lines
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 <[email protected]>--- block/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Stefan Hajnoczi
AppliedQuoted 4 lines · Kevin Wolf
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.
Quoted 8 lines
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 <[email protected]>--- 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