diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-15 14:42:46 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-15 14:42:46 +0000 |
commit | 6e9ea0c0629fe25723494a19498bedf4b781cbfa (patch) | |
tree | c0427853275f28ccbe5d1dd6fc4d8fee6c360675 /qemu-img.c | |
parent | 29463b24a8f427b7ff779b30fe52f1f00ad9b98c (diff) |
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c index 913ad34bf8..ccf4a6f9fd 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); } |