libvirt/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml
Osier Yang cdb9789559 conf: Generate address for scsi host device automatically
With unknown good reasons, the attribute "bus" of scsi device
address is always set to 0, same for attribute "target". (See
virDomainDiskDefAssignAddress).

Though we might need to change the algorithm to honor "bus"
and "target" too, that's a different issue. The address generator
for scsi host device in this patch just follows the unknown
good reasons, only considering the "controller" and "unit".
It walks through all scsi controllers and their units, to see
if the address $controller:0:0:$unit can be used (if not used
by any disk or scsi host device yet), if found one, it sits on
it, otherwise, it creates a new controller (actually the controller
is implicitly created by someone else), and sits on
$new_controller:0:0:0 instead.
2013-06-01 10:00:23 +08:00

107 lines
3.7 KiB
XML

<domain type='qemu'>
<name>QEMUGuest2</name>
<uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
<memory unit='KiB'>219100</memory>
<currentMemory unit='KiB'>219100</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='block' device='disk'>
<source dev='/dev/HostVG/QEMUGuest2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='virtio-scsi'/>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
<controller type='scsi' index='1'/>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host0'/>
<address bus='0' target='0' unit='0'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host1'/>
<address bus='0' target='0' unit='1'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host2'/>
<address bus='0' target='0' unit='2'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host3'/>
<address bus='0' target='0' unit='3'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='3'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host4'/>
<address bus='0' target='0' unit='4'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host5'/>
<address bus='0' target='0' unit='5'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='5'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host6'/>
<address bus='0' target='0' unit='6'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='6'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host7'/>
<address bus='0' target='0' unit='7'/>
</source>
<address type='drive' controller='1' bus='0' target='0' unit='0'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host8'/>
<address bus='0' target='0' unit='8'/>
</source>
<address type='drive' controller='1' bus='0' target='0' unit='1'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host9'/>
<address bus='0' target='0' unit='9'/>
</source>
<address type='drive' controller='1' bus='0' target='0' unit='5'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='yes'>
<source>
<adapter name='scsi_host10'/>
<address bus='0' target='0' unit='10'/>
</source>
<address type='drive' controller='1' bus='0' target='0' unit='2'/>
</hostdev>
<memballoon model='virtio'/>
</devices>
</domain>