Received: from eggs.gnu.org ([208.118.235.92]:52673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgozr-0006uU-Jw for qemu-devel@nongnu.org; Thu, 06 Dec 2012 22:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tgozo-0002Lv-6L for qemu-devel@nongnu.org; Thu, 06 Dec 2012 22:53:07 -0500 Received: from [222.73.24.84] (port=15488 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgozn-0002LR-SJ for qemu-devel@nongnu.org; Thu, 06 Dec 2012 22:53:04 -0500 From: liguang Date: Fri, 7 Dec 2012 11:49:50 +0800 Message-Id: <1354852190-15095-2-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: <1354852190-15095-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1354852190-15095-1-git-send-email-lig.fnst@cn.fujitsu.com> Subject: [Qemu-devel] [ [PATCH 2/2] qemu-img:report size overflow error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org Cc: 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 --- qemu-img.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e29e01b..f3209b4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -353,6 +353,11 @@ static int img_create(int argc, char **argv) ret = -1; goto out; } + if (sval == 0) { + error_report("Image size must be less than 8 exabytes!"); + ret = -1; + goto out; + } img_size = (uint64_t)sval; } -- 1.7.2.5