diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e9554511f9..2c3b96b0e5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21378,7 +21378,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, ids, virProcessSchedPolicyTypeToString(sp->policy)); 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); virBufferAddLit(&childrenBuf, "/>\n"); } @@ -21393,7 +21394,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, ids, virProcessSchedPolicyTypeToString(sp->policy)); 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); virBufferAddLit(&childrenBuf, "/>\n"); } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-zeropriority.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-zeropriority.xml new file mode 100644 index 0000000000..0996723b97 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-zeropriority.xml @@ -0,0 +1,38 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 2 + 4 + + 2048 + 1000000 + -1 + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +
+ + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 711827dfe6..7a41a18704 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -492,6 +492,7 @@ mymain(void) DO_TEST("cputune"); DO_TEST("cputune-zero-shares"); DO_TEST_DIFFERENT("cputune-iothreadsched"); + DO_TEST("cputune-iothreadsched-zeropriority"); DO_TEST("cputune-numatune"); DO_TEST("vcpu-placement-static");