aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-05-14 16:14:34 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-05-14 16:44:33 +0200
commitf3f4d2c09b9cf46903ba38425ec46c44185162bd (patch)
treec06947f5dbdc4b492739e0a0d1a52192e3b83d40 /block.c
parent2cf7cfa1cde6672b8a35bbed3fbc989f28c05dce (diff)
block: Add hint to -EFBIG error message
The limit of qcow2 files at least depends on the cluster size. If the image format has a cluster_size option, suggest to increase it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/block.c b/block.c
index aa9a533355..3f87489937 100644
--- a/block.c
+++ b/block.c
@@ -4857,8 +4857,12 @@ void bdrv_img_create(const char *filename, const char *fmt,
error_setg(errp,"Formatting or formatting option not supported for "
"file format '%s'", fmt);
} else if (ret == -EFBIG) {
- error_setg(errp, "The image size is too large for file format '%s'",
- fmt);
+ const char *cluster_size_hint = "";
+ if (get_option_parameter(create_options, BLOCK_OPT_CLUSTER_SIZE)) {
+ cluster_size_hint = " (try using a larger cluster size)";
+ }
+ error_setg(errp, "The image size is too large for file format '%s'%s",
+ fmt, cluster_size_hint);
} else {
error_setg(errp, "%s: error while creating %s: %s", filename, fmt,
strerror(-ret));