qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 06/20] qdev: Add 'accepted-device-types' proper


From: Cornelia Huck
Subject: Re: [Qemu-devel] [RFC v2 06/20] qdev: Add 'accepted-device-types' property to BusClass
Date: Tue, 29 Nov 2016 14:57:07 +0100

On Fri, 25 Nov 2016 20:05:42 -0200
Eduardo Habkost <address@hidden> wrote:

> Each bus class will now be aware of the specific device types
> that can be plugged on it. That will be useful for:
> 
> * Runtime check for which devices types can be plugged to the
>   machine;
> * Validation of query-machines output by automated tests.
> 
> By default, a single type name is used on all bus instances (set
> at BusClass::device_type), but bus instances can override it and
> return a different type list.
> 
> Signed-off-by: Eduardo Habkost <address@hidden>

I've read (well, more skimmed through) the whole patchset and I think
we have different cases of "multiple device types for one bus":

- the q35 root bus case later in this patchset, where just a certain
instance of the bus can accept multiple types
- the case where every instance of a bus may accept multiple types
(none currently; but this will be the case for e.g. virtual-css once we
have other derivates of CCW_DEVICE than virtio-ccw)

For the second case, a static initializer for multiple types in the
class makes sense; but the first case is a bit hackish. Should there be
a generic way to pass a list of types to the individual bus instance's
initializers (that could fall back to a static list in the class)?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]