summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-15 14:42:46 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-15 14:42:46 +0000
commit6e9ea0c0629fe25723494a19498bedf4b781cbfa (patch)
treec0427853275f28ccbe5d1dd6fc4d8fee6c360675 /qemu-img.c
parenttarget-alpha: lower parent irq when irq is lowered. (diff)
downloadqemu-kvm-6e9ea0c0629fe25723494a19498bedf4b781cbfa.tar.gz
qemu-kvm-6e9ea0c0629fe25723494a19498bedf4b781cbfa.tar.bz2
qemu-kvm-6e9ea0c0629fe25723494a19498bedf4b781cbfa.zip
block-vpc: Don't silently create smaller image than requested
The algorithm from the VHD specification for CHS calculation silently limits images to 127 GB which may confuse a user who requested a larger image. Better output an error message and abort. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7109 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 913ad34bf..ccf4a6f9f 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -306,6 +306,8 @@ static int img_create(int argc, char **argv)
if (ret < 0) {
if (ret == -ENOTSUP) {
error("Formatting or formatting option not supported for file format '%s'", fmt);
+ } else if (ret == -EFBIG) {
+ error("The image size is too large for file format '%s'", fmt);
} else {
error("Error while formatting");
}
@@ -494,6 +496,8 @@ static int img_convert(int argc, char **argv)
if (ret < 0) {
if (ret == -ENOTSUP) {
error("Formatting not supported for file format '%s'", out_fmt);
+ } else if (ret == -EFBIG) {
+ error("The image size is too large for file format '%s'", out_fmt);
} else {
error("Error while formatting '%s'", out_filename);
}