cli: --cpu: add support for unit of NUMA memory size

This adds support for the `numa.cell[0-9]*.unit` option.
This commit is contained in:
Hugues Fafard 2021-08-03 19:41:33 +02:00 committed by Cole Robinson
parent 7d49d95a0f
commit bf3bd824c1
4 changed files with 7 additions and 3 deletions

View File

@ -153,7 +153,7 @@
<sibling id="1" value="10"/>
</distances>
</cell>
<cell id="2" cpus="4" memory="256" memAccess="shared" discard="no"/>
<cell id="2" cpus="4" memory="256" memAccess="shared" discard="no" unit="KiB"/>
</numa>
</cpu>
<clock offset="utc">
@ -426,7 +426,7 @@
<sibling id="1" value="10"/>
</distances>
</cell>
<cell id="2" cpus="4" memory="256" memAccess="shared" discard="no"/>
<cell id="2" cpus="4" memory="256" memAccess="shared" discard="no" unit="KiB"/>
</numa>
</cpu>
<clock offset="utc">

View File

@ -509,7 +509,7 @@ c.add_compare("""--pxe
--cpu foobar,+x2apic,+x2apicagain,-distest,forbid=foo,forbid=bar,disable=distest2,optional=opttest,require=reqtest,match=strict,vendor=meee,mode=custom,check=partial,\
cell.id=0,cell.cpus=1,2,3,cell.memory=1024,\
cell1.id=1,cell1.memory=256,cell1.cpus=5-8,\
numa.cell2.id=2,numa.cell2.memory=256,numa.cell2.cpus=4,numa.cell2.memAccess=shared,numa.cell2.discard=no,\
numa.cell2.id=2,numa.cell2.memory=256,numa.cell2.unit=KiB,numa.cell2.cpus=4,numa.cell2.memAccess=shared,numa.cell2.discard=no,\
cell0.distances.sibling0.id=0,cell0.distances.sibling0.value=10,\
cell0.distances.sibling1.id=1,cell0.distances.sibling1.value=21,\
numa.cell1.distances.sibling0.id=0,numa.cell1.distances.sibling0.value=21,\

View File

@ -2338,6 +2338,9 @@ class ParserCPU(VirtCLIParser):
find_inst_cb=cls.cell_find_inst_cb)
cls.add_arg("numa.cell[0-9]*.memory", "memory",
find_inst_cb=cls.cell_find_inst_cb)
cls.add_arg("numa.cell[0-9]*.unit", "unit",
find_inst_cb=cls.cell_find_inst_cb)
cls.add_arg("numa.cell[0-9]*.distances.sibling[0-9]*.id", "id",
find_inst_cb=cls.sibling_find_inst_cb)
cls.add_arg("numa.cell[0-9]*.distances.sibling[0-9]*.value", "value",

View File

@ -31,6 +31,7 @@ class _CPUCell(XMLBuilder):
id = XMLProperty("./@id", is_int=True)
cpus = XMLProperty("./@cpus")
memory = XMLProperty("./@memory", is_int=True)
unit = XMLProperty("./@unit")
memAccess = XMLProperty("./@memAccess")
discard = XMLProperty("./@discard")
siblings = XMLChildProperty(_CPUCellSibling, relative_xpath="./distances")