aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorHanna Czenczek <hreitz@redhat.com>2023-07-20 16:00:24 +0200
committerKevin Wolf <kwolf@redhat.com>2023-09-08 17:03:09 +0200
commit816248675a21d5b4d82f22a6a19ddd2a7fbfee18 (patch)
treea3f3f1cd40d4c59b2c96a18dcbc7ecc43cfffab8 /block.c
parent7966a36c83132c5eebf04a60d9e475b0aa6e7f88 (diff)
downloadqemu-816248675a21d5b4d82f22a6a19ddd2a7fbfee18.zip
qemu-816248675a21d5b4d82f22a6a19ddd2a7fbfee18.tar.gz
qemu-816248675a21d5b4d82f22a6a19ddd2a7fbfee18.tar.bz2
block: Be more verbose in create fallback
For image creation code, we have central fallback code for protocols that do not support creating new images (like NBD or iscsi). So for them, you can only specify existing paths/exports that are overwritten to make clean new images. In such a case, if the given path cannot be opened (assuming a pre-existing image there), we print an error message that tries to describe what is going on: That with this protocol, you cannot create new images, but only overwrite existing ones; and the given path could not be opened as a pre-existing image. However, the current message is confusing, because it does not say that the protocol in question does not support creating new images, but instead that "image creation" is unsupported. This can be interpreted to mean that `qemu-img create` will not work in principle, which is not true. Be more verbose for clarity. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2217204 Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-ID: <20230720140024.46836-1-hreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block.c b/block.c
index b79b1ce..1a5cb55 100644
--- a/block.c
+++ b/block.c
@@ -661,8 +661,10 @@ int coroutine_fn bdrv_co_create_opts_simple(BlockDriver *drv,
blk = blk_co_new_open(filename, NULL, options,
BDRV_O_RDWR | BDRV_O_RESIZE, errp);
if (!blk) {
- error_prepend(errp, "Protocol driver '%s' does not support image "
- "creation, and opening the image failed: ",
+ error_prepend(errp, "Protocol driver '%s' does not support creating "
+ "new images, so an existing image must be selected as "
+ "the target; however, opening the given target as an "
+ "existing image failed: ",
drv->format_name);
return -EINVAL;
}