[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/13] block: bdrv_insert_node(): doc and style
From: |
Kevin Wolf |
Subject: |
[PULL 05/13] block: bdrv_insert_node(): doc and style |
Date: |
Wed, 6 Oct 2021 12:59:15 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
- options & flags is common pair for open-like functions, let's use it
- add a comment that specifies use of @options
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210920115538.264372-4-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 5d49188073..3a90407b83 100644
--- a/block.c
+++ b/block.c
@@ -5119,14 +5119,23 @@ static void bdrv_delete(BlockDriverState *bs)
g_free(bs);
}
-BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *node_options,
+
+/*
+ * Replace @bs by newly created block node.
+ *
+ * @options is a QDict of options to pass to the block drivers, or NULL for an
+ * empty set of options. The reference to the QDict belongs to the block layer
+ * after the call (even on failure), so if the caller intends to reuse the
+ * dictionary, it needs to use qobject_ref() before calling bdrv_open.
+ */
+BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *options,
int flags, Error **errp)
{
ERRP_GUARD();
int ret;
BlockDriverState *new_node_bs;
- new_node_bs = bdrv_open(NULL, NULL, node_options, flags, errp);
+ new_node_bs = bdrv_open(NULL, NULL, options, flags, errp);
if (new_node_bs == NULL) {
error_prepend(errp, "Could not create node: ");
return NULL;
--
2.31.1
- [PULL 00/13] Block layer patches, Kevin Wolf, 2021/10/06
- [PULL 01/13] include/block.h: remove outdated comment, Kevin Wolf, 2021/10/06
- [PULL 02/13] qemu-storage-daemon: Only display FUSE help when FUSE is built-in, Kevin Wolf, 2021/10/06
- [PULL 03/13] block: implement bdrv_new_open_driver_opts(), Kevin Wolf, 2021/10/06
- [PULL 04/13] block: bdrv_insert_node(): fix and improve error handling, Kevin Wolf, 2021/10/06
- [PULL 05/13] block: bdrv_insert_node(): doc and style,
Kevin Wolf <=
- [PULL 06/13] block: bdrv_insert_node(): don't use bdrv_open(), Kevin Wolf, 2021/10/06
- [PULL 07/13] iotests/image-fleecing: declare requirement of copy-before-write, Kevin Wolf, 2021/10/06
- [PULL 08/13] block: introduce max_hw_iov for use in scsi-generic, Kevin Wolf, 2021/10/06
- [PULL 09/13] iotests: add 'qemu' package location to PYTHONPATH in testenv, Kevin Wolf, 2021/10/06
- [PULL 10/13] iotests/linters: check mypy files all at once, Kevin Wolf, 2021/10/06
- [PULL 11/13] iotests/mirror-top-perms: Adjust imports, Kevin Wolf, 2021/10/06
- [PULL 12/13] iotests/migrate-bitmaps-test: delint, Kevin Wolf, 2021/10/06
- [PULL 13/13] iotests: Update for pylint 2.11.1, Kevin Wolf, 2021/10/06
- Re: [PULL 00/13] Block layer patches, Richard Henderson, 2021/10/06