diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-30 13:43:04 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-03-30 13:43:05 +0100 |
commit | b9c27e7ae6fb1387eafe858d8378ff14cd1c5b89 (patch) | |
tree | 5a66308f776272b19396a47005f5e6438047c8bc /hw | |
parent | 8850dcbfd7664fab86ab49d9c27b6fa700d71618 (diff) | |
parent | f4e732a0a773c4e44c2c183a5d63cd850ffb57d1 (diff) | |
download | qemu-b9c27e7ae6fb1387eafe858d8378ff14cd1c5b89.zip |
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches
# gpg: Signature made Wed 30 Mar 2016 11:57:54 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
* remotes/kevin/tags/for-upstream: (48 commits)
iotests: Test qemu-img convert -S 0 behavior
block/null-{co,aio}: Implement get_block_status()
block/null-{co,aio}: Allow reading zeroes
qemu-img: Fix preallocation with -S 0 for convert
block: Remove bdrv_(set_)enable_write_cache()
block: Remove BDRV_O_CACHE_WB
block: Remove bdrv_parse_cache_flags()
qemu-io: Use bdrv_parse_cache_mode() in reopen_f()
block: Use bdrv_parse_cache_mode() in drive_init()
raw: Support BDRV_REQ_FUA
nbd: Support BDRV_REQ_FUA
iscsi: Support BDRV_REQ_FUA
block: Introduce bdrv_co_writev_flags()
block/qapi: Use blk_enable_write_cache()
block: Move enable_write_cache to BB level
block: Handle flush error in bdrv_pwrite_sync()
block: Always set writeback mode in blk_new_open()
block: blockdev_init(): Call blk_set_enable_write_cache() explicitly
xen_disk: Call blk_set_enable_write_cache() explicitly
qemu-img: Call blk_set_enable_write_cache() explicitly
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/xen_disk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index e619a1f7d9..d4ce380fee 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -889,12 +889,14 @@ static int blk_connect(struct XenDevice *xendev) struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); int pers, index, qflags; bool readonly = true; + bool writethrough = true; /* read-only ? */ if (blkdev->directiosafe) { qflags = BDRV_O_NOCACHE | BDRV_O_NATIVE_AIO; } else { - qflags = BDRV_O_CACHE_WB; + qflags = 0; + writethrough = false; } if (strcmp(blkdev->mode, "w") == 0) { qflags |= BDRV_O_RDWR; @@ -926,6 +928,7 @@ static int blk_connect(struct XenDevice *xendev) error_free(local_err); return -1; } + blk_set_enable_write_cache(blkdev->blk, !writethrough); } else { /* setup via qemu cmdline -> already setup for us */ xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n"); |