On 03/09/2017 11:06 AM, Michal Privoznik wrote:
For NVDIMM devices it is optionally possible to specify the size
of internal storage for namespaces. Namespaces are a feature that
allows users to partition the NVDIMM for different uses.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/formatdomain.html.in | 11 ++++
docs/schemas/domaincommon.rng | 7 +++
src/conf/domain_conf.c | 34 +++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 3 ++
.../qemuxml2argv-memory-hotplug-nvdimm-label.args | 26 ++++++++++
.../qemuxml2argv-memory-hotplug-nvdimm-label.xml | 59 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
.../qemuxml2xmlout-memory-hotplug-nvdimm-label.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
10 files changed, 145 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.xml
create mode 120000
tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
Not that it matters in the grand scheme of things, but @access was split
across 2 patches, while @label-size is all in one.
The
tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
has the same problem as patch 8 as make check fails for me... Required a
similar adjustment from qemuxml2xmloutdata directory:
ln -sf ../qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.xml
qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
FWIW: In re-reading my v2 review - not quite sure what was tripping me
up about label-size. Perhaps when I saw that comparison to 128 I started
overthinking things and missed the "if (def->labelsize..."
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4bc3d92f9..bb6df4542 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7122,6 +7122,9 @@ qemu-kvm -net nic,model=? /dev/null
<target>
<size unit='KiB'>524288</size>
<node>1</node>
+ <label>
+ <size unit='KiB'>128</size>
+ </label>
</target>
</memory>
</devices>
@@ -7203,6 +7206,14 @@ qemu-kvm -net nic,model=? /dev/null
attach the memory to. The element shall be used only if the guest has
NUMA nodes configured.
</p>
+ <p>
+ For NVDIMM type devices one can optionally use
+ <code>label</code> and its subelement
<code>size</code>
+ to configure the size of namespaces label storage
+ within the NVDIMM module. The <code>size</code> element
+ has usual meaning described
+ <a href="#elementsMemoryAllocation">here</a>.
+ </p>
Should there be a summary of what was written in:
https://www.redhat.com/archives/libvir-list/2016-August/msg00650.html
e.g.
By default no Namespace Label area is reserved in the file. If the
user specifies label-size then the memory at the end of the file is
used as the Namespace Label area.
For QEMU, there are two restrictions:
1. Minimum label size is 128K
2. Remaining size (total - labelsize) is aligned with 4k for nomral
backend or hugepage-size for hugetblfs cannot be 0.
(Or reworded sufficiently ;-)... Would be "nice" not lose that and
something someone may trip across...
ACK w/ the link fixed - bonus points for documentation adjustments.
Better to do it now while it's still fresh in your mind rather than
months down the road when someone asks and you're in the middle of
something else!
John
[...]
diff --git
a/tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
new file mode 120000
index 000000000..e357ec582
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
@@ -0,0 +1 @@
+/home/zippy/work/libvirt/libvirt.git/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.xml
!!
\ No newline at end of file