aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2018-02-05 17:27:45 +0100
committerMax Reitz <mreitz@redhat.com>2018-03-02 18:39:56 +0100
commitbe8fbd476393089f21e6ee9086d6d3dad8cb4f3d (patch)
tree4d975a0c8297b64debf1e68c2cb1402a2e9114df /qemu-img.c
parentc274393a3e69d101203cc0f9bfde6c64bbb9689b (diff)
downloadqemu-be8fbd476393089f21e6ee9086d6d3dad8cb4f3d.zip
qemu-be8fbd476393089f21e6ee9086d6d3dad8cb4f3d.tar.gz
qemu-be8fbd476393089f21e6ee9086d6d3dad8cb4f3d.tar.bz2
qemu-img: Make resize error message more general
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 <mreitz@redhat.com> Message-id: 20180205162745.23650-1-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 56edc15..aa99fd3 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++];