On Wed, Sep 30, 2015 at 05:13:19PM +0200, Laurent Vivier wrote: > When DT node names for PCI devices are generated by SLOF, > they are generated according to the type of the device > (for instance, ethernet for virtio-net-pci device). > > Node name for hotplugged devices is generated by QEMU. > This patch adds the mechanic to QEMU to create the node > name according to the device type too. > > The data structure has been roughly copied from OpenBIOS/OpenHackware, > node names from SLOF. > > Example: > > Hotplugging some PCI cards with QEMU monitor: > > device_add virtio-tablet-pci > device_add virtio-serial-pci > device_add virtio-mouse-pci > device_add virtio-scsi-pci > device_add virtio-gpu-pci > device_add ne2k_pci > device_add nec-usb-xhci > device_add intel-hda > > What we can see in linux device tree: > > for dir in /proc/device-tree/pci@800000020000000/*@*/; do > echo $dir > cat $dir/name > echo > done > > WITHOUT this patch: > > /proc/device-tree/pci@800000020000000/pci@0/ > pci > /proc/device-tree/pci@800000020000000/pci@1/ > pci > /proc/device-tree/pci@800000020000000/pci@2/ > pci > /proc/device-tree/pci@800000020000000/pci@3/ > pci > /proc/device-tree/pci@800000020000000/pci@4/ > pci > /proc/device-tree/pci@800000020000000/pci@5/ > pci > /proc/device-tree/pci@800000020000000/pci@6/ > pci > /proc/device-tree/pci@800000020000000/pci@7/ > pci > > WITH this patch: > > /proc/device-tree/pci@800000020000000/communication-controller@1/ > communication-controller > /proc/device-tree/pci@800000020000000/display@4/ > display > /proc/device-tree/pci@800000020000000/ethernet@5/ > ethernet > /proc/device-tree/pci@800000020000000/input-controller@0/ > input-controller > /proc/device-tree/pci@800000020000000/mouse@2/ > mouse > /proc/device-tree/pci@800000020000000/multimedia-device@7/ > multimedia-device > /proc/device-tree/pci@800000020000000/scsi@3/ > scsi > /proc/device-tree/pci@800000020000000/usb-xhci@6/ > usb-xhci > > Signed-off-by: Laurent Vivier <[email protected]> > Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: David Gibson <[email protected]> -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
pgp_y9dVQ18Lw.pgp
Description: PGP signature
