>From bc79eae6c3226d21bd3fcbc370a86d7b24657aad Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Sun, 1 Mar 2009 12:44:38 +0200 Subject: [PATCH] block.c: If image format is known, use it for BDRV_O_SNAPSHOT flag as well Otherwise we'd 1. Unnecessarily probe the image to find out its format 2 Get it wrong for host-devices and non-raw images, which may affect created image size. Also, force the temporary snapshot image to be of format bdrv_qcow2 Signed-off-by: Uri Lublin --- block.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 1626e0c..0939cad 100644 --- a/block.c +++ b/block.c @@ -365,7 +365,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, if (!bs1) { return -ENOMEM; } - if (bdrv_open(bs1, filename, 0) < 0) { + if (bdrv_open2(bs1, filename, 0, drv) < 0) { bdrv_delete(bs1); return -1; } @@ -392,6 +392,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, return -1; } filename = tmp_filename; + drv = &bdrv_qcow2; bs->is_temporary = 1; } -- 1.6.0.6