[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 26/31] block: Don't emulate natively supported pwrite
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 26/31] block: Don't emulate natively supported pwritev flags |
Date: |
Wed, 8 Jun 2016 11:16:52 +0200 |
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>
Reviewed-by: Eric Blake <address@hidden>
---
block/io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index 9dc265b..fb99a71 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
- [Qemu-block] [PULL 20/31] migration/block: Convert saving to BlockBackend, (continued)
- [Qemu-block] [PULL 20/31] migration/block: Convert saving to BlockBackend, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 15/31] raw-posix: Convert to bdrv_co_pwrite_zeroes(), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 23/31] qcow2: avoid extra flushes in qcow2, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 27/31] qemu-img bench, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 28/31] qemu-img bench: Sequential writes, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 25/31] blockdev: clean up error handling in do_open_tray, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 21/31] block: assert that bs->request_alignment is a power of 2, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 30/31] qemu-img bench: Implement -S (step size), Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 24/31] block: Fix bdrv_all_delete_snapshot() error handling, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 29/31] qemu-img bench: Make start offset configurable, Kevin Wolf, 2016/06/08
- [Qemu-block] [PULL 26/31] block: Don't emulate natively supported pwritev flags,
Kevin Wolf <=
- [Qemu-block] [PULL 31/31] qemu-img bench: Add --flush-interval, Kevin Wolf, 2016/06/08
- Re: [Qemu-block] [Qemu-devel] [PULL 00/31] Block layer patches, Peter Maydell, 2016/06/08