tests: Add a bunch of example devices to the test drivers

Eventually we may want these for virt-xml or UI testing. Fill in
some XML for every top level element libvirt currently supports.
This commit is contained in:
Cole Robinson 2019-05-15 15:23:59 -04:00
parent 61639d9b14
commit 1403815a3f
20 changed files with 195 additions and 60 deletions

View File

@ -1,13 +1,13 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <disk type="file" device="disk">
+ <source file="/dev/default-pool/testvol1.img"/>
+ <target dev="vdf" bus="virtio"/>
+ </disk>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,13 +1,13 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <disk type="file" device="disk">
+ <source file="/dev/default-pool/new1.img"/>
+ <target dev="hdb" bus="ide"/>
+ </disk>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,13 +1,13 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <disk type="file" device="disk">
+ <source file="/var/lib/libvirt/images/test-for-virtxml.qcow2"/>
+ <target dev="hdb" bus="ide"/>
+ </disk>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,13 +1,13 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <disk type="file" device="disk">
+ <source file="/dev/default-pool/testvol1.img"/>
+ <target dev="hdb" bus="ide"/>
+ </disk>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,6 +1,6 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <hostdev mode="subsystem" type="usb" managed="yes">
+ <source>
+ <vendor id="0x04b3"/>
@ -9,7 +9,7 @@
+ </hostdev>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,10 +1,10 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
<vsock model="virtio">
<cid auto="no" address="5"/>
</vsock>
+ <sound model="pcspk"/>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
</domain>
<keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -5,7 +5,7 @@
+ <libosinfo:os id="http://fedoraproject.org/fedora/23"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">409600</memory>
<maxMemory slots="16" unit="KiB">1099511627776</maxMemory>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,5 +1,5 @@
<memory unit="KiB">409600</memory>
<currentMemory unit="KiB">204800</currentMemory>
<memory unit="KiB">4717568</memory>
<currentMemory unit="KiB">4717568</currentMemory>
<blkiotune>
- <weight>100</weight>
+ <weight>500</weight>

View File

@ -1,6 +1,6 @@
<controller type="ide" index="0"/>
<controller type="virtio-serial" index="0"/>
<controller type="ccid" index="0"/>
<key>thequickbrownfoxjumpedoverthelazydog</key>
<target path="/some/lease/path" offset="1024"/>
</lease>
- <filesystem type="mount" accessmode="passthrough">
+ <filesystem type="mount" accessmode="mapped">
<driver type="handle"/>

View File

@ -1,5 +1,5 @@
<protocol type="raw"/>
</redirdev>
</redirfilter>
<hub type="usb"/>
<watchdog model="ib700" action="poweroff"/>
- <memballoon model="virtio"/>
+ <memballoon model="none"/>

View File

@ -1,8 +1,8 @@
<libosinfo:os id="http://fedoraproject.org/fedora/27"/>
</libosinfo:libosinfo>
</metadata>
- <memory unit="KiB">409600</memory>
- <currentMemory unit="KiB">204800</currentMemory>
<maxMemory slots="16" unit="KiB">1099511627776</maxMemory>
- <memory unit="KiB">4717568</memory>
- <currentMemory unit="KiB">4717568</currentMemory>
+ <memory unit="KiB">1024000</memory>
+ <currentMemory unit="KiB">512000</currentMemory>
<blkiotune>
@ -17,8 +17,8 @@
- </memoryBacking>
+ <memoryBacking/>
<vcpu placement="static" cpuset="1-2,5-9,11,13-14">9</vcpu>
<numatune>
<memory mode="interleave" placement="auto"/>
<iothreads>4</iothreads>
<iothreadids>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -14,11 +14,11 @@
+ <libosinfo:os id="http://fedoraproject.org/fedora/13"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">409600</memory>
<maxMemory slots="16" unit="KiB">1099511627776</maxMemory>
@@
</panic>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
<dhCert>AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA</dhCert>
<session>IHAVENOIDEABUTJUSTPROVIDINGASTRING</session>
</launchSecurity>
+ <title>This is my,funky=new title</title>
</domain>

View File

