[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 33/37] qemu-img: Make resize error message more gener
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 33/37] qemu-img: Make resize error message more general |
Date: |
Fri, 2 Mar 2018 19:54:44 +0100 |
From: Max Reitz <address@hidden>
The issue:
$ qemu-img resize -f qcow2 foo.qcow2
qemu-img: Expecting one image file name
Try 'qemu-img --help' for more information
So we gave an image file name, but we omitted the length. qemu-img
thinks the last argument is always the size and removes it immediately
from argv (by decrementing argc), and tries to verify that it is a valid
size only at a later point.
So we do not actually know whether that last argument we called "size"
is indeed a size or whether the user instead forgot to specify that size
but did give a file name.
Therefore, the error message should be more general.
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1523458
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 56edc15218..aa99fd32e9 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3469,7 +3469,7 @@ static int img_resize(int argc, char **argv)
}
}
if (optind != argc - 1) {
- error_exit("Expecting one image file name");
+ error_exit("Expecting image file name and size");
}
filename = argv[optind++];
--
2.13.6
- [Qemu-devel] [PULL 23/37] iotest 033: add misaligned write-zeroes test via truncate, (continued)
- [Qemu-devel] [PULL 23/37] iotest 033: add misaligned write-zeroes test via truncate, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 26/37] aio: rename aio_context_in_iothread() to in_aio_context_home_thread(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 25/37] docs: document how to use the l2-cache-entry-size parameter, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 24/37] specs/qcow2: Fix documentation of the compressed cluster descriptor, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 28/37] block: add BlockBackend->in_flight counter, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 27/37] block: extract AIO_WAIT_WHILE() from BlockDriverState, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 30/37] Revert "IDE: Do not flush empty CDROM drives", Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 29/37] block: test blk_aio_flush() with blk->root == NULL, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 32/37] qcow2: make qcow2_co_create2() a coroutine_fn, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 33/37] qemu-img: Make resize error message more general,
Kevin Wolf <=
- [Qemu-devel] [PULL 31/37] block: rename .bdrv_create() to .bdrv_co_create_opts(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 35/37] block/ssh: Make ssh_grow_file() blocking, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 34/37] block/ssh: Pull ssh_grow_file() from ssh_create(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 36/37] block/ssh: Add basic .bdrv_truncate(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 37/37] qcow2: Replace align_offset() with ROUND_UP(), Kevin Wolf, 2018/03/02
- Re: [Qemu-devel] [PULL 00/37] Block layer patches, Peter Maydell, 2018/03/05