On 03/09/2017 11:06 AM, Michal Privoznik wrote:
Now that NVDIMM has found its way into libvirt, users might want
to fine tune some settings for each module separately. One such
setting is 'share=on|off' for the memory-backend-file object.
This setting - just like its name suggest already - enables
sharing the nvdimm module with other applications. Under the hood
it controls whether qemu mmaps() the file as MAP_PRIVATE or
MAP_SHARED.
Yet again, we have such config knob in domain XML, but it's just
an attribute to numa <cell/>. This does not give fine enough
tuning on per-memdevice basis so we need to have the attribute
for each device too.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/formatdomain.html.in | 16 ++++++-
docs/schemas/domaincommon.rng | 8 ++++
src/conf/domain_conf.c | 15 +++++-
src/conf/domain_conf.h | 2 +
.../qemuxml2argv-memory-hotplug-nvdimm-access.xml | 56 ++++++++++++++++++++++
...qemuxml2xmlout-memory-hotplug-nvdimm-access.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
7 files changed, 96 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.xml
create mode 120000
tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-access.xml
This patch fails make check for me because your qemuxml2xmloutdata has
the wrong softlink set up. I don't have "/home/zippy/work/...", but I
would have
e.g. from the tests/qemuxml2xmloutdata directory use:
ln -sf ../qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.xml
qemuxml2xmlout-memory-hotplug-nvdimm-access.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6e89bfe3a..4bc3d92f9 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1417,7 +1417,7 @@
<span class='since'>Since 1.2.9</span> the optional attribute
<code>memAccess</code> can control whether the memory is to be
mapped as "shared" or "private". This is valid only for
- hugepages-backed memory.
+ hugepages-backed memory and nvdimm modules.
</p>
<p>
@@ -7099,7 +7099,7 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
<devices>
- <memory model='dimm'>
+ <memory model='dimm' access='private'>
<target>
<size unit='KiB'>524287</size>
<node>0</node>
@@ -7138,6 +7138,18 @@ qemu-kvm -net nic,model=? /dev/null
</p>
</dd>
+ <dt><code>access</code></dt>
+ <dd>
+ <p>
+ An optional attribute <code>access</code>
+ (<span class="since">since 3.2.0</span>) that provides
+ capability to fine tune mapping of the memory on per
+ module basis. Values are the same as
+ <a href="#elementsMemoryBacking">Memory Backing</a>:
+ <code>shared</code> and <code>private</code>.
+ </p>
+ </dd>
+
From the v2 code review comment/response - can/should we state right
here that the access setting in/for nvdimm would override any
memoryBacking setting?'
If so, then would it be furthermore interesting to modify the XML here
to set the memoryBacking as private and override that, but it's not
required...
ACK w/ the fixed link to the output file... Your call on the doc change
John