Skip to content

Commit

Permalink
block: Add hint to -EFBIG error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kevmw authored and stefanhaRH committed May 14, 2013
1 parent 2cf7cfa commit f3f4d2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions block.c
Expand Up @@ -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));
Expand Down

0 comments on commit f3f4d2c

Please sign in to comment.