qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] No more chameleon devices


From: Markus Armbruster
Subject: Re: [Qemu-devel] No more chameleon devices
Date: Wed, 17 Oct 2018 13:56:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Gerd Hoffmann <address@hidden> writes:

> On Wed, Oct 17, 2018 at 07:57:39AM +0200, Markus Armbruster wrote:
>> Laine Stump <address@hidden> writes:
>> 
>> [...]
>> > In the end, having a device that changed PCI ID depending on what kind
>> > of slot it was plugged into was an idea "too clever for its own good",
>> > should be avoided when new devices are added in the future, and we
>> > should at least provide an alternative that doesn't do that for existing
>> > devices.
>> 
>> That means for each chameleon PCI/PCIe device:
>> 
>> * create a pair of devices that can only go into one kind of slot
>> * deprecate the chameleon
>
> I think virtio devices are the only ones which actually change the pci
> id and have non-trivial differences.
>
> qemu-xhci can likewise be plugged into both pci and pcie slots.  When
> plugged into a pcie slot it'll have pcie endpoint capability.  That is
> the only difference though.  Do you consider that a chameleon device?

Since the enticing simplicity of letting PCI device models go into PCIe
slots as well is exactly what lured us into this mess, I do.

I believe all we actually saved by creating chameleons was a bunch of
QOM types.  New, non-chameleon PCIe devices would have shared the actual
device model code with the existing, non-chameleon PCI devices.

Correcting the design mistake now involves yet another set of QOM types,
for backward compatibility.

A loss of simplicity we failed to consider properly back then was at the
external interface.  Traditionally, a qdev has a bus type (printed by
-device help), and it can go into a slot provided by such a bus.  But
chameleon PCI qdevs can also go into a slot provided by a PCIe bus.  The
interface is now less regular, for no convincing reason.



reply via email to

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