[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/19] qemu-img: Don't allow preallocation and compr
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 10/19] qemu-img: Don't allow preallocation and compression at the same time |
Date: |
Fri, 21 Oct 2011 19:19:07 +0200 |
Only qcow and qcow2 can do compression at all, and they require unallocated
clusters when writing the compressed data.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
qemu-img.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 6a39731..86127f0 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 */
--
1.7.6.4
- [Qemu-devel] [PULL 00/19] Block patches, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 01/19] sheepdog: add coroutine_fn markers, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 02/19] add socket_set_block, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 03/19] block: rename bdrv_co_rw_bh, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 04/19] fix memory leak in aio_write_f, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 05/19] xen_disk: Always set feature-barrier = 1, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 08/19] block: add bdrv_co_discard and bdrv_aio_discard support, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 06/19] block: unify flush implementations, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 10/19] qemu-img: Don't allow preallocation and compression at the same time,
Kevin Wolf <=
- [Qemu-devel] [PATCH 09/19] fdc: Fix floppy port I/O, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 11/19] qcow2: Fix bdrv_write_compressed error handling, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 07/19] block: drop redundant bdrv_flush implementation, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 12/19] pc: Fix floppy drives with if=none, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 17/19] block: take lock around bdrv_write implementations, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 14/19] vmdk: clean up open, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 16/19] block: take lock around bdrv_read implementations, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 13/19] vmdk: fix return values of vmdk_parent_open, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 18/19] block: change flush to co_flush, Kevin Wolf, 2011/10/21
- [Qemu-devel] [PATCH 15/19] block: add a CoMutex to synchronous read drivers, Kevin Wolf, 2011/10/21