mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-07 20:57:50 +00:00
qemu-img: Fix qemu-img convert -obacking_file
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 <kwolf@redhat.com>
This commit is contained in:
parent
a77cffe7e9
commit
a18953fbe7
@ -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 =
|
||||
|
Loading…
x
Reference in New Issue
Block a user