Re: [kvm-devel] [PATCH 3/3] virtio PCI device

Arnd Bergmann
2007-11-09T11:04:18Z

On Thursday 08 November 2007, Anthony Liguori wrote:
>
> They already show up underneath of the PCI bus. The issue is that there
> are two separate 'struct device's for each virtio device. There's the
> PCI device (that's part of the pci_dev structure) and then there's the
> virtio_device one. I thought that setting the dev.parent of the
> virtio_device struct device would result in having two separate entries
> under the PCI bus directory which would be pretty confusing

But that's what a device tree means. Think about a USB disk drive: The drive
shows up as a child of the USB controller, which in turn is a child of
the PCI bridge. Note that I did not suggest having the virtio parent set to
the parent of the PCI device, but to the PCI device itself.

I find it more confusing to have a device just hanging off the root when
it is actually handled by the PCI subsystem.