diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-03-18 17:46:45 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-03-30 12:16:03 +0200 |
commit | 61de4c680846167e01d7ba42bf787f8d1d80bf5e (patch) | |
tree | ec4a6353a6f747b6201e5411ad77382ad39f2437 /block/block-backend.c | |
parent | 53e8ae010071637b4317402e2ece9e4dbb329c50 (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/block-backend.c')
-rw-r--r-- | block/block-backend.c | 11 |
1 files changed, 0 insertions, 11 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) |