mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-09 23:10:08 +00:00
776e37e1eb
When parsing the <disk> element specification, if no <address> is provided for the disk, then automatically assign one based on the <target dev='sdXX'/> device name. This provides for backwards compatability with existing applications using libvirt, while also allowing new apps to have complete fine grained control. * src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms: Add virDomainDiskDefAssignAddress() for assigning a controller/bus/unit address based on disk target * src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after generating XML from ARGV * tests/qemuxml2argvdata/*.xml: Add in drive address information to all XML files
39 lines
1.2 KiB
XML
39 lines
1.2 KiB
XML
<domain type='qemu'>
|
|
<name>QEMUGuest1</name>
|
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
<memory>219200</memory>
|
|
<currentMemory>219200</currentMemory>
|
|
<vcpu>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/QEMUGuest1'/>
|
|
<target dev='hda' bus='ide'/>
|
|
<address type='drive' controller='0' bus='0' unit='0'/>
|
|
</disk>
|
|
<disk type='block' device='disk'>
|
|
<source dev='/dev/HostVG/QEMUGuest2'/>
|
|
<target dev='hdb' bus='ide'/>
|
|
<address type='drive' controller='0' bus='0' unit='1'/>
|
|
</disk>
|
|
<disk type='file' device='disk'>
|
|
<source file='/tmp/data.img'/>
|
|
<target dev='hdc' bus='ide'/>
|
|
<address type='drive' controller='0' bus='1' unit='0'/>
|
|
</disk>
|
|
<disk type='file' device='disk'>
|
|
<source file='/tmp/logs.img'/>
|
|
<target dev='hdd' bus='ide'/>
|
|
<address type='drive' controller='0' bus='1' unit='1'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|