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-05-31 10:09:24 +00:00
|
|
|
<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>
|
2017-04-06 16:19:48 +00:00
|
|
|
<emulator>/usr/bin/qemu-system-i686</emulator>
|
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-05-31 10:09:24 +00:00
|
|
|
<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>
|
2016-01-27 21:03:52 +00:00
|
|
|
<controller type='scsi' index='0' model='virtio-scsi'>
|
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='0'>
|
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='ide' index='0'>
|
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
|
|
|
</controller>
|
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-05-31 10:09:24 +00:00
|
|
|
<controller type='pci' index='0' model='pci-root'/>
|
2017-12-04 20:52:57 +00:00
|
|
|
<controller type='scsi' index='1' model='virtio-scsi'>
|
2016-01-27 21:03:52 +00:00
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
|
|
|
</controller>
|
2016-01-11 11:40:32 +00:00
|
|
|
<input type='mouse' bus='ps2'/>
|
|
|
|
<input type='keyboard' bus='ps2'/>
|
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-05-31 10:09:24 +00:00
|
|
|
<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>
|
2016-01-27 21:03:52 +00:00
|
|
|
<memballoon model='virtio'>
|
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
|
|
|
</memballoon>
|
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-05-31 10:09:24 +00:00
|
|
|
</devices>
|
|
|
|
</domain>
|