
Il 07/06/2012 00:45, Eric Blake ha scritto:
It sounds like we need <disk> address structure to support more than just drive addressing, but to instead support a union of addressing based on the type='' attribute.
No, we don't. The disk has a normal bus/target/unit address, like any other SCSI disk.
the address can be specified in the target.
<disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/file'/> <target dev='sda' bus='scsi' address='spapr-vio'/>
No, I don't think you want address added to <target>, but...
<address type='drive' controller='0' bus='0' unit='0' />
you instead want <address type='spapr-vio'/> to be something you add to your XML to force libvirt to then populate the remaining attributes and auto-instantiate the controller.
A simple <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/file'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='0' /> </disk> will do exactly what you want and add a default ibmvscsi controller. More complex cases are handled with the controller element: - giving a specific address to the controller: <controller type='scsi' model='ibmvscsi'> <address type='spapr-vio' ... /> </disk> - using a PCI controller even with an sPAPR machine: <controller type='scsi' model='virtio-scsi'> <address type='pci' ... /> </disk> - using both a vscsi and a PCI controller: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/file'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='0' /> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/file'/> <target dev='sdb' bus='scsi'/> <address type='drive' controller='1' bus='0' unit='0' /> </disk> <controller type='scsi' model='ibmvscsi'/> <controller type='scsi' model='virtio-scsi'/> (possibly with an spapr-vio and a pci address in the respective controller elements). Paolo