$SUBJ:
s/nvdimm: introduce/conf: Introduce/
On 12/20/18 4:14 AM, Luyao Zhong wrote:
NVDIMM emulation will mmap the backend file, it uses host pagesize
as the alignment of mapping address before, but some backends may
require alignments different from the pagesize. So the 'alignsize'
option will be introduced to allow users specifying the proper
s/will be/is
s/users specifying/specification of/
alignment:
<devices>
...
<memory model='nvdimm' access='shared'>
<source>
<path>/dev/dax0.0</path>
<alignsize unit='MiB'>2</alignsize>
</source>
<target>
<size unit='MiB'>4094</size>
<node>0</node>
<label>
<size unit='MiB'>2</size>
</label>
</target>
</memory>
...
</devices>
Signed-off-by: Luyao Zhong <luyao.zhong(a)intel.com>
---
docs/formatdomain.html.in | 23 +++++++--
docs/schemas/domaincommon.rng | 13 +++--
src/conf/domain_conf.c | 32 +++++++++---
src/conf/domain_conf.h | 1 +
.../memory-hotplug-nvdimm-align.xml | 58 ++++++++++++++++++++++
.../memory-hotplug-nvdimm-align.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
7 files changed, 116 insertions(+), 13 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index a18d063..515e656 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -8322,6 +8322,7 @@ qemu-kvm -net nic,model=? /dev/null
<memory model='nvdimm'>
<source>
<path>/tmp/nvdimm</path>
+ <alignsize unit='KiB'>2048</alignsize>
</source>
<target>
<size unit='KiB'>524288</size>
@@ -8403,10 +8404,26 @@ qemu-kvm -net nic,model=? /dev/null
</dl>
<p>
- For model <code>nvdimm</code> this element is mandatory and has a
- single child element <code>path</code> that represents a path
- in the host that backs the nvdimm module in the guest.
+ For model <code>nvdimm</code> this element is mandatory. The
+ mandatory child element <code>path</code> represents a path in
+ the host that backs the nvdimm module in the guest. If
+ <code>nvdimm</code> is provided, then the following optional
+ elements can be provided as well:
s/If ... as well:/The following optional elements may be used:/
</p>
+
+ <dl>
+ <dt><code>alignsize</code></dt>
+ <dd>
+ <p>
+ This element can be used to specify a proper alignment.
+ When mmap(2) the backend files, QEMU uses the host page
+ size by default as the alignment of mapping address. However,
+ some backends may require alignments different from the page.
How about:
The <code>alignsize</code> element defines the page size alignment used
to mmap the address range for the backend <code>path</code>. If not
supplied the host page size is used.
NB: This makes the description hypvervisor agnostic and "simpler".
+ For example, mmap a real NVDIMM device maybe
2M-aligned required.
Change to:
For example, to mmap a real NVDIMM device a 2M-aligned may be required.
With your OK, then I can make these changes for you.
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John
[...]