diff options
author | Kevin Wolf <kwolf@redhat.com> | 2012-03-06 12:44:45 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-03-12 15:14:06 +0100 |
commit | 259b21731050eccfe1fd4da949a9633ec7547b04 (patch) | |
tree | 7f14b464bd250124f89af54f8fdfd99b680688d2 /block/qcow2.c | |
parent | e88774971c33671477c9eb4a4cf1e65a047c9838 (diff) |
qcow2: Add error messages in qcow2_truncate
qemu-img resize has some limitations with qcow2, but the user is only
told that "this image format does not support resize". Quite confusing,
so add some more detailed error_report() calls and change "this image
format" into "this image".
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 6f53ec6b7d..7aece65406 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1120,16 +1120,19 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset) int ret, new_l1_size; if (offset & 511) { + error_report("The new size must be a multiple of 512"); return -EINVAL; } /* cannot proceed if image has snapshots */ if (s->nb_snapshots) { + error_report("Can't resize an image which has snapshots"); return -ENOTSUP; } /* shrinking is currently not supported */ if (offset < bs->total_sectors * 512) { + error_report("qcow2 doesn't support shrinking images yet"); return -ENOTSUP; } |