conf: Introduce @access to <memory/>

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@redhat.com>
This commit is contained in:
Michal Privoznik
2016-08-01 14:59:38 +02:00
parent 1bc173199e
commit 80af11d3dd
7 changed files with 96 additions and 3 deletions

View File

@@ -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>
@@ -7100,7 +7100,7 @@ qemu-kvm -net nic,model=? /dev/null
<pre>
...
&lt;devices&gt;
&lt;memory model='dimm'&gt;
&lt;memory model='dimm' access='private'&gt;
&lt;target&gt;
&lt;size unit='KiB'&gt;524287&lt;/size&gt;
&lt;node&gt;0&lt;/node&gt;
@@ -7139,6 +7139,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>
<dt><code>source</code></dt>
<dd>
<p>

View File

@@ -4750,6 +4750,14 @@
<value>nvdimm</value>
</choice>
</attribute>
<optional>
<attribute name="access">
<choice>
<value>shared</value>
<value>private</value>
</choice>
</attribute>
</optional>
<interleave>
<optional>
<ref name="memorydev-source"/>