aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-03-18 17:46:45 +0100
committerKevin Wolf <kwolf@redhat.com>2016-03-30 12:16:03 +0200
commit61de4c680846167e01d7ba42bf787f8d1d80bf5e (patch)
treeec4a6353a6f747b6201e5411ad77382ad39f2437 /block
parent53e8ae010071637b4317402e2ece9e4dbb329c50 (diff)
block: Remove BDRV_O_CACHE_WB
The previous patches have successively made blk->enable_write_cache the true source for the information whether a writethrough mode must be implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage we're carrying around, so now's the time to remove it. At the same time, we remove the 'cache.writeback' option parsing on the BDS level as the only effect was setting the BDRV_O_CACHE_WB flag. This change requires test cases that explicitly enabled the option to drop it. Other than that and the change of the error message when writethrough is enabled on the BDS level (from "Can't set writethrough mode" to "doesn't support the option"), there should be no change in behaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/block-backend.c11
-rw-r--r--block/vvfat.c3
2 files changed, 1 insertions, 13 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index a263636a58..d74f6701b5 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -150,8 +150,6 @@ BlockBackend *blk_new_open(const char *filename, const char *reference,
BlockBackend *blk;
int ret;
- assert((flags & BDRV_O_CACHE_WB) == 0);
-
blk = blk_new_with_bs(errp);
if (!blk) {
QDECREF(options);
@@ -1224,15 +1222,6 @@ int blk_enable_write_cache(BlockBackend *blk)
void blk_set_enable_write_cache(BlockBackend *blk, bool wce)
{
blk->enable_write_cache = wce;
-
- /* TODO Remove this when BDRV_O_CACHE_WB isn't used any more */
- if (blk->root) {
- if (wce) {
- blk->root->bs->open_flags |= BDRV_O_CACHE_WB;
- } else {
- blk->root->bs->open_flags &= ~BDRV_O_CACHE_WB;
- }
- }
}
void blk_invalidate_cache(BlockBackend *blk, Error **errp)
diff --git a/block/vvfat.c b/block/vvfat.c
index eb1126cbad..6b853146f0 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2957,8 +2957,7 @@ static int enable_write_target(BDRVVVFATState *s, Error **errp)
options = qdict_new();
qdict_put(options, "driver", qstring_from_str("qcow"));
ret = bdrv_open(&s->qcow, s->qcow_filename, NULL, options,
- BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH,
- errp);
+ BDRV_O_RDWR | BDRV_O_NO_FLUSH, errp);
if (ret < 0) {
goto err;
}