Message ID | 1354852190-15095-2-git-send-email-lig.fnst@cn.fujitsu.com |
---|---|
State | New |
Headers | show |
liguang <lig.fnst@cn.fujitsu.com> writes: > qemu-img will complain when qcow or qcow2 > size overflow for 64 bits, report the right > message in this condition. Recommend to show the reproducer with output before and after the patch in the commit message.
在 2012-12-11二的 16:11 +0100,Markus Armbruster写道: > liguang <lig.fnst@cn.fujitsu.com> writes: > > > qemu-img will complain when qcow or qcow2 > > size overflow for 64 bits, report the right > > message in this condition. > > Recommend to show the reproducer with output before and after the patch > in the commit message. OK, reasonable. Thanks!
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; }
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 | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)