On 06/07/2012 11:42 PM, Paolo Bonzini wrote:
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:

It's a little hard to know if the disk is on a ibmvscsi controller.
If it is only support one type of scsi, it's OK with this configuration.
On sPAPR platform, it can support vscsi and pci scsi.
There will be some problems in this situation.
For example, user wants 2 disks: sda is vscsi, sdb is scsi.
It's hard to know sda is a vscsi with this configuration.
So when creating one controller for this disk automatically, the address
of controller may be not right.
It may need users to select right type of SCSI controller manually.



- 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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
Best Regards
Li

IBM LTC, China System&Technology Lab, Beijing

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to