summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-img.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 69cc02871b..85d3740b9c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -348,9 +348,13 @@ static int img_create(int argc, char **argv)
char *end;
sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
if (sval < 0 || *end) {
- error_report("Invalid image size specified! You may use k, M, G or "
- "T suffixes for ");
- error_report("kilobytes, megabytes, gigabytes and terabytes.");
+ if (sval == -ERANGE) {
+ error_report("Image size must be less than 8 EiB!");
+ } else {
+ error_report("Invalid image size specified! You may use k, M, "
+ "G or T suffixes for ");
+ error_report("kilobytes, megabytes, gigabytes and terabytes.");
+ }
return 1;
}
img_size = (uint64_t)sval;