2013-04-04 19:37:56 +00:00
|
|
|
<domain type='qemu'>
|
|
|
|
<name>QEMUGuest1</name>
|
|
|
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
|
<memory unit='KiB'>219136</memory>
|
|
|
|
<currentMemory unit='KiB'>219136</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>
|
2014-04-14 22:54:12 +00:00
|
|
|
<!-- For this disk, intentionally stress parser resilience to
|
|
|
|
atypical ordering -->
|
|
|
|
<disk device='cdrom' type='volume'>
|
|
|
|
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
|
|
|
|
<readonly/>
|
|
|
|
<target bus='ide' dev='hda'/>
|
|
|
|
<source volume='block+cdrom' pool='pool-disk'>
|
2013-04-04 19:37:59 +00:00
|
|
|
<seclabel model='selinux' relabel='yes'>
|
|
|
|
<label>system_u:system_r:public_content_t:s0</label>
|
|
|
|
</seclabel>
|
|
|
|
</source>
|
2013-04-04 19:37:56 +00:00
|
|
|
</disk>
|
2014-01-22 09:27:52 +00:00
|
|
|
<disk type='volume' device='cdrom'>
|
|
|
|
<driver name='qemu' type='raw'/>
|
|
|
|
<target dev='hdc' bus='ide'/>
|
|
|
|
<readonly/>
|
|
|
|
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
|
|
|
|
</disk>
|
2013-04-04 19:37:56 +00:00
|
|
|
<disk type='file' device='disk'>
|
|
|
|
<source file='/tmp/idedisk.img'/>
|
disk: Disallow duplicated target 'dev' values
https://bugzilla.redhat.com/show_bug.cgi?id=1142631
This patch resolves a situation where the same "<target dev='$name'...>"
can be used for multiple disks in the domain.
While the $name is "mostly" advisory regarding the expected order that
the disk is added to the domain and not guaranteed to map to the device
name in the guest OS, it still should be unique enough such that other
domblk* type operations can be performed.
Without the patch, the domblklist will list the same Target twice:
$ virsh domblklist $dom
Target Source
------------------------------------------------
sda /var/lib/libvirt/images/file.qcow2
sda /var/lib/libvirt/images/file.img
Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
type calls will not be able to reference the second target.
Fortunately, hotplug disallows adding a "third" sda value:
$ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
$ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
error: Failed to attach disk
error: operation failed: target sda already exists
$
BUT, it since 'sdb' doesn't exist one would get the following on the same
hotplug attempt, but changing to use 'sdb' instead of 'sda'
$ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
error: Failed to attach disk
error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
$
Since we cannot fix this issue at parsing time, the best that can be done so
as to not "lose" a domain is to make the check prior to starting the guest
with the results as follows:
$ virsh start $dom
error: Failed to start domain $dom
error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
$
Running 'make check' found a few more instances in the tests where this
duplicated target dev value was being used. These also exhibited some
duplicated 'id=' values (negating the uniqueness argument of aliases) in
the corresponding .args file and of course the *xmlout version of a few
input XML files.
2015-02-26 17:20:01 +00:00
|
|
|
<target dev='hdd' bus='ide'/>
|
2013-04-04 19:37:56 +00:00
|
|
|
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
|
|
|
|
</disk>
|
2019-06-25 08:36:06 +00:00
|
|
|
<disk type='volume' device='disk'>
|
|
|
|
<driver name='qemu' type='fat'/>
|
|
|
|
<source pool='pool-disk' volume='dir+vol1'/>
|
|
|
|
<target dev='vda' bus='virtio'/>
|
|
|
|
<readonly/>
|
|
|
|
</disk>
|
2019-06-25 13:23:56 +00:00
|
|
|
<disk type='volume' device='disk'>
|
|
|
|
<driver name='qemu'/>
|
|
|
|
<source pool='pool-disk' volume='dir+vol2'/>
|
|
|
|
<target dev='vdb' bus='virtio'/>
|
|
|
|
<readonly/>
|
|
|
|
</disk>
|
2013-04-04 19:37:56 +00:00
|
|
|
<controller type='usb' index='0'/>
|
|
|
|
<controller type='ide' index='0'/>
|
2013-04-22 12:16:13 +00:00
|
|
|
<controller type='pci' index='0' model='pci-root'/>
|
2019-06-25 08:36:06 +00:00
|
|
|
<memballoon model='virtio'>
|
|
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
|
|
|
</memballoon>
|
2013-04-04 19:37:56 +00:00
|
|
|
</devices>
|
|
|
|
</domain>
|