From 72e775c7d9de3eaa35a6edaf9d87cedee149d0f5 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 15 Mar 2016 14:34:37 +0100 Subject: block: Always set writeback mode in blk_new_open() All callers of blk_new_open() either don't rely on the WCE bit set after blk_new_open() because they explicitly set it anyway, or they pass BDRV_O_CACHE_WB unconditionally. This patch changes blk_new_open() so that it always enables writeback mode and asserts that BDRV_O_CACHE_WB is clear. For those callers that used to pass BDRV_O_CACHE_WB unconditionally, the flag is removed now. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/vpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'block/vpc.c') diff --git a/block/vpc.c b/block/vpc.c index 912dfc1a82..8830b5b2b0 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -890,8 +890,7 @@ static int vpc_create(const char *filename, QemuOpts *opts, Error **errp) } blk = blk_new_open(filename, NULL, NULL, - BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_PROTOCOL, - &local_err); + BDRV_O_RDWR | BDRV_O_PROTOCOL, &local_err); if (blk == NULL) { error_propagate(errp, local_err); ret = -EIO; -- cgit v1.2.1