qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Blue Swirl <blauwirbel@gmail.com>, Jan Kiszka <jan.kiszka@web.de>,
	Avi Kivity <avi@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 03/23] qdev: Drop ID matching from qtree paths
Date: Wed, 23 Jun 2010 14:15:30 +0200	[thread overview]
Message-ID: <4C21FAE2.4000501@siemens.com> (raw)
In-Reply-To: <m3k4pq6kt2.fsf@blackfin.pond.sub.org>

Markus Armbruster wrote:
> Jan Kiszka <jan.kiszka@siemens.com> writes:
> 
>> Markus Armbruster wrote:
>>> [cc: kraxel]
>>>
>>> Jan Kiszka <jan.kiszka@web.de> writes:
>>>
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> Device IDs may conflict with device names or aliases. From now on we
>>>> only accept them outside qtree paths. This also makes dumping IDs in
>>>> qbus_list_dev/bus obsolete.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> I don't like this at all.
>>>
>>> 1. Specific problem:
>>>
>>>    With the current code, multiple devices with the same driver work
>>>    only if I take care: addressing by driver name gets me only the
>>>    first, so I better set suitable IDs.
>>>
>>>    With your patch, multiple devices with the same driver don't work, no
>>>    matter what I do.
>> [ you already found how this is resolved ]
> 
> Yes, but I don't like that the intermediate state is broken, and I don't
> like the final state.
> 
>>> 2. General principle:
>>>
>>>    When I set an ID, I want the system to accept that ID in all contexts
>>>    where it makes sense.  Ambiguity created by badly chosen IDs is *my*
>>>    problem.
>> I disagree. IMO, QEMU should support the user to avoid such subtle
>> shadowing.
> 
> IDs let me refer to my devices without having to look up ever-changing
> instance numbers.  This is especially relevant when I want to do refer
> to buses without using (possibly ambigious) bus names.
> 
> I want to be able to say bus=scsi-ctrl.2/scsi.0 instead of
> /i440FX-pcihost/pci.0/lsi53c895a.<ever-changing-number>/scsi.0

It would once be something like /i440FX-pcihost/pci.0/@04.0/scsi.0 (with
optional extension of '@04.0' to '@04.0:lsi53c895a.0' for more verbose
interactive use), so at least no volatile naming here. But letting a
qdev path start with an ID can of course shorten things, specifically on
the command line where we have no completion.

> 
> That's much more valuable to me than a well-meant attempt at protecting
> me from choosing IDs badly.
> 
> Throw in multiple PCI buses, and a "no IDs in qdev paths" law becomes
> even more annoying.

No IDs _inside_ qdev paths, please. Letting them start is imaginable if
we find proper rules how to resolve the possible conflicts with
auto-generated bus aliases ('pci.0' = '/i440FX-pcihost/pci.0').

Let's look at it as Paul suggested: relative qdev path beginnings are
aliases of the corresponding absolute bits. When registering a device
with an ID, we also register an alias 'ID' = '/absolute/path/to/device'.
Here we can (and already do) reject the registration if 'ID' is not
unique. When registering a bus, we would add an alias 'busname' =
'/absolute/path/to/bus'. This can already fail due to the fact that bus
names need not be unique. But it could also fail if some silly guy
registered a device with the same ID before.

Now what to do? Register the alias nevertheless and select whatever
comes first in the alias list, possibly creating instable paths again?
Or reject the bus registration (i.e. the registration of the parent
device? Or silently skip the failing alias registration (which would
mean having no such alias at all once the other device gets hot-removed)?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2010-06-23 12:15 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15 22:38 [Qemu-devel] [PATCH v4 00/23] qdev path reworks & basic device state visualization Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 01/23] qdev: Rework qtree path abbreviations Jan Kiszka
2010-06-23  8:44   ` Markus Armbruster
2010-06-23  9:32     ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 02/23] qdev: Restrict direct bus addressing via its name Jan Kiszka
2010-06-23  8:45   ` Markus Armbruster
2010-06-23 10:17     ` Jan Kiszka
2010-06-23 11:24       ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 03/23] qdev: Drop ID matching from qtree paths Jan Kiszka
2010-06-23  8:55   ` Markus Armbruster
2010-06-23 10:17     ` Jan Kiszka
2010-06-23 11:38       ` Markus Armbruster
2010-06-23 12:15         ` Jan Kiszka [this message]
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 04/23] qdev: Allow device addressing via 'driver.instance' Jan Kiszka
2010-06-23  9:10   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 05/23] qdev: Convert device and bus lists to QTAILQ Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 06/23] qdev: Push QMP mode checks into qbus_list_bus/dev Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 07/23] qdev: Allow device specification by qtree path for device_del Jan Kiszka
2010-06-23  9:37   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 08/23] qdev: Introduce qdev_iterate_recursive Jan Kiszka
2010-06-23  9:40   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 09/23] monitor: Fix leakage during completion processing Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 10/23] monitor: Fix command completion vs. boolean switches Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists Jan Kiszka
2010-06-23  9:45   ` Markus Armbruster
2010-06-23 10:28     ` Jan Kiszka
2010-06-23 17:08       ` Markus Armbruster
2010-06-28 14:28       ` Luiz Capitulino
2010-06-28 14:40         ` Jan Kiszka
2010-06-28 16:20           ` Luiz Capitulino
2010-06-28 16:27             ` [Qemu-devel] [PATCH] monitor: Allow to exclude commands from QMP Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 12/23] monitor: Add completion for qdev paths Jan Kiszka
2010-06-23  9:46   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 13/23] monitor: Allow to specify HMP-specifc command arguments Jan Kiszka
2010-06-23  9:56   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 14/23] monitor: return length of printed string via monitor_[v]printf Jan Kiszka
2010-06-23  9:57   ` Markus Armbruster
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 15/23] monitor: Establish cmd flags and convert the async tag Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 16/23] monitor: Allow to exclude commands from QMP Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 17/23] Add base64 encoder/decoder Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 18/23] QMP: Reserve namespace for complex object classes Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 19/23] QMP: Add QBuffer Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 20/23] monitor: Add basic device state visualization Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 21/23] QMP: Teach basic capability negotiation to python example Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 22/23] QMP: Fix python helper /wrt long return strings Jan Kiszka
2010-06-15 22:38 ` [Qemu-devel] [PATCH v4 23/23] QMP: Add support for buffer class to qmp python helper Jan Kiszka
2010-06-23 10:01 ` [Qemu-devel] [PATCH v4 00/23] qdev path reworks & basic device state visualization Markus Armbruster

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=4C21FAE2.4000501@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).