On 11/02/2017 09:47 AM, Wim Ten Have wrote:
From: Wim ten Have <wim.ten.have(a)oracle.com>
This patch converts NUMA configurations between the Xen libxl
configuration file format and libvirt's XML format.
XML HVM domain on a 4 node (2 cores/socket) configuration:
<cpu>
<numa>
<cell id='0' cpus='0-1' memory='2097152'
unit='KiB'>
<distances>
<sibling id='0' value='10'/>
<sibling id='1' value='21'/>
<sibling id='2' value='31'/>
<sibling id='3' value='21'/>
</distances>
</cell>
<cell id='1' cpus='2-3' memory='2097152'
unit='KiB'>
<distances>
<sibling id='0' value='21'/>
<sibling id='1' value='10'/>
<sibling id='2' value='21'/>
<sibling id='3' value='31'/>
</distances>
</cell>
<cell id='2' cpus='3-4' memory='2097152'
unit='KiB'>
<distances>
<sibling id='0' value='31'/>
<sibling id='1' value='21'/>
<sibling id='2' value='10'/>
<sibling id='3' value='21'/>
</distances>
</cell>
<cell id='3' cpus='5-6' memory='2097152'
unit='KiB'>
<distances>
<sibling id='0' value='21'/>
<sibling id='1' value='31'/>
<sibling id='2' value='21'/>
<sibling id='3' value='10'/>
</distances>
</cell>
</numa>
</cpu>
Xen xl.cfg domain configuration:
vnuma =
[["pnode=0","size=2048","vcpus=0-1","vdistances=10,21,31,21"],
["pnode=1","size=2048","vcpus=2-3","vdistances=21,10,21,31"],
["pnode=2","size=2048","vcpus=4-5","vdistances=31,21,10,21"],
["pnode=3","size=2048","vcpus=6-7","vdistances=21,31,21,10"]]
If there is no XML <distances> description amongst the <cell> data the
conversion schema from xml to native will generate 10 for local and 20
for all remote instances.
Signed-off-by: Wim ten Have <wim.ten.have(a)oracle.com>
---
Changes on v2:
- Reduce the indentation level under xenParseXLVnuma().
Changes on v3:
- Add the Numa core split functions required to interface.
Changes on v5:
- Apply suggested cosmetic suggestions.
- Apply virReportError() message suggestions.
- Order prototyping for Getters and Setters under numa_conf.h
- Break function arguments to one parameter per line conform code style.
---
src/conf/numa_conf.c | 137 +++++++++++++++++++
src/conf/numa_conf.h | 25 ++++
src/libvirt_private.syms | 5 +
src/xenconfig/xen_xl.c | 335 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 502 insertions(+)
Reviewed-by: Jim Fehlig <jfehlig(a)suse.com>
Regards,
Jim