mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Format scheduler priority when it is zero
https://bugzilla.redhat.com/show_bug.cgi?id=1235116 According to our XML definition, zero is as valid as any other value. Mainly because it should be kernel-agnostic. Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
parent
774fd39984
commit
786539d6bf
@ -21378,7 +21378,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
ids, virProcessSchedPolicyTypeToString(sp->policy));
|
ids, virProcessSchedPolicyTypeToString(sp->policy));
|
||||||
VIR_FREE(ids);
|
VIR_FREE(ids);
|
||||||
|
|
||||||
if (sp->priority)
|
if (sp->policy == VIR_PROC_POLICY_FIFO ||
|
||||||
|
sp->policy == VIR_PROC_POLICY_RR)
|
||||||
virBufferAsprintf(&childrenBuf, " priority='%d'", sp->priority);
|
virBufferAsprintf(&childrenBuf, " priority='%d'", sp->priority);
|
||||||
virBufferAddLit(&childrenBuf, "/>\n");
|
virBufferAddLit(&childrenBuf, "/>\n");
|
||||||
}
|
}
|
||||||
@ -21393,7 +21394,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
ids, virProcessSchedPolicyTypeToString(sp->policy));
|
ids, virProcessSchedPolicyTypeToString(sp->policy));
|
||||||
VIR_FREE(ids);
|
VIR_FREE(ids);
|
||||||
|
|
||||||
if (sp->priority)
|
if (sp->policy == VIR_PROC_POLICY_FIFO ||
|
||||||
|
sp->policy == VIR_PROC_POLICY_RR)
|
||||||
virBufferAsprintf(&childrenBuf, " priority='%d'", sp->priority);
|
virBufferAsprintf(&childrenBuf, " priority='%d'", sp->priority);
|
||||||
virBufferAddLit(&childrenBuf, "/>\n");
|
virBufferAddLit(&childrenBuf, "/>\n");
|
||||||
}
|
}
|
||||||
|
@ -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>4</iothreads>
|
||||||
|
<cputune>
|
||||||
|
<shares>2048</shares>
|
||||||
|
<period>1000000</period>
|
||||||
|
<quota>-1</quota>
|
||||||
|
<vcpupin vcpu='0' cpuset='0'/>
|
||||||
|
<vcpupin vcpu='1' cpuset='1'/>
|
||||||
|
<emulatorpin cpuset='1'/>
|
||||||
|
<vcpusched vcpus='0-1' scheduler='fifo' priority='0'/>
|
||||||
|
<iothreadsched iothreads='1-3' scheduler='rr' priority='0'/>
|
||||||
|
</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>
|
@ -492,6 +492,7 @@ mymain(void)
|
|||||||
DO_TEST("cputune");
|
DO_TEST("cputune");
|
||||||
DO_TEST("cputune-zero-shares");
|
DO_TEST("cputune-zero-shares");
|
||||||
DO_TEST_DIFFERENT("cputune-iothreadsched");
|
DO_TEST_DIFFERENT("cputune-iothreadsched");
|
||||||
|
DO_TEST("cputune-iothreadsched-zeropriority");
|
||||||
DO_TEST("cputune-numatune");
|
DO_TEST("cputune-numatune");
|
||||||
DO_TEST("vcpu-placement-static");
|
DO_TEST("vcpu-placement-static");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user