config tool: Fix service vm cpu affinity issue

default value of minOccurs is "1", which will trigger problem
when user leave pcpu_id blank while preserve cpu_affinity in
service VM.

Tracked-On: #7267
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
This commit is contained in:
hangliu1 2022-04-11 04:57:15 -04:00 committed by acrnsi-robot
parent 7bf96c5a97
commit f656ef0abc
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@
<xs:complexType name="CPUAffinityConfiguration">
<xs:sequence>
<xs:element name="pcpu_id" type="xs:integer" default="2" maxOccurs="unbounded">
<xs:element name="pcpu_id" type="xs:integer" default="2" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A pCPU that this VM's vCPU is allowed to pin
to.</xs:documentation>

View File

@ -13,7 +13,7 @@ def sos_cpu_affinity(etree):
if common.get_node("//vm[load_order = 'SERVICE_VM']", etree) is None:
return None
if common.get_node("//vm[load_order = 'SERVICE_VM' and count(cpu_affinity)]", etree) is not None:
if common.get_node("//vm[load_order = 'SERVICE_VM' and count(cpu_affinity/pcpu_id)]", etree) is not None:
return None
sos_extend_all_cpus = board_cfg_lib.get_processor_info()