@ -1,5 +1,5 @@
</memoryBacking>
<vcpu placement="static" cpuset="1-2,5-9,11,13-14">9</vcpu>
<iothread id="2"/>
</iothreadids>
<numatune>
- <memory mode="interleave" placement="auto"/>
+ <memory mode="strict" placement="auto" nodeset="1-5,7"/>

View File

@ -1,6 +1,6 @@
</panic>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes"/>
<dhCert>AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA</dhCert>
<session>IHAVENOIDEABUTJUSTPROVIDINGASTRING</session>
</launchSecurity>
+ <qemu:commandline xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
+ <qemu:arg value="-foo"/>
+ <qemu:arg value="bar,baz=wib wob"/>

View File

@ -7,7 +7,7 @@
+ <source mode="connect" host="example.com" service="12345"/>
<protocol type="raw"/>
</redirdev>
<watchdog model="ib700" action="poweroff"/>
<redirfilter>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,11 +1,13 @@
<address type="isa" iobase="0x505"/>
</panic>
<cid auto="no" address="5"/>
</vsock>
</devices>
- <seclabel type="dynamic" model="selinux" relabel="yes"/>
+ <seclabel type="dynamic" model="selinux" relabel="yes">
+ <label>foo,bar,baz,UNKNOWN=val</label>
+ </seclabel>
</domain>
<keywrap>
<cipher name="dea" state="on"/>
</keywrap>
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -3,9 +3,9 @@
</memoryBacking>
- <vcpu placement="static" cpuset="1-2,5-9,11,13-14">9</vcpu>
+ <vcpu placement="static" cpuset="1-2,5-9,11,13-14" current="10">20</vcpu>
<numatune>
<memory mode="interleave" placement="auto"/>
</numatune>
<iothreads>4</iothreads>
<iothreadids>
<iothread id="5"/>
@@
<cell id="2" cpus="2" memory="1048576" unit="KiB"/>
<cell id="3" cpus="3" memory="1048576" unit="KiB"/>

View File

@ -1,6 +1,6 @@
<source mode="connect" host="localhost" service="4000"/>
<protocol type="raw"/>
</redirdev>
<usbdev allow="no"/>
</redirfilter>
<hub type="usb"/>
- <watchdog model="ib700" action="poweroff"/>
+ <watchdog model="ib700" action="reset"/>
<memballoon model="virtio"/>

View File

@ -62,8 +62,7 @@
</libosinfo:libosinfo>
</metadata>
<genid>e90ff655-47a5-4484-9f9c-79a683c2a2e2</genid>
<currentMemory>204800</currentMemory>
<memory>409600</memory>
<maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
<blkiotune>
<weight>100</weight>
<device>
@ -100,6 +99,11 @@
<entry name='location'>Upside down</entry>
</baseBoard>
</sysinfo>
<iothreads>4</iothreads>
<iothreadids>
<iothread id='5'/>
<iothread id='6'/>
</iothreadids>
<os>
<type arch='i686'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
@ -122,6 +126,7 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<vapic state='on'/>
<spinlocks state='on' retries='12287'/>
</hyperv>
<ioapic driver='qemu'/>
</features>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
@ -162,6 +167,11 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<feature policy="require" name="ds_cpl"/>
<feature policy="require" name="xtpr"/>
<feature policy="require" name="acpi"/>
<topology sockets='9' cores='1' threads='1'/>
<numa>
<cell id='0' cpus='0-4' memory='219136' unit='KiB'/>
<cell id='1' cpus='5-8' memory='219136' unit='KiB'/>
</numa>
</cpu>
<pm>
@ -309,6 +319,14 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<controller type='usb'/>
<!-- leases -->
<lease>
<lockspace>somearea</lockspace>
<key>thequickbrownfoxjumpedoverthelazydog</key>
<target path='/some/lease/path' offset='1024'/>
</lease>
<!-- interfaces -->
<interface type='network'>
<source network='default'/>
@ -582,12 +600,69 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<vsock model='virtio'>
<cid address='5'/>
</vsock>
<!-- memory devices -->
<memory model='nvdimm' access='private'>
<source>
<path>/tmp/nvdimm</path>
</source>
<target>
<size unit='KiB'>523264</size>
<node>0</node>
</target>
<address type='dimm' slot='0'/>
</memory>
<memory model='dimm'>
<source>
<nodemask>1-3</nodemask>
<pagesize unit='KiB'>2048</pagesize>
</source>
<target>
<size unit='KiB'>524287</size>
<node>0</node>
</target>
<address type='dimm' slot='1'/>
</memory>
<!-- hub devices -->
<hub type='usb'/>
<hub type='usb'/>
<!-- iommu device -->
<iommu model='intel'>
<driver intremap='on' iotlb='on'/>
</iommu>
<!-- shmem devices -->
<shmem name='shmem0'>
<model type='ivshmem'/>
<size unit='M'>4</size>
</shmem>
<shmem name='shmem7'>
<model type='ivshmem'/>
<size unit='M'>8192</size>
<server path='/tmp/shmem7-sock'/>
<msi vectors='32' ioeventfd='on'/>
</shmem>
</devices>
<seclabel model='selinux' type='dynamic' relabel='yes'/>
<seclabel model='dac' type='static' relabel='yes'>
<label type='qemu'>107:107</label>
</seclabel>
<keywrap>
<cipher name='dea' state='on'/>
</keywrap>
<launchSecurity type='sev'>
<cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits>
<policy>0x0001</policy>
<dhCert>AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA</dhCert>
<session>IHAVENOIDEABUTJUSTPROVIDINGASTRING</session>
</launchSecurity>
</domain>

View File

@ -79,8 +79,7 @@
<libosinfo:os id="http://fedoraproject.org/fedora/27"/>
</libosinfo:libosinfo>
</metadata>
<currentMemory>204800</currentMemory>
<memory>409600</memory>
<maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
<blkiotune>
<weight>100</weight>
<device>
@ -92,6 +91,11 @@
<hugepages/>
</memoryBacking>
<uuid>12345678-12F4-1234-1234-123456789012</uuid>
<iothreads>4</iothreads>
<iothreadids>
<iothread id='5'/>
<iothread id='6'/>
</iothreadids>
<os>
<type arch='i686'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
@ -181,6 +185,12 @@
<controller type='scsi' index='9' model='virtio-scsi'/>
<controller type='usb'/>
<lease>
<lockspace>somearea</lockspace>
<key>thequickbrownfoxjumpedoverthelazydog</key>
<target path='/some/lease/path' offset='1024'/>
</lease>
<interface type='network'>
<source network='default'/>
<mac address='22:22:33:54:32:10'/>
@ -254,6 +264,11 @@
<protocol type='raw'/>
</redirdev>
<redirfilter>
<usbdev class='0x08' vendor='0x15E1' product='0x2007' version='1.10' allow='yes'/>
<usbdev class='-1' vendor='-1' product='-1' version='-1' allow='no'/>
</redirfilter>
<filesystem>
<driver type='handle'/>
<source dir='/foo/bar'/>
@ -278,9 +293,52 @@
</panic>
<memballoon model='virtio'/>
<vsock model='virtio'>
<cid address='5'/>
</vsock>
<memory model='nvdimm' access='private'>
<source>
<path>/tmp/nvdimm</path>
</source>
<target>
<size unit='KiB'>523264</size>
<node>0</node>
</target>
<address type='dimm' slot='0'/>
</memory>
<hub type='usb'/>
<iommu model='intel'>
<driver intremap='off' iotlb='on'/>
</iommu>
<shmem name='shmem0'>
<model type='ivshmem'/>
<size unit='M'>4</size>
</shmem>
<nvram>
<address type='spapr-vio' reg='0x4000'/>
</nvram>
</devices>
<seclabel model='selinux' type='dynamic'/>
<keywrap>
<cipher name='dea' state='on'/>
</keywrap>
<launchSecurity type='sev'>
<cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits>
<policy>0x0001</policy>
<dhCert>AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA</dhCert>
<session>IHAVENOIDEABUTJUSTPROVIDINGASTRING</session>
</launchSecurity>
</domain>