[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate |
Date: |
Mon, 12 Mar 2012 16:19:36 +0100 |
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 <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/qcow2.c | 3 +++
qemu-img.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 6f53ec6..7aece65 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;
}
diff --git a/qemu-img.c b/qemu-img.c
index 8df3564..0e48b35 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1614,7 +1614,7 @@ static int img_resize(int argc, char **argv)
printf("Image resized.\n");
break;
case -ENOTSUP:
- error_report("This image format does not support resize");
+ error_report("This image does not support resize");
break;
case -EACCES:
error_report("Image is read-only");
--
1.7.6.5
- [Qemu-devel] [PULL 00/20] Block patches, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 08/20] Add 'make check-block', Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate,
Kevin Wolf <=
- [Qemu-devel] [PATCH 06/20] qemu-iotests: Mark some tests as quick, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 02/20] qed: do not evict in-use L2 table cache entries, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 01/20] Group snapshot: Fix format name for backing file, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 16/20] qcow2: Reduce number of I/O requests, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 03/20] qcow2: Add some tracing, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 17/20] coroutine: adding sigaltstack method (.c source), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 18/20] coroutine: adding configure choose mechanism for coroutine backend, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 10/20] qapi: complete implementation of unions, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 04/20] block: handle -EBUSY in bdrv_commit_all(), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 20/20] test-coroutine: add performance test for nesting, Kevin Wolf, 2012/03/12