
On 09/08/2014 01:40 PM, Martin Kletzander wrote:
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 7 +++- docs/schemas/domaincommon.rng | 5 +++ src/conf/cpu_conf.c | 25 +++++++++++- src/conf/cpu_conf.h | 7 ++-- .../qemuxml2argv-cpu-numa-memshared.xml | 28 ++++++++++++++ .../qemuxml2argv-hugepages-shared.xml | 45 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 2 + 7 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 94236dd..b284d6e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1105,7 +1105,7 @@ ... <numa> <cell id='0' cpus='0-3' memory='512000'/> - <cell id='1' cpus='4-7' memory='512000'/> + <cell id='1' cpus='4-7' memory='512000' memShared='on'/>
I wonder if "shared='on'" would be enough, avoiding the need for a multi-word attribute.
</numa> ... </cpu> @@ -1122,6 +1122,11 @@ assigned <code>id</code>s in the increasing order starting from 0. Mixing cells with and without the <code>id</code> attribute is not recommended as it may result in unwanted behaviour. + + <span class='since'>Since 1.2.9</span> the optional attribute + <code>memShared</code> can control whether the memory is to be + mapped as shared or not (values "on"/"off"). This is valid only + for hugepages-backed memory. </p>
<p>
@@ -491,7 +491,7 @@ virCPUDefParseXML(xmlNodePtr node, goto error; }
- ret = virStrToLong_ui(memory, NULL, 10, &def->cells[cur_cell].mem); + ret = virStrToLong_ui(memory, NULL, 10, &def->cells[cur_cell].mem); if (ret == -1) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid 'memory' attribute in NUMA cell")); @@ -93,9 +93,10 @@ struct _virCPUFeatureDef { typedef struct _virCellDef virCellDef; typedef virCellDef *virCellDefPtr; struct _virCellDef { - virBitmapPtr cpumask; /* CPUs that are part of this node */ - char *cpustr; /* CPUs stored in string form for dumpxml */ - unsigned int mem; /* Node memory in kB */ + virBitmapPtr cpumask; /* CPUs that are part of this node */ + char *cpustr; /* CPUs stored in string form for dumpxml */
The comments would look nicer aligned.
+ unsigned int mem; /* Node memory in kB */ + virTristateSwitch memShared; };
typedef struct _virCPUDef virCPUDef;
Please push these whitespace cleanups separately. Jan