[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1) |
Date: |
Fri, 16 Sep 2011 19:11:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
Am 16.09.2011 18:54, schrieb Anthony Liguori:
> On 09/16/2011 11:48 AM, Jan Kiszka wrote:
>> On 2011-09-16 18:00, Anthony Liguori wrote:
>>> This series introduces an infrastructure to remove anonymous devices from
>>> qdev.
>>> Anonymous devices are one of the big gaps between qdev and QOM so removing
>>> is
>>> a prerequisite to incrementally merging QOM.
>>>
>>> Besides the infrastructure, I also converted almost all of the possible PC
>>> devices to have unique names. Please not that naming is not a property of
>>> devices but rather of the thing that creates the devices (usually machines).
>>>
>>> The names are ugly but this is because of the alternating device/bus
>>> hierarchy
>>> in qdev. For now, the names use '::' as deliminators but I think Jan has
>>> convinced me that down the road, we should use '/' as a deliminator such
>>> that
>>> the resulting names are actually valid paths (using a canonical path
>>> format).
>>
>> I still don't see why we need to store strings as device references.
>> Everyone that lacks a reference (QEMU-external users) can pass in a path
>> - which can be a device name in the simple case. That path is resolved
>> to an object reference before proceeding with the requested service. If
>> an object should be serialized in whatever way and we need a stable
>> name, a central service could return this by walking up the composition
>> tree until a user-assigned name is found.
>>
>> So there is really no need to bother device model developers with the
>> topics "How do I define a unique name?"
>
> This series just asks the device model developer to come up with a unique
> *when*
> they're doing device composition. Even with a totally path based interface,
> this is always going to be a firm requirement.
>
> I think it may be possible to eliminate required device names by having a
> formal
> notion of composition and have the devices store the names of the composed
> devices as part of the reference to that device. You could then have user
> created devices use a separate hash table to track the names of those devices.
>
> But, we can't easily do this today. Having either a fully qualified name or
> a
> composition name as part of qdev_create() is the Right Thing IMHO so I think
> this is the stepping stone to something more sophisticated.
Actually, as I said, I think this naming scheme is already by far too
sophisticated. Jan is completely right, there is no point in duplicating
paths in a name. Either we assign names only if the user specified one,
or we auto-generate a really simple name that doesn't resemble a path,
can be easily typed and is actually useful to have in addition to paths
(my "#foo-1" suggestion).
Kevin
- [Qemu-devel] [PATCH 10/14] isa: add name parameter to device creation, (continued)
- [Qemu-devel] [PATCH 10/14] isa: add name parameter to device creation, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 06/14] qdev: add ability to do QOM-style derived naming, Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 07/14] sysbus: add an id argument to sysbus_create_simple(), Anthony Liguori, 2011/09/16
- [Qemu-devel] [PATCH 11/14] pci: obtain devfn before initializing the device, Anthony Liguori, 2011/09/16
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/16
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Jan Kiszka, 2011/09/16
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/16
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1),
Kevin Wolf <=
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/16
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Jan Kiszka, 2011/09/19
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/19
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Kevin Wolf, 2011/09/19
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Jan Kiszka, 2011/09/20
- Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Kevin Wolf, 2011/09/19
Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Anthony Liguori, 2011/09/16
Re: [Qemu-devel] [PATCH 00/14] qdev: assign unique names to all devices (part 1), Blue Swirl, 2011/09/17