diff options
author | Kevin Wolf <kwolf@redhat.com> | 2013-11-28 11:58:02 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-11-29 17:41:09 +0100 |
commit | c9fbb99d41b05acf0d7b93deb2fcdbf9047c238e (patch) | |
tree | d69b04e2510ced9bc17efaa992ec78b79ab38280 /block.c | |
parent | f32f988c7778d0f1ff9c7e8d7547a354a7fdd3f6 (diff) |
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 <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1061,7 +1061,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, /* Get the required size from the image */ bs1 = bdrv_new(""); QINCREF(options); - ret = bdrv_open(bs1, filename, options, 0, drv, &local_err); + ret = bdrv_open(bs1, filename, options, BDRV_O_NO_BACKING, + drv, &local_err); if (ret < 0) { bdrv_unref(bs1); goto fail; |