qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4] correct error message qemu-img reported
@ 2012-11-05  7:41 liguang
  2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: liguang @ 2012-11-05  7:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, liguang

qemu-img will complain when qcow or qcow2
size overflow for 64 bits, report the right
message in this condition.

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 qemu-img.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index b41e670..d9434ad 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -340,7 +340,12 @@ static int img_create(int argc, char **argv)
         int64_t sval;
         char *end;
         sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
-        if (sval < 0 || *end) {
+        if (sval < 0) {
+            error_report("Image size must be less than 8 exabytes!");
+            ret = -1;
+            goto out;
+        }
+        if (*end) {
             error_report("Invalid image size specified! You may use k, M, G or "
                   "T suffixes for ");
             error_report("kilobytes, megabytes, gigabytes and terabytes.");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-03  2:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  7:41 [Qemu-devel] [PATCH v4] correct error message qemu-img reported liguang
2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-12-06  8:47   ` li guang
2012-12-06 10:04 ` [Qemu-devel] " Kevin Wolf
2012-12-07  3:56   ` li guang
2013-01-03  0:19 ` Anthony Liguori
2013-01-03  1:08   ` Peter Maydell
2013-01-03  2:15     ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).