Commit f3f4d2c0 authored by Kevin Wolf's avatar Kevin Wolf Committed by Stefan Hajnoczi
Browse files

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: default avatarKevin Wolf <kwolf@redhat.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 2cf7cfa1
...@@ -4857,8 +4857,12 @@ void bdrv_img_create(const char *filename, const char *fmt, ...@@ -4857,8 +4857,12 @@ void bdrv_img_create(const char *filename, const char *fmt,
error_setg(errp,"Formatting or formatting option not supported for " error_setg(errp,"Formatting or formatting option not supported for "
"file format '%s'", fmt); "file format '%s'", fmt);
} else if (ret == -EFBIG) { } else if (ret == -EFBIG) {
error_setg(errp, "The image size is too large for file format '%s'", const char *cluster_size_hint = "";
fmt); 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 { } else {
error_setg(errp, "%s: error while creating %s: %s", filename, fmt, error_setg(errp, "%s: error while creating %s: %s", filename, fmt,
strerror(-ret)); strerror(-ret));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment