[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/14] block: Be more verbose in create fallback
From: |
Kevin Wolf |
Subject: |
[PULL 07/14] block: Be more verbose in create fallback |
Date: |
Mon, 4 Sep 2023 16:36:36 +0200 |
From: Hanna Czenczek <hreitz@redhat.com>
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>
---
block.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index b79b1ce7fe..1a5cb554a8 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;
}
--
2.41.0
- [PULL 00/14] Block layer patches, Kevin Wolf, 2023/09/04
- [PULL 02/14] iotests: adapt test output for new qemu_cleanup() behavior, Kevin Wolf, 2023/09/04
- [PULL 01/14] block/vpc: Avoid dynamic stack allocation, Kevin Wolf, 2023/09/04
- [PULL 04/14] block: change reqs_lock to QemuMutex, Kevin Wolf, 2023/09/04
- [PULL 05/14] qemu-img: omit errno value in error message, Kevin Wolf, 2023/09/04
- [PULL 08/14] qemu-img: Update documentation for compressed images, Kevin Wolf, 2023/09/04
- [PULL 06/14] block/iscsi: Document why we use raw malloc(), Kevin Wolf, 2023/09/04
- [PULL 03/14] block: minimize bs->reqs_lock section in tracked_request_end(), Kevin Wolf, 2023/09/04
- [PULL 07/14] block: Be more verbose in create fallback,
Kevin Wolf <=
- [PULL 11/14] block-backend: process I/O in the current AioContext, Kevin Wolf, 2023/09/04
- [PULL 10/14] block: remove AIOCBInfo->get_aio_context(), Kevin Wolf, 2023/09/04
- [PULL 12/14] block-backend: process zoned requests in the current AioContext, Kevin Wolf, 2023/09/04
- [PULL 14/14] block: Remove unnecessary variable in bdrv_block_device_info, Kevin Wolf, 2023/09/04
- [PULL 09/14] vmdk: Clean up bdrv_open_child() return value check, Kevin Wolf, 2023/09/04
- [PULL 13/14] block: Remove bdrv_query_block_node_info, Kevin Wolf, 2023/09/04
- Re: [PULL 00/14] Block layer patches, Stefan Hajnoczi, 2023/09/06