From c9fbb99d41b05acf0d7b93deb2fcdbf9047c238e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 28 Nov 2013 11:58:02 +0100 Subject: block: Use BDRV_O_NO_BACKING where appropriate If you open an image temporarily just because you want to check its size or get it flushed, there's no real reason to open the whole backing file chain. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng Reviewed-by: Benoit Canet --- block/qcow2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block/qcow2.c') diff --git a/block/qcow2.c b/block/qcow2.c index 2fe37ed6cb..8e2b6c7548 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1588,7 +1588,8 @@ static int qcow2_create2(const char *filename, int64_t total_size, /* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning */ ret = bdrv_open(bs, filename, NULL, - BDRV_O_RDWR | BDRV_O_CACHE_WB, drv, &local_err); + BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_BACKING, + drv, &local_err); if (error_is_set(&local_err)) { error_propagate(errp, local_err); goto out; -- cgit v1.2.1