All of lore.kernel.org
 help / color / mirror / Atom feed
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 v11 8/8] deprecate names duplication between qdev, block-node and block-export
Date: Sat, 14 Feb 2026 08:13:07 +0100	[thread overview]
Message-ID: <877bsf23y4.fsf@pond.sub.org> (raw)
In-Reply-To: <74b1555d-1e4f-4be2-85e4-902f9670e435@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Thu, 5 Feb 2026 10:32:54 +0300")

Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> On 04.02.26 15:38, Markus Armbruster wrote:
>> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
>> 
>>> Now we have blockdev-replace QMP command, which depend on a possibility
>>> to select any block parent (block node, block export, or qdev) by one
>>> unique name. The command fails, if name is ambiguous (i.e., match
>>> several parents of different types). In future we want to rid of this
>>> ambiguity.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>> 
>> We have numerous kinds of IDs, i.e. names chosen by the user than need
>> to be unique, but only among the same kind.  For instance, you can't
>> name two block nodes "foo", but you can name a block node, a block
>> export, a qdev, and a network backend "foo".  Using the same ID for
>> multiple things is of course a bad idea.  Permitting it was also a bad
>> idea.
>> 
>> Your patch rectifies this design mistake, but only partially.  Consider:
>> 
>> * IDs need to be unique with their kind.  This is what we have now.  I
>>   don't like it.
>> 
>> * IDs need to be unique among their kind and possibly some set of
>>    additional kinds.  This is where your patch takes us.  I like it even
>>   less, to be honest.
>> 
>> * IDs need to be unique, period.  This is what I'd like to have.
>
> I like it. Is it enough to write it so simple in deprecation doc? Or should
> we still list all such ids we have in QEMU?
>
> It may be something like:
>
> Any kind of IDs you use to reference objects in QEMU must be unique, any
> used ID must reference exactly one object. This includes, but is not limited
> to qdev full and relative to "/peripheral/" paths, block-node and block-export
> names.

This would serve as a declaration of intent.  Better than nothing, I
guess.

To enforce uniqueness, we'll have to create a single table of IDs.

If we make it a set, we can reject duplicate IDs, but can't point to the
other ID.  Meh.

If we make it map to the kind of ID, we can report the kind.  Something
like "block node name 'foo' clashes with block export ID 'foo'".  Feels
adequate.

If we make it map the the object the ID identifies, we can get rid of
existing means to map from ID to object.  May or may not be worthwhile.

If we create the single table of IDs now rather than later, we can warn.
Something like "duplicate IDs are deprecated: block node name 'foo'
clashes with block export ID 'foo'".  Much more likely to get users'
attention than a note in docs/about/deprecated.rst.

We could even wire it to the "-compat deprecated-input=..." machinery
(I'd assist with that).  This would let people test their software is
ready for enforced unique IDs.

Thoughts?



  reply	other threads:[~2026-02-14  7:14 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
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 [this message]
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=877bsf23y4.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.