diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-10-26 10:29:24 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-10-26 10:29:24 -0500 |
commit | e86d9b12b52a2e1cf9e18d55f471fa085911b166 (patch) | |
tree | c1cdec953a4ce7e7c5ce5490f8220fac943db385 /qemu-img.c | |
parent | 0ec024f63696edb42c9841e756811ba31fd18ab8 (diff) | |
parent | 6db39ae2e250f15da17462444ea18a9fcef41e05 (diff) |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c index 6a3973163f..86127f0b11 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -824,6 +824,8 @@ static int img_convert(int argc, char **argv) if (compress) { QEMUOptionParameter *encryption = get_option_parameter(param, BLOCK_OPT_ENCRYPT); + QEMUOptionParameter *preallocation = + get_option_parameter(param, BLOCK_OPT_PREALLOC); if (!drv->bdrv_write_compressed) { error_report("Compression not supported for this file format"); @@ -837,6 +839,15 @@ static int img_convert(int argc, char **argv) ret = -1; goto out; } + + if (preallocation && preallocation->value.s + && strcmp(preallocation->value.s, "off")) + { + error_report("Compression and preallocation not supported at " + "the same time"); + ret = -1; + goto out; + } } /* Create the new image */ |