[Engine-devel] Stable PCI Addresses design wiki

Daniel P. Berrange berrange at redhat.com
Wed Nov 30 15:54:34 UTC 2011


On Wed, Nov 30, 2011 at 10:06:37AM -0500, Eli Mesika wrote:
> http://www.ovirt.org/wiki/Features/Design/StablePCIAddresses

My primary comment on this is that you likely don't want to restrict
yourself to PCI addresses.

If RHEVM intends to use virtio-serial controllers you want to maintain
stable virtio serial addresses

If RHEVM intends to use CCID smartcard controllers you want to maintain
stable CCID device addresses

If RHEVM intends to use SCSI controllers you will want to maintain
SCSI drive addresses

If RHEVM intends to use USB controllers you will want to maintain
USB device addresses

I think you get the idea :-) In general you can say that every single
device listed in the XML will ultimately have an address associated
with it. The type address will vary depending on what type of controller
the device is attached to.

In addition, when you start dealing with these other non-PCI address
types, you will also need to start dealing with controller devices.

eg, if you add a SCSI disk to the XML

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/test/disk0.raw'/>
      <target dev='sda' bus='scsi'/>
    </disk>

First of all libvirt will want to assign an address to this drive

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/test/disk0.raw'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>

Then, if the corresponding controller does not exist already, libvirt
will auto-add a controller device, which itself has an address you will
need to track:

    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>


In addition, when QEMU gains support for PCI bridges, or multiple PCI
root complexes, there will also be the possibility of dealing with
multiple PCI controllers in the XML too.

So even if you only implement PCI address support in the first iteration,
I'd really encourage you to at least consider how you will cope with the
other address types sooner, rather than later.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



More information about the Devel mailing list