mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 07:33:50 +00:00
cputune: allow interleaved xml
I noticed this with the recent iothread pinning code, but the problem existed longer than that. The XML validation required users to supply <cputune> children in a strict order, even though there was no conceptual reason why they can't occur in any order. docs/ changes best viewed with -w * docs/schemas/domaincommon.rng (cputune): Add interleave. * tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml: Swap up order, copying canonical form... * tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml: ...here. * tests/qemuxml2xmltest.c (mymain): Mark the difference. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
e45f0d057e
commit
7e8feed4a7
@ -768,58 +768,60 @@
|
|||||||
<!-- All the cpu related tunables would go in the cputune -->
|
<!-- All the cpu related tunables would go in the cputune -->
|
||||||
<define name="cputune">
|
<define name="cputune">
|
||||||
<element name="cputune">
|
<element name="cputune">
|
||||||
<optional>
|
<interleave>
|
||||||
<element name="shares">
|
<optional>
|
||||||
<ref name="cpushares"/>
|
<element name="shares">
|
||||||
</element>
|
<ref name="cpushares"/>
|
||||||
</optional>
|
</element>
|
||||||
<optional>
|
</optional>
|
||||||
<element name="period">
|
<optional>
|
||||||
<ref name="cpuperiod"/>
|
<element name="period">
|
||||||
</element>
|
<ref name="cpuperiod"/>
|
||||||
</optional>
|
</element>
|
||||||
<optional>
|
</optional>
|
||||||
<element name="quota">
|
<optional>
|
||||||
<ref name="cpuquota"/>
|
<element name="quota">
|
||||||
</element>
|
<ref name="cpuquota"/>
|
||||||
</optional>
|
</element>
|
||||||
<optional>
|
</optional>
|
||||||
<element name="emulator_period">
|
<optional>
|
||||||
<ref name="cpuperiod"/>
|
<element name="emulator_period">
|
||||||
</element>
|
<ref name="cpuperiod"/>
|
||||||
</optional>
|
</element>
|
||||||
<optional>
|
</optional>
|
||||||
<element name="emulator_quota">
|
<optional>
|
||||||
<ref name="cpuquota"/>
|
<element name="emulator_quota">
|
||||||
</element>
|
<ref name="cpuquota"/>
|
||||||
</optional>
|
</element>
|
||||||
<zeroOrMore>
|
</optional>
|
||||||
<element name="vcpupin">
|
<zeroOrMore>
|
||||||
<attribute name="vcpu">
|
<element name="vcpupin">
|
||||||
<ref name="vcpuid"/>
|
<attribute name="vcpu">
|
||||||
</attribute>
|
<ref name="vcpuid"/>
|
||||||
<attribute name="cpuset">
|
</attribute>
|
||||||
<ref name="cpuset"/>
|
<attribute name="cpuset">
|
||||||
</attribute>
|
<ref name="cpuset"/>
|
||||||
</element>
|
</attribute>
|
||||||
</zeroOrMore>
|
</element>
|
||||||
<optional>
|
</zeroOrMore>
|
||||||
<element name="emulatorpin">
|
<optional>
|
||||||
<attribute name="cpuset">
|
<element name="emulatorpin">
|
||||||
<ref name="cpuset"/>
|
<attribute name="cpuset">
|
||||||
</attribute>
|
<ref name="cpuset"/>
|
||||||
</element>
|
</attribute>
|
||||||
</optional>
|
</element>
|
||||||
<zeroOrMore>
|
</optional>
|
||||||
<element name="iothreadpin">
|
<zeroOrMore>
|
||||||
<attribute name="iothread">
|
<element name="iothreadpin">
|
||||||
<ref name="unsignedInt"/>
|
<attribute name="iothread">
|
||||||
</attribute>
|
<ref name="unsignedInt"/>
|
||||||
<attribute name="cpuset">
|
</attribute>
|
||||||
<ref name="cpuset"/>
|
<attribute name="cpuset">
|
||||||
</attribute>
|
<ref name="cpuset"/>
|
||||||
</element>
|
</attribute>
|
||||||
</zeroOrMore>
|
</element>
|
||||||
|
</zeroOrMore>
|
||||||
|
</interleave>
|
||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
@ -6,14 +6,15 @@
|
|||||||
<vcpu placement='static'>2</vcpu>
|
<vcpu placement='static'>2</vcpu>
|
||||||
<iothreads>2</iothreads>
|
<iothreads>2</iothreads>
|
||||||
<cputune>
|
<cputune>
|
||||||
<shares>2048</shares>
|
<!-- intentionally in odd order -->
|
||||||
<period>1000000</period>
|
|
||||||
<quota>-1</quota>
|
|
||||||
<vcpupin vcpu='0' cpuset='0'/>
|
|
||||||
<vcpupin vcpu='1' cpuset='1'/>
|
|
||||||
<emulatorpin cpuset='1'/>
|
|
||||||
<iothreadpin iothread='1' cpuset='2'/>
|
|
||||||
<iothreadpin iothread='2' cpuset='3'/>
|
<iothreadpin iothread='2' cpuset='3'/>
|
||||||
|
<iothreadpin iothread='1' cpuset='2'/>
|
||||||
|
<emulatorpin cpuset='1'/>
|
||||||
|
<vcpupin vcpu='1' cpuset='1'/>
|
||||||
|
<vcpupin vcpu='0' cpuset='0'/>
|
||||||
|
<quota>-1</quota>
|
||||||
|
<period>1000000</period>
|
||||||
|
<shares>2048</shares>
|
||||||
</cputune>
|
</cputune>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
<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'>2</vcpu>
|
||||||
|
<iothreads>2</iothreads>
|
||||||
|
<cputune>
|
||||||
|
<shares>2048</shares>
|
||||||
|
<period>1000000</period>
|
||||||
|
<quota>-1</quota>
|
||||||
|
<vcpupin vcpu='1' cpuset='1'/>
|
||||||
|
<vcpupin vcpu='0' cpuset='0'/>
|
||||||
|
<emulatorpin cpuset='1'/>
|
||||||
|
<iothreadpin iothread='2' cpuset='3'/>
|
||||||
|
<iothreadpin iothread='1' cpuset='2'/>
|
||||||
|
</cputune>
|
||||||
|
<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' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'/>
|
||||||
|
<controller type='ide' index='0'/>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<memballoon model='virtio'/>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -302,7 +302,7 @@ mymain(void)
|
|||||||
|
|
||||||
DO_TEST("smp");
|
DO_TEST("smp");
|
||||||
DO_TEST("iothreads");
|
DO_TEST("iothreads");
|
||||||
DO_TEST("cputune-iothreads");
|
DO_TEST_DIFFERENT("cputune-iothreads");
|
||||||
DO_TEST("iothreads-disk");
|
DO_TEST("iothreads-disk");
|
||||||
DO_TEST("lease");
|
DO_TEST("lease");
|
||||||
DO_TEST("event_idx");
|
DO_TEST("event_idx");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user