aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-03-04 14:53:50 +0100
committerKevin Wolf <kwolf@redhat.com>2016-03-14 16:46:43 +0100
commit6340472c54529c5b703deec3ab0d6bdfe644f11e (patch)
tree510ecb67b21864f7fb2d761d7dc724e976e9669c /block/vmdk.c
parent2073d410ce3f2b1507bccd6aba68e8808647f9a9 (diff)
block: Use writeback in .bdrv_create() implementations
There's no reason to use a writethrough cache mode while creating an image. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 03be7f0f5f..dd8093688a 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1664,7 +1664,8 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
}
assert(bs == NULL);
- ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_RDWR | BDRV_O_PROTOCOL,
+ ret = bdrv_open(&bs, filename, NULL, NULL,
+ BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_PROTOCOL,
&local_err);
if (ret < 0) {
error_propagate(errp, local_err);
@@ -1944,7 +1945,8 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp)
ret = -ENOENT;
goto exit;
}
- ret = bdrv_open(&bs, full_backing, NULL, NULL, BDRV_O_NO_BACKING, errp);
+ ret = bdrv_open(&bs, full_backing, NULL, NULL,
+ BDRV_O_NO_BACKING | BDRV_O_CACHE_WB, errp);
g_free(full_backing);
if (ret != 0) {
goto exit;
@@ -2015,7 +2017,8 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp)
}
assert(new_bs == NULL);
ret = bdrv_open(&new_bs, filename, NULL, NULL,
- BDRV_O_RDWR | BDRV_O_PROTOCOL, &local_err);
+ BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_PROTOCOL,
+ &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
goto exit;