[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/11] qemu-img: Fix qemu-img convert -obacking_file
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 08/11] qemu-img: Fix qemu-img convert -obacking_file |
Date: |
Fri, 22 Oct 2010 15:43:53 +0200 |
The old -B option caused a backing file to be used for the converted image and
to avoid copying clusters from the old backing file. When replaced with
-obacking_file, qemu-img convert does assign the backing file to the new image,
but it doesn't realize that it should avoid copying clusters from the backing
file.
This patch checks the -o options for a backing_file and applies the same logic
as for -B in this case.
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-img.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index d4a3b4e..2864cb8 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -645,6 +645,7 @@ static int img_convert(int argc, char **argv)
const uint8_t *buf1;
BlockDriverInfo bdi;
QEMUOptionParameter *param = NULL, *create_options = NULL;
+ QEMUOptionParameter *out_baseimg_param;
char *options = NULL;
const char *snapshot_name = NULL;
@@ -769,6 +770,12 @@ static int img_convert(int argc, char **argv)
goto out;
}
+ /* Get backing file name if -o backing_file was used */
+ out_baseimg_param = get_option_parameter(param, BLOCK_OPT_BACKING_FILE);
+ if (out_baseimg_param) {
+ out_baseimg = out_baseimg_param->value.s;
+ }
+
/* Check if compression is supported */
if (flags & BLOCK_FLAG_COMPRESS) {
QEMUOptionParameter *encryption =
--
1.7.2.3
- [Qemu-devel] [PULL 00/11] Block patches, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 02/11] qcow2: Simplify image creation, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 01/11] qcow2: Support exact L1 table growth, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 03/11] qcow2: Remove old image creation function, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 04/11] ide: set WCACHE supported in IDENTIFY data, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 05/11] Copy snapshots out of QCOW2 disk, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 06/11] qemu-io: New command map, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 07/11] block: Use GCC_FMT_ATTR and fix a format error, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 09/11] ide: Factor ide_flush_cache out, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 10/11] ide: Handle flush failure, Kevin Wolf, 2010/10/22
- [Qemu-devel] [PATCH 08/11] qemu-img: Fix qemu-img convert -obacking_file,
Kevin Wolf <=
- [Qemu-devel] [PATCH 11/11] virtio-blk: Respect werror option for flushes, Kevin Wolf, 2010/10/22