From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
eduardo@habkost.net, berrange@redhat.com, pbonzini@redhat.com,
eblake@redhat.com, devel@lists.libvirt.org, hreitz@redhat.com,
kwolf@redhat.com
Subject: Re: [PATCH v10 4/8] qapi: add blockdev-replace command
Date: Wed, 04 Feb 2026 13:26:35 +0100 [thread overview]
Message-ID: <87wm0sy9s4.fsf@pond.sub.org> (raw)
In-Reply-To: <20260119144941.87936-5-vsementsov@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Mon, 19 Jan 2026 17:49:37 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> Add a command that can replace bs in following BdrvChild structures:
>
> - qdev blk root child
> - block-export blk root child
> - any child of BlockDriverState selected by child-name
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
[...]
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index b82af74256..9cc7c3d140 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -6334,3 +6334,27 @@
> ##
> { 'struct': 'DummyBlockCoreForceArrays',
> 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }
> +
> +##
> +# @blockdev-replace:
> +#
> +# Replace a block-node associated with device (@parent should be
> +# QOM path, and @child should be "root") or with block-export (@parent
> +# should be export name, and @child should be "root") or any child
> +# of block-node (@parent should be node-name, and @child should be any
> +# if its children names) with @new-child block-node.
of its
> +#
> +# @parent: QOM path or block-export or node-name, which @child should
> +# be repalced. If several matching parents exist, the command
replaced
> +# will fail
End the sentence with a period, please.
> +#
> +# @child: child to replace. Must be "root" when parent is QOM path or
> +# block-export
Likewise.
> +#
> +# @new-child: node-name of the block-node, which should become a
> +# replacement for @child's current block-node
Likewise.
Indent one more, please.
> +#
> +# Since 11.0
> +##
Let's see whether I understand...
@parent determines which of the three cases mentioned in the commit
message it ids:
* If @parent is a QOM path, case 1.
* If @parent is a block export name (@id in BlockExportOptions and
BlockExportInfo), case 2.
* If @parent is a block node name (@node-name in BlockdevOptions and
BlockDeviceInfo), case 3.
Correct?
Problem: this is ambiguous. A @parent "foo" could in fact be any of the
three cases.
3. If a block node named "foo" exists, it's case 3.
2. If a block export named "foo" exists, it's also case 2.
1. If exactly one QOM object named "foo" exists, it's also case 1. Why?
"foo" is a syntactically valid partial QOM path. Partial QOM paths
are a convenience feature that is virtually unknown (and possibly
ill-advised): you can omit leading path components as long as there's
no ambiguity.
Peeking ahead in the series... PATCH 8 appears to deprecate the
ambiguity between case 2. and 3.
I think we need to do better.
More questions...
In case 1 and 2, @child "should be root". What happens when it's
something else?
In case 3, @child "should be any if its children names". I figure the
command fails when it isn't.
> +{ 'command': 'blockdev-replace',
> + 'data': { 'parent': 'str', 'child': 'str', 'new-child': 'str' } }
[...]
next prev parent reply other threads:[~2026-02-04 12:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 14:49 [PATCH v10 0/8] blockdev-replace Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 1/8] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 2/8] block/export: add blk_by_export_id() Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 3/8] block: make bdrv_find_child() function public Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 4/8] qapi: add blockdev-replace command Vladimir Sementsov-Ogievskiy
2026-02-04 12:26 ` Markus Armbruster [this message]
2026-02-05 7:30 ` Vladimir Sementsov-Ogievskiy
2026-02-14 8:04 ` Markus Armbruster
2026-02-16 5:48 ` Vladimir Sementsov-Ogievskiy
2026-02-17 13:10 ` Markus Armbruster
2026-02-17 17:55 ` Vladimir Sementsov-Ogievskiy
2026-02-18 6:25 ` Markus Armbruster
2026-02-19 21:30 ` Kevin Wolf
2026-02-23 7:21 ` Markus Armbruster
2026-01-19 14:49 ` [PATCH v10 5/8] block: bdrv_get_xdbg_block_graph(): report export ids Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 6/8] iotests.py: introduce VM.assert_edges_list() method Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 7/8] iotests: add filter-insertion Vladimir Sementsov-Ogievskiy
2026-01-19 14:49 ` [PATCH v10 8/8] deprecate names duplication between qdev, block-node and block-export Vladimir Sementsov-Ogievskiy
2026-01-22 16:01 ` [PATCH v11 " Vladimir Sementsov-Ogievskiy
2026-02-04 12:38 ` Markus Armbruster
2026-02-05 7:32 ` Vladimir Sementsov-Ogievskiy
2026-02-14 7:13 ` Markus Armbruster
2026-02-16 7:25 ` Vladimir Sementsov-Ogievskiy
2026-02-17 12:25 ` Markus Armbruster
2026-02-24 15:24 ` Hanna Czenczek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wm0sy9s4.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=devel@lists.libvirt.org \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.