qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Blue Swirl <blauwirbel@gmail.com>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] Re: [PATCH v3 06/17] qdev: Allow device specification by qtree path for device_del
Date: Sat, 29 May 2010 10:16:27 +0200	[thread overview]
Message-ID: <4C00CD5B.4080607@web.de> (raw)
In-Reply-To: <m339xbjfpm.fsf@blackfin.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 4536 bytes --]

Markus Armbruster wrote:
> Jan Kiszka <jan.kiszka@siemens.com> writes:
> 
>> Markus Armbruster wrote:
>>> Jan Kiszka <jan.kiszka@web.de> writes:
>>>
>>>> Luiz Capitulino wrote:
>>>>> On Sun, 23 May 2010 12:59:19 +0200
>>>>> Jan Kiszka <jan.kiszka@web.de> wrote:
>>>>>
>>>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>>>
>>>>>> Allow to specify the device to be removed via device_del not only by ID
>>>>>> but also by its full or abbreviated qtree path. For this purpose,
>>>>>> qdev_find is introduced which combines walking the qtree with searching
>>>>>> for device IDs if required.
>>>>>  [...]
>>>>>
>>>>>>  Arguments:
>>>>>>  
>>>>>> -- "id": the device's ID (json-string)
>>>>>> +- "path": the device's qtree path or unique ID (json-string)
>>>>>>  
>>>>>>  Example:
>>>>>>  
>>>>>> --> { "execute": "device_del", "arguments": { "id": "net1" } }
>>>>>> +-> { "execute": "device_del", "arguments": { "path": "net1" } }
>>>>>  Doesn't seem like a good change to me, besides being incompatible[1] we
>>>>> shouldn't overload arguments this way in QMP as overloading leads to
>>>>> interface degradation (harder to use, understand, maintain).
>>>> It's not overloaded, think of an ID as a (weak) symbolic link in the
>>>> qtree filesystem. The advantage of basing everything on top of full or
>>>> abbreviated qtree paths is that IDs are not always assigned, paths are.
>>> As long as your patch doesn't change the interpretation of IDs, we can
>>> keep the old name.
>>>
>>> The recent review of QMP documentation may lead to a "clean up bad
>>> names" flag day.  One more wouldn't make it worse, I guess.
>>>
>>>>>  Maybe we could have both arguments as optional, but one must be passed.
>>>> This would at least require some way to keep the proposed unified path
>>>> specification for the human monitor (having separate arguments there is
>>>> really unhandy).
>>> Correct.
>>>
>>> It would be nice to have device_del support paths in addition to IDs.
>>> I'd expect management tools to slap IDs on everything, so they won't
>>> care, but human users do.
>>>
>>> As far as I know, we have two places where we let the user name a node
>>> in the qtree: device_add bus=X and device_del X.  The former names a
>>> bus, the latter a device.  But both are nodes in the same tree, so
>>> consistency is in order.
>>>
>>> Only devices have user-specified IDs.  Buses have names assigned by the
>>> system.  Unique names, hopefully.
>> ...but not necessarily. The bus name device_add accepts can also be a
>> full, thus unambiguous path.
>>
>>> If the user doesn't specify a device ID, the driver name is used
>>> instead.  If you put multiple instances of the same device on the same
>>> bus, they have the *same* path.  For instance, here's a snippet of info
>>> qtree after adding two usb-mouse:
>>>
>>>       dev: piix3-usb-uhci, id ""
>>>         bus-prop: addr = 01.2
>>>         bus-prop: romfile = <null>
>>>         bus-prop: rombar = 1
>>>         class USB controller, addr 00:01.2, pci id 8086:7020 (sub 1af4:1100)
>>>         bar 4: i/o at 0xffffffffffffffff [0x1e]
>>>         bus: usb.0
>>>           type USB
>>>           dev: usb-hub, id ""
>>>             addr 0.0, speed 12, name QEMU USB Hub, attached
>>>           dev: usb-mouse, id "no2"
>>>             addr 0.0, speed 12, name QEMU USB Mouse, attached
>>>           dev: usb-mouse, id ""
>>>             addr 0.0, speed 12, name QEMU USB Mouse, attached
>>>
>>> Both devices have the same full path
>>> /i440FX-pcihost/pci.0/piix3-usb-uhci/usb.0/usb-mouse
>>> Which one does your code pick?  Shouldn't it refuse to pick?
>> Patch 3 of this series resolves this as follows:
>>
>> usb-mouse[.0] -> first listed instance
>> usb-mouse.1   -> second instance
>> ...
>>
>> We should probably include this numbering in the qtree dump, I guess.
>>
>>> By the way, you *can* put '/' in IDs.  I call that a bug.
>> Even if we prevent this, IDs can still collide with abbreviated device
>> or bus paths. Therefore I give paths precedence over IDs in patch 4.
> 
> You're fixing problems in the overly complex and subtle path name lookup
> by making it more complex and subtle.  Let's make it simple and
> straightforward instead.

I have no problem with ripping out all of those abbreviations, requiring
the user to either specify a '/'-less unique ID or a full qtree path
that must start with a '/'. If paths get long, we now have interactive
completions.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2010-05-29 15:50 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-23 10:59 [Qemu-devel] [PATCH v3 00/17] Basic device state visualization Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 01/17] Add dependency of JSON unit tests on config-host.h Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 02/17] qdev: Fix scanning across single-bus devices Jan Kiszka
2010-06-03  5:58   ` Paul Brook
2010-06-03  6:12     ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 03/17] qdev: Allow device addressing via 'driver.instance' Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 04/17] qdev: Give qtree names precedence over user-assigned IDs Jan Kiszka
2010-05-29  8:01   ` Markus Armbruster
2010-05-30  8:16     ` Avi Kivity
2010-05-31  8:26       ` Markus Armbruster
2010-05-31  9:59         ` Gerd Hoffmann
2010-05-31 11:12           ` Markus Armbruster
2010-05-31 14:13           ` [Qemu-devel] [PATCH] qdev: Reject duplicate and anti-social device IDs Markus Armbruster
2010-05-31 18:55             ` [Qemu-devel] " Gerd Hoffmann
2010-06-01 13:04             ` Luiz Capitulino
2010-06-01 13:09               ` Jan Kiszka
2010-06-01 13:13                 ` Luiz Capitulino
2010-06-01 13:19                   ` Jan Kiszka
2010-06-01 13:21                     ` Avi Kivity
2010-06-01 13:23                     ` Luiz Capitulino
2010-06-01 14:44               ` Markus Armbruster
2010-06-01 14:49                 ` Luiz Capitulino
2010-06-01 18:35                   ` Markus Armbruster
2010-06-01 18:54                     ` Anthony Liguori
2010-06-03  6:26                       ` Jan Kiszka
2010-06-03  6:51             ` [Qemu-devel] " Paul Brook
2010-06-04 14:27               ` Markus Armbruster
2010-06-04 15:28                 ` Paul Brook
2010-06-08 12:06                   ` Markus Armbruster
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 05/17] qdev: Convert device and bus lists to QTAILQ Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 06/17] qdev: Allow device specification by qtree path for device_del Jan Kiszka
2010-05-27 19:36   ` [Qemu-devel] " Luiz Capitulino
2010-05-27 22:19     ` Jan Kiszka
2010-05-28 13:43       ` Luiz Capitulino
2010-05-28 14:16         ` Jan Kiszka
2010-05-28 14:40       ` Markus Armbruster
2010-05-28 14:56         ` Jan Kiszka
2010-05-29  8:05           ` Markus Armbruster
2010-05-29  8:16             ` Jan Kiszka [this message]
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 07/17] qdev: Push QMP mode checks into qbus_list_bus/dev Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 08/17] monitor: Add completion for qdev paths Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 09/17] Add base64 encoder/decoder Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 10/17] QMP: Reserve namespace for complex object classes Jan Kiszka
2010-05-27 20:08   ` [Qemu-devel] " Luiz Capitulino
2010-05-27 22:20     ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 11/17] Add QBuffer Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 12/17] monitor: return length of printed string via monitor_[v]printf Jan Kiszka
2010-05-29  8:09   ` Markus Armbruster
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 13/17] monitor: Allow to exclude commands from QMP Jan Kiszka
2010-05-27 20:31   ` [Qemu-devel] " Luiz Capitulino
2010-05-27 22:20     ` Jan Kiszka
2010-05-28 13:45       ` Luiz Capitulino
2010-05-29  8:15     ` Markus Armbruster
2010-05-29  8:33       ` Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 14/17] monitor: Add basic device state visualization Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 15/17] QMP: Teach basic capability negotiation to python example Jan Kiszka
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 16/17] QMP: Fix python helper /wrt long return strings Jan Kiszka
2010-05-27 20:35   ` [Qemu-devel] " Luiz Capitulino
2010-05-23 10:59 ` [Qemu-devel] [PATCH v3 17/17] QMP: Add support for buffer class to qmp python helper Jan Kiszka

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=4C00CD5B.4080607@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@siemens.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).