mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
conf: Introduce 'alignsize' element into xml for NVDIMM memory
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 is introduced to allow specification of the proper 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@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained 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,25 @@ 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. The following
|
||||
optional elements may be used:
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt><code>alignsize</code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
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.
|
||||
For example, to mmap a real NVDIMM device a 2M-aligned page may
|
||||
be required.
|
||||
<span class="since">Since 5.0.0</span>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
|
||||
<dt><code>target</code></dt>
|
||||
|
||||
@@ -5384,9 +5384,16 @@
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<element name="path">
|
||||
<ref name="absFilePath"/>
|
||||
</element>
|
||||
<interleave>
|
||||
<element name="path">
|
||||
<ref name="absFilePath"/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name="alignsize">
|
||||
<ref name="scaledInteger"/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</group>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
Reference in New Issue
Block a user