[libvirt] [PATCH v2 0/3] qemu: arm guest on x86
by infos@nafets.de
From: Stefan Schallenberg <infos(a)nafets.de>
rewrite of patch after discussion.
Stefan Schallenberg (3):
Add armv6l Support as guest
qemu: Add Default PCI Device for armv6l versatilepb guests
News: Add armv6l Support as guest
docs/news.xml | 5 ++
docs/schemas/basictypes.rng | 1 +
src/qemu/qemu_capabilities.c | 5 +-
src/qemu/qemu_command.c | 4 +-
src/qemu/qemu_domain.c | 17 +++--
src/qemu/qemu_domain_address.c | 6 +-
tests/capabilityschemadata/caps-qemu-kvm.xml | 66 ++++++++++++++++++++
tests/testutilsqemu.c | 40 +++++++++++-
8 files changed, 133 insertions(+), 11 deletions(-)
--
2.19.2
5 years, 11 months
[libvirt] [PATCH] tests: Sync qemucaps2xml with qemucapabilities
by Andrea Bolognani
Commits d7434ae8009f and 9c4afbda3456 added replies files for
QEMU 3.0.0 on s390x and QEMU 3.1.0 on x86_64 respectively, but
only enabled the corresponding test in qemucapabilities and not
in qemucaps2xml.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
The proper fix would be to make both qemucapabilities and
qemucaps2xml pick up files dropped into qemucapabilitiesdata/
automatically; until someone finds time to actually implement
that solution, this will do.
.../qemucaps2xmloutdata/caps_3.0.0.s390x.xml | 26 +++++++++++++++++
.../qemucaps2xmloutdata/caps_3.1.0.x86_64.xml | 28 +++++++++++++++++++
tests/qemucaps2xmltest.c | 2 ++
3 files changed, 56 insertions(+)
create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.s390x.xml
create mode 100644 tests/qemucaps2xmloutdata/caps_3.1.0.x86_64.xml
diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_3.0.0.s390x.xml
new file mode 100644
index 0000000000..bb82a15040
--- /dev/null
+++ b/tests/qemucaps2xmloutdata/caps_3.0.0.s390x.xml
@@ -0,0 +1,26 @@
+<capabilities>
+
+ <host>
+ <cpu>
+ <arch>s390x</arch>
+ </cpu>
+ <power_management/>
+ <iommu support='no'/>
+ </host>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='s390x'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <domain type='qemu'/>
+ <domain type='kvm'/>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+</capabilities>
diff --git a/tests/qemucaps2xmloutdata/caps_3.1.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_3.1.0.x86_64.xml
new file mode 100644
index 0000000000..d41693a001
--- /dev/null
+++ b/tests/qemucaps2xmloutdata/caps_3.1.0.x86_64.xml
@@ -0,0 +1,28 @@
+<capabilities>
+
+ <host>
+ <cpu>
+ <arch>x86_64</arch>
+ </cpu>
+ <power_management/>
+ <iommu support='no'/>
+ </host>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='x86_64'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <domain type='qemu'/>
+ <domain type='kvm'/>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ <acpi default='on' toggle='yes'/>
+ <apic default='on' toggle='no'/>
+ </features>
+ </guest>
+
+</capabilities>
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index 3688c4a3b4..ead4543699 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -200,6 +200,7 @@ mymain(void)
DO_TEST("x86_64", "caps_2.11.0");
DO_TEST("x86_64", "caps_2.12.0");
DO_TEST("x86_64", "caps_3.0.0");
+ DO_TEST("x86_64", "caps_3.1.0");
DO_TEST("aarch64", "caps_2.6.0");
DO_TEST("aarch64", "caps_2.10.0");
DO_TEST("aarch64", "caps_2.12.0");
@@ -215,6 +216,7 @@ mymain(void)
DO_TEST("s390x", "caps_2.10.0");
DO_TEST("s390x", "caps_2.11.0");
DO_TEST("s390x", "caps_2.12.0");
+ DO_TEST("s390x", "caps_3.0.0");
DO_TEST("riscv32", "caps_3.0.0");
DO_TEST("riscv64", "caps_3.0.0");
--
2.19.2
5 years, 11 months
[libvirt] [PATCH v2 00/13] Autoselect a DRM node for egl-headless and add it to cmdline
by Erik Skultety
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628892.
The problem is that we didn't put the DRI device into the namespace for QEMU to
access, but that was only a part of the issue. The other part of the issue is
that QEMU doesn't support specifying 'rendernode' for egl-headless yet (patches
are already merged upstream for 3.1) Instead, QEMU's been autoselecting the
DRI device on its own. There's no compelling reason for libvirt not doing that
instead and thus prevent any permission-related issues.
Since v1:
- updated capabilities to 3.1.0-rc2 containing the necessary QEMU patches
- provided more test cases as requested
- added a new XML sub-element <gl> for egl-headless graphics type
Erik Skultety (13):
util: Introduce virHostGetDRMRenderNode helper
conf: Introduce virDomainGraphics-related helpers
qemu: process: spice: Pick the first available DRM render node
qemu: command: Introduce qemuBuildGraphicsEGLHeadlessCommandLine
helper
qemu: caps: Introduce QEMU_EGL_HEADLESS_RENDERNODE capability
squash into rendernode capability patch
conf: gfx: Add egl-headless as a member to virDomainGraphicsDef struct
conf: gfx: egl-headless: Introduce a new <gl> subelement
qemu: process: gfx: egl-headless: Pick the first available DRM node
qemu: domain: egl-headless: Add the DRI device into the namespace
qemu: cgroup: gfx: egl-headless: Add the DRI device into the cgroup
list
security: dac: gfx: egl-headless: Relabel the DRI device
qemu: command: gfx: egl-headless: Add 'rendernode' option to the
cmdline
docs/formatdomain.html.in | 11 +-
docs/schemas/domaincommon.rng | 17 +-
src/conf/domain_conf.c | 84 +
src/conf/domain_conf.h | 12 +
src/libvirt_private.syms | 4 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 10 +-
src/qemu/qemu_command.c | 39 +-
src/qemu/qemu_domain.c | 9 +-
src/qemu/qemu_process.c | 21 +
src/security/security_dac.c | 15 +-
src/util/virutil.c | 53 +
src/util/virutil.h | 2 +
.../caps_3.1.0.x86_64.replies | 22911 ++++++++++++++++
.../caps_3.1.0.x86_64.xml | 1376 +
tests/qemucapabilitiestest.c | 1 +
...graphics-egl-headless-rendernode-auto.args | 26 +
.../graphics-egl-headless-rendernode-auto.xml | 1 +
.../graphics-egl-headless-rendernode.xml | 33 +
.../graphics-egl-headless.args | 2 +-
.../graphics-spice-egl-headless.args | 2 +-
.../graphics-spice-gl-no-rendernode.args | 25 +
.../graphics-spice-gl-no-rendernode.xml | 24 +
.../graphics-vnc-egl-headless.args | 2 +-
...play-spice-egl-headless.x86_64-latest.args | 2 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 2 +-
tests/qemuxml2argvmock.c | 9 +
tests/qemuxml2argvtest.c | 7 +
.../graphics-egl-headless-rendernode.xml | 41 +
tests/qemuxml2xmltest.c | 2 +
31 files changed, 24711 insertions(+), 35 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless-rendernode-auto.args
create mode 120000 tests/qemuxml2argvdata/graphics-egl-headless-rendernode-auto.xml
create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless-rendernode.xml
create mode 100644 tests/qemuxml2argvdata/graphics-spice-gl-no-rendernode.args
create mode 100644 tests/qemuxml2argvdata/graphics-spice-gl-no-rendernode.xml
create mode 100644 tests/qemuxml2xmloutdata/graphics-egl-headless-rendernode.xml
--
2.19.1
5 years, 11 months
[libvirt] [RFC v2 3/3] nvdimm: update docs for introducing more NVDIMM configurations
by Luyao Zhong
Update news.xml and add description about new supported configurations
about NVDIMM in html, including 'alignsize', 'pmem', 'unarmed' and
'persistence'.
Signed-off-by: Luyao Zhong <luyao.zhong(a)intel.com>
---
docs/formatdomain.html.in | 94 ++++++++++++++++++++++++++++++++-------
docs/news.xml | 9 ++++
2 files changed, 88 insertions(+), 15 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 84259c45e4..a79ffbdcde 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -8317,6 +8317,8 @@ qemu-kvm -net nic,model=? /dev/null
<memory model='nvdimm'>
<source>
<path>/tmp/nvdimm</path>
+ <alignsize unit='KiB'>2048</alignsize>
+ <pmem/>
</source>
<target>
<size unit='KiB'>524288</size>
@@ -8324,6 +8326,8 @@ qemu-kvm -net nic,model=? /dev/null
<label>
<size unit='KiB'>128</size>
</label>
+ <persistence>cpu</persistence>
+ <unarmed/>
</target>
</memory>
</devices>
@@ -8398,10 +8402,37 @@ 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:
</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.
+ For example, mmap a real NVDIMM device maybe 2M-aligned required.
+ <span class="since">Since 4.9.0</span>
+ </p>
+ </dd>
+
+ <dt><code>pmem</code></dt>
+ <dd>
+ <p>
+ This element can be used to specify whether the backend storage
+ of memory-backend-file is a real persistent memory. If the backend
+ is a real persistence memory and <code>pmem</code> is set, QEMU
+ will guarantee the persistence of its own writes to the vNVDIMM
+ backend.<span class="since">Since 4.9.0</span>
+ </p>
+ </dd>
+ </dl>
</dd>
<dt><code>target</code></dt>
@@ -8420,19 +8451,52 @@ qemu-kvm -net nic,model=? /dev/null
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>.
- For QEMU domains the following restrictions apply:
+ Besides, the following optional elements can be provided as well for
+ NVDIMM type devices:
</p>
- <ol>
- <li>the minimum label size is 128KiB,</li>
- <li>the remaining size (total-size - label-size) has to be aligned to
- 4KiB</li>
- </ol>
+
+ <dl>
+ <dt><code>label</code></dt>
+ <dd>
+ <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>.
+ For QEMU domains the following restrictions apply:
+ </p>
+ <ol>
+ <li>the minimum label size is 128KiB,</li>
+ <li>the remaining size (total-size - label-size) will be aligned to
+ 4KiB as default.</li>
+ </ol>
+ </dd>
+
+ <dt><code>persistence</code></dt>
+ <dd>
+ <p>
+ The <code>persistence</code> element can be set to "mem-ctrl" or "cpu",
+ which indicate platform-supported features about NVDIMM data persistence.
+ 'mem-ctrl' means the platform supports flushing dirty data from the memory
+ controller to the NVDIMMs in the event of power loss, 'cpu' means the platform
+ supports flushing dirty data from the CPU cache (and the memory controller)
+ to the NVDIMMs in the event of power loss.
+ <span class="since">Since 4.9.0</span>
+ </p>
+ </dd>
+
+ <dt><code>unarmed</code></dt>
+ <dd>
+ <p>
+ The <code>unarmed</code> element can be used to mark vNVDIMM read-only.
+ Currently, only real NVDIMM device backend can guarantee the guest write
+ persistence, so please set <code>unarmed</code> when using other types
+ of backends.<span class="since">Since 4.9.0</span>
+ </p>
+ </dd>
+ </dl>
</dd>
</dl>
diff --git a/docs/news.xml b/docs/news.xml
index 3983613f8a..35f743f6a3 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -25,6 +25,15 @@
<section title="New features">
</section>
<section title="Improvements">
+ <change>
+ <summary>
+ NVDIMM: support more configurations
+ </summary>
+ <description>
+ Introduce more configuration options supported by QEMU community,
+ including 'alignsize', 'pmem', 'unarmed' and 'persistence'.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.17.1
5 years, 11 months
[libvirt] [PATCH for-4.0 v3 0/2] virtio: Provide version-specific variants of virtio PCI devices
by Eduardo Habkost
Existing modern-only device types are not being touched by v3, as
they don't need separate variants. However, I plan to implement
separate cleanups in the code that calls virtio_pci_force_virtio_1(),
first, and then propose additional changes (e.g. deprecating
disable-legacy and disable-modern in those device types).
Changes v2 -> v3:
* Split into two separate patches (type registration helper
and introduction of new types)
* Rewrote virtio_pci_types_register() completely:
* Replaced magic generation of type names with explicit fields in
VirtioPCIDeviceTypeInfo
* Removed modern_only field (not necessary anymore)
* Don't register a separate base type unless necessary
Changes v1 -> v2:
* Removed *-0.9 devices. Nobody will want to use them, if
transitional devices work with legacy drivers
(Gerd Hoffmann, Michael S. Tsirkin)
* Drop virtio version from name: rename -1.0-transitional to
-transitional (Michael S. Tsirkin)
* Renamed -1.0 to -non-transitional
* Don't add any extra variants to modern-only device types
(they don't need it)
* Fix typo on TYPE_VIRTIO_INPUT_HOST_PCI (crash reported by
Cornelia Huck)
* No need to change cast macros for modern-only devices
* Rename virtio_register_types() to virtio_pci_types_register()
Original patch description:
Many of the current virtio-*-pci device types actually represent
3 different types of devices:
* virtio 1.0 non-transitional devices
* virtio 1.0 transitional devices
* virtio 0.9 ("legacy device" in virtio 1.0 terminology)
That would be just an annoyance if it didn't break our device/bus
compatibility QMP interfaces. With this multi-purpose device
type, there's no way to tell management software that
transitional devices and legacy devices require a Conventional
PCI bus.
The multi-purpose device types would also prevent us from telling
management software what's the PCI vendor/device ID for them,
because their PCI IDs change at runtime depending on the bus
where they were plugged.
This patch adds separate device types for each of those virtio
device flavors:
* virtio-*-pci: the existing multi-purpose device types
* virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
* virtio-*-pci-non-transitional: modern-only
Reference to previous discussion that originated this idea:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg558389.html
Eduardo Habkost (2):
virtio: Helper for registering virtio device types
virtio: Provide version-specific variants of virtio PCI devices
hw/virtio/virtio-pci.h | 78 +++++++--
hw/display/virtio-gpu-pci.c | 7 +-
hw/display/virtio-vga.c | 7 +-
hw/virtio/virtio-crypto-pci.c | 7 +-
hw/virtio/virtio-pci.c | 267 ++++++++++++++++++++++-------
tests/acceptance/virtio_version.py | 177 +++++++++++++++++++
6 files changed, 453 insertions(+), 90 deletions(-)
create mode 100644 tests/acceptance/virtio_version.py
--
2.18.0.rc1.1.g3f1ff2140
5 years, 11 months
[libvirt] [PATCH] virsh: Strip XML declaration when extracting CPU XMLs
by Jiri Denemark
Since commit v4.3.0-336-gc84726fbdd all
{hypervisor-,}cpu-{baseline,compare} commands use a generic
vshExtractCPUDefXMLs helper for extracting individual CPU definitions
from the provided input file. The helper wraps the input file in a
<container> element so that several independent elements can be easily
parsed from the file. This works fine except when the file starts with
XML declaration (<?xml version="1.0" ... ?>) because the XML declaration
cannot be put inside any element. In fact it has to be at the very
beginning of the XML document without any preceding white space
characters. We can just simply skip the XML declaration.
https://bugzilla.redhat.com/show_bug.cgi?id=1595993
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tools/virsh-host.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 16f504bafe..b7f86bdd91 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -1130,13 +1130,20 @@ vshExtractCPUDefXMLs(vshControl *ctl,
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
xmlNodePtr *nodes = NULL;
+ char *doc;
size_t i;
int n;
if (virFileReadAll(xmlFile, VSH_MAX_XML_FILE, &buffer) < 0)
goto error;
- if (virAsprintf(&xmlStr, "<container>%s</container>", buffer) < 0)
+ /* Strip possible XML declaration */
+ if (STRPREFIX(buffer, "<?xml") && (doc = strstr(buffer, "?>")))
+ doc += 2;
+ else
+ doc = buffer;
+
+ if (virAsprintf(&xmlStr, "<container>%s</container>", doc) < 0)
goto error;
if (!(xml = virXMLParseStringCtxt(xmlStr, xmlFile, &ctxt)))
--
2.19.1
5 years, 12 months
[libvirt] [PATCH v2 0/2] lxc: Fix a bug related to IPv{4, 6} gateway persistent setting.
by Julio Faracco
This serie fixes a bug related to IPv{4,6} gateway settings when it is
defined and used with multiple network definitions. Basically, this data
is being carried on to the next network settings because the pointer is
not being cleaned up/initialized properly.
This serie add a new test case to cover this scenario too. It will be so
important to network index implemented on LXC 3.X.
v1-v2: Fixing tabs inside the code.
Julio Faracco (2):
lxc: Initializing IPv6 and IPv4 gateway to overwrite old settings.
tests: Adding test case to include multiple network definitions.
src/lxc/lxc_native.c | 3 ++
.../lxcconf2xml-miscnetwork-v3.config | 23 ++++++++++
.../lxcconf2xml-miscnetwork.config | 23 ++++++++++
.../lxcconf2xml-miscnetwork.xml | 45 +++++++++++++++++++
tests/lxcconf2xmltest.c | 2 +
5 files changed, 96 insertions(+)
create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config
create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config
create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml
--
2.19.1
5 years, 12 months
[libvirt] [RFC v2 1/3] nvdimm: introduce more config elements into xml for NVDIMM memory
by Luyao Zhong
1.alignsize
The 'alignsize' option allows users to specify the proper alignment.
2.pmem
The 'pmem' option allows users to specify whether the backend storage of
memory-backend-file is a real persistent memory.
3.persistence
The 'persistence' option allows users to set guest platform supported
features. It has two values, 'mem-ctrl' and 'cpu'.
4.unarmed
The 'unarmed' option allows users to mark vNVDIMM read-only.
These options can be configured respectively or simultaneously in domain
xml file, here is an example:
<devices>
...
<memory model='nvdimm' access='shared'>
<source>
<path>/dev/dax0.0</path>
<alignsize unit='MiB'>2</alignsize>
<pmem/>
</source>
<target>
<size unit='MiB'>4094</size>
<node>0</node>
<label>
<size unit='MiB'>2</size>
</label>
<persistence>cpu</persistence>
<unarmed/>
</target>
</memory>
...
</devices>
Signed-off-by: Luyao Zhong <luyao.zhong(a)intel.com>
---
docs/schemas/domaincommon.rng | 31 +++++-
src/conf/domain_conf.c | 94 +++++++++++++++++--
src/conf/domain_conf.h | 14 +++
src/libvirt_private.syms | 2 +
.../memory-hotplug-nvdimm-align.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-persistence.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-align.xml | 1 +
.../memory-hotplug-nvdimm-persistence.xml | 1 +
.../memory-hotplug-nvdimm-pmem.xml | 1 +
.../memory-hotplug-nvdimm-unarmed.xml | 1 +
tests/qemuxml2xmltest.c | 4 +
13 files changed, 371 insertions(+), 10 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index cb2ca5a20a..78bb25364f 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5373,9 +5373,21 @@
</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>
+ <optional>
+ <element name="pmem">
+ <empty/>
+ </element>
+ </optional>
+ </interleave>
</group>
</choice>
</element>
@@ -5399,6 +5411,19 @@
</element>
</element>
</optional>
+ <optional>
+ <element name="persistence">
+ <choice>
+ <value>mem-ctrl</value>
+ <value>cpu</value>
+ </choice>
+ </element>
+ </optional>
+ <optional>
+ <element name="unarmed">
+ <empty/>
+ </element>
+ </optional>
</interleave>
</element>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a7ab3e26f1..4fc0e93bb8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -939,6 +939,12 @@ VIR_ENUM_IMPL(virDomainMemoryModel,
"dimm",
"nvdimm")
+VIR_ENUM_IMPL(virDomainMemoryPersistence,
+ VIR_DOMAIN_MEMORY_PERSISTENCE_LAST,
+ "",
+ "mem-ctrl",
+ "cpu")
+
VIR_ENUM_IMPL(virDomainShmemModel, VIR_DOMAIN_SHMEM_MODEL_LAST,
"ivshmem",
"ivshmem-plain",
@@ -15736,6 +15742,16 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node,
_("path is required for model 'nvdimm'"));
goto cleanup;
}
+
+ if (virDomainParseMemory("./alignsize", "./alignsize/@unit", ctxt,
+ &def->alignsize, false, false) < 0)
+ goto cleanup;
+
+ if (virXPathBoolean("boolean(./pmem)", ctxt))
+ def->nvdimmPmem = true;
+ else
+ def->nvdimmPmem = false;
+
break;
case VIR_DOMAIN_MEMORY_MODEL_NONE:
@@ -15761,6 +15777,8 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node,
xmlNodePtr save = ctxt->node;
ctxt->node = node;
int rv;
+ int val;
+ char *ndPrst = NULL;
/* initialize to value which marks that the user didn't specify it */
def->targetNode = -1;
@@ -15792,11 +15810,28 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node,
_("label size must be smaller than NVDIMM size"));
goto cleanup;
}
+
+ if ((ndPrst = virXPathString("string(./persistence)", ctxt))) {
+ if ((val = virDomainMemoryPersistenceTypeFromString(ndPrst)) < 0) {
+ virReportError(VIR_ERR_XML_DETAIL,
+ _("Invalid value of nvdimm 'persistence': %s"),
+ ndPrst);
+ goto cleanup;
+ }
+ def->nvdimmPersistence = val;
+ }
+ VIR_FREE(ndPrst);
+
+ if (virXPathBoolean("boolean(./unarmed)", ctxt))
+ def->nvdimmUnarmed = true;
+ else
+ def->nvdimmUnarmed = false;
}
ret = 0;
cleanup:
+ VIR_FREE(ndPrst);
ctxt->node = save;
return ret;
}
@@ -22691,13 +22726,45 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src,
return false;
}
- if (src->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM &&
- src->labelsize != dst->labelsize) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target NVDIMM label size '%llu' doesn't match "
- "source NVDIMM label size '%llu'"),
- src->labelsize, dst->labelsize);
- return false;
+ if (src->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM) {
+ if (src->labelsize != dst->labelsize) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target NVDIMM label size '%llu' doesn't match "
+ "source NVDIMM label size '%llu'"),
+ src->labelsize, dst->labelsize);
+ return false;
+ }
+
+ if (src->alignsize != dst->alignsize) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target NVDIMM alignment '%llu' doesn't match "
+ "source NVDIMM alignment '%llu'"),
+ src->alignsize, dst->alignsize);
+ return false;
+ }
+
+ if (src->nvdimmPmem != dst->nvdimmPmem) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target NVDIMM pmem flag doesn't match "
+ "source NVDIMM pmem flag "));
+ return false;
+ }
+
+ if (src->nvdimmPersistence != dst->nvdimmPersistence) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target NVDIMM persistence value '%s' doesn't match "
+ "source NVDIMM persistence value '%s'"),
+ virDomainMemoryPersistenceTypeToString(src->nvdimmPersistence),
+ virDomainMemoryPersistenceTypeToString(dst->nvdimmPersistence));
+ return false;
+ }
+
+ if (src->nvdimmUnarmed != dst->nvdimmUnarmed) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target NVDIMM unarmed flag doesn't match "
+ "source NVDIMM unarmed flag "));
+ return false;
+ }
}
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
@@ -26242,6 +26309,13 @@ virDomainMemorySourceDefFormat(virBufferPtr buf,
case VIR_DOMAIN_MEMORY_MODEL_NVDIMM:
virBufferEscapeString(buf, "<path>%s</path>\n", def->nvdimmPath);
+
+ if (def->alignsize)
+ virBufferAsprintf(buf, "<alignsize unit='KiB'>%llu</alignsize>\n",
+ def->alignsize);
+
+ if (def->nvdimmPmem)
+ virBufferAddLit(buf, "<pmem/>\n");
break;
case VIR_DOMAIN_MEMORY_MODEL_NONE:
@@ -26277,6 +26351,12 @@ virDomainMemoryTargetDefFormat(virBufferPtr buf,
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</label>\n");
}
+ if (def->nvdimmPersistence)
+ virBufferEscapeString(buf, "<persistence>%s</persistence>\n",
+ virDomainMemoryPersistenceTypeToString(def->nvdimmPersistence));
+
+ if (def->nvdimmUnarmed)
+ virBufferAddLit(buf, "<unarmed/>\n");
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</target>\n");
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 7a724fbc6f..11c6265162 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2138,6 +2138,14 @@ typedef enum {
VIR_DOMAIN_MEMORY_MODEL_LAST
} virDomainMemoryModel;
+typedef enum {
+ VIR_DOMAIN_MEMORY_PERSISTENCE_NONE,
+ VIR_DOMAIN_MEMORY_PERSISTENCE_MEMCTRL,
+ VIR_DOMAIN_MEMORY_PERSISTENCE_CPU,
+
+ VIR_DOMAIN_MEMORY_PERSISTENCE_LAST,
+} virDomainMemoryPersistence;
+
struct _virDomainMemoryDef {
virDomainMemoryAccess access;
virTristateBool discard;
@@ -2146,12 +2154,17 @@ struct _virDomainMemoryDef {
virBitmapPtr sourceNodes;
unsigned long long pagesize; /* kibibytes */
char *nvdimmPath;
+ unsigned long long alignsize; /* kibibytes; valid only for NVDIMM */
+ bool nvdimmPmem; /* valid only for NVDIMM */
/* target */
int model; /* virDomainMemoryModel */
int targetNode;
unsigned long long size; /* kibibytes */
unsigned long long labelsize; /* kibibytes; valid only for NVDIMM */
+ int nvdimmPersistence; /* enum virDomainMemoryPersistence;
+ valid only for NVDIMM*/
+ bool nvdimmUnarmed; /* valid only for NVDIMM */
virDomainDeviceInfo info;
};
@@ -3464,6 +3477,7 @@ VIR_ENUM_DECL(virDomainTPMVersion)
VIR_ENUM_DECL(virDomainMemoryModel)
VIR_ENUM_DECL(virDomainMemoryBackingModel)
VIR_ENUM_DECL(virDomainMemorySource)
+VIR_ENUM_DECL(virDomainMemoryPersistence)
VIR_ENUM_DECL(virDomainMemoryAllocation)
VIR_ENUM_DECL(virDomainIOMMUModel)
VIR_ENUM_DECL(virDomainVsockModel)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 5018a13e9c..4ca54bdd20 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -441,6 +441,8 @@ virDomainMemoryFindByDef;
virDomainMemoryFindInactiveByDef;
virDomainMemoryInsert;
virDomainMemoryModelTypeToString;
+virDomainMemoryPersistenceTypeFromString;
+virDomainMemoryPersistenceTypeToString;
virDomainMemoryRemove;
virDomainMemorySourceTypeFromString;
virDomainMemorySourceTypeToString;
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
new file mode 100644
index 0000000000..a8c5198e9e
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
@@ -0,0 +1,58 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>1267710</memory>
+ <currentMemory unit='KiB'>1267710</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <idmap>
+ <uid start='0' target='1000' count='10'/>
+ <gid start='0' target='1000' count='10'/>
+ </idmap>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ <numa>
+ <cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ <memory model='nvdimm' access='private'>
+ <source>
+ <path>/tmp/nvdimm</path>
+ <alignsize unit='KiB'>2048</alignsize>
+ </source>
+ <target>
+ <size unit='KiB'>523264</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
new file mode 100644
index 0000000000..28f2b7fb53
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
@@ -0,0 +1,58 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>1267710</memory>
+ <currentMemory unit='KiB'>1267710</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <idmap>
+ <uid start='0' target='1000' count='10'/>
+ <gid start='0' target='1000' count='10'/>
+ </idmap>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ <numa>
+ <cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ <memory model='nvdimm' access='private'>
+ <source>
+ <path>/tmp/nvdimm</path>
+ </source>
+ <target>
+ <size unit='KiB'>523264</size>
+ <node>0</node>
+ <persistence>mem-ctrl</persistence>
+ </target>
+ <address type='dimm' slot='0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
new file mode 100644
index 0000000000..060d75c541
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
@@ -0,0 +1,58 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>1267710</memory>
+ <currentMemory unit='KiB'>1267710</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <idmap>
+ <uid start='0' target='1000' count='10'/>
+ <gid start='0' target='1000' count='10'/>
+ </idmap>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ <numa>
+ <cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ <memory model='nvdimm' access='private'>
+ <source>
+ <path>/tmp/nvdimm</path>
+ <pmem/>
+ </source>
+ <target>
+ <size unit='KiB'>523264</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
new file mode 100644
index 0000000000..7ddbb01560
--- /dev/null
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
@@ -0,0 +1,58 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+ <memory unit='KiB'>1267710</memory>
+ <currentMemory unit='KiB'>1267710</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <idmap>
+ <uid start='0' target='1000' count='10'/>
+ <gid start='0' target='1000' count='10'/>
+ </idmap>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ <numa>
+ <cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ <memory model='nvdimm' access='private'>
+ <source>
+ <path>/tmp/nvdimm</path>
+ </source>
+ <target>
+ <size unit='KiB'>523264</size>
+ <node>0</node>
+ <unarmed/>
+ </target>
+ <address type='dimm' slot='0'/>
+ </memory>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
new file mode 120000
index 0000000000..9fc600126c
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml
new file mode 120000
index 0000000000..0c0de1bc7f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml
new file mode 120000
index 0000000000..3e57c1ec97
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml
new file mode 120000
index 0000000000..179334769f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2527497675..1a97ec8e02 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1107,6 +1107,10 @@ mymain(void)
DO_TEST("memory-hotplug-nvdimm", NONE);
DO_TEST("memory-hotplug-nvdimm-access", NONE);
DO_TEST("memory-hotplug-nvdimm-label", NONE);
+ DO_TEST("memory-hotplug-nvdimm-align", NONE);
+ DO_TEST("memory-hotplug-nvdimm-pmem", NONE);
+ DO_TEST("memory-hotplug-nvdimm-persistence", NONE);
+ DO_TEST("memory-hotplug-nvdimm-unarmed", NONE);
DO_TEST("net-udp", NONE);
DO_TEST("video-virtio-gpu-device", NONE);
--
2.17.1
5 years, 12 months
[libvirt] [RFC v2 0/3] update NVDIMM support
by Luyao Zhong
Hi libvirt experts,
This is the RFC v2 for updating NVDIMM support in libvirt.
There are some gaps between qemu and libvirt, libvirt has not
supported several config options about NVDIMM memory while
qemu is ready now, including 'align', 'pmem', 'unarmed' and
'persistence'.
I have already reworded and recoded my patches according to some
feedback comments from community. Besides I keep all testcases divided,
since every option is independent.
Before you experts review, please let me clarify one point:
'persistence' option
I investigated this option, it is used to add platform-supported
features about NVDIMM data persistence to guest. I did not change
this part in this RFC v2, because I'm not sure where I should put
it in domain config xml file. What about in <features> elements?
Or kick it out of this patch set, because it seems like another type
option which is different from other three options here. I'd like
you give some suggestions.
Thank you in advance.
Regards,
Luyao Zhong
Luyao Zhong (3):
nvdimm: introduce more config elements into xml for NVDIMM memory
nvdimm: update qemu command-line generating for NVDIMM memory
nvdimm: update docs for introducing more NVDIMM configurations
docs/formatdomain.html.in | 94 ++++++++++++++++---
docs/news.xml | 9 ++
docs/schemas/domaincommon.rng | 31 +++++-
src/conf/domain_conf.c | 94 +++++++++++++++++--
src/conf/domain_conf.h | 14 +++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 17 ++++
src/qemu/qemu_capabilities.h | 5 +
src/qemu/qemu_command.c | 50 +++++++++-
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_hotplug.c | 2 +-
.../memory-hotplug-nvdimm-align.args | 31 ++++++
.../memory-hotplug-nvdimm-align.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-persistence.args | 31 ++++++
.../memory-hotplug-nvdimm-persistence.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-pmem.args | 31 ++++++
.../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++
.../memory-hotplug-nvdimm-unarmed.args | 31 ++++++
.../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++
tests/qemuxml2argvtest.c | 15 +++
.../memory-hotplug-nvdimm-align.xml | 1 +
.../memory-hotplug-nvdimm-persistence.xml | 1 +
.../memory-hotplug-nvdimm-pmem.xml | 1 +
.../memory-hotplug-nvdimm-unarmed.xml | 1 +
tests/qemuxml2xmltest.c | 4 +
25 files changed, 671 insertions(+), 29 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml
--
2.17.1
5 years, 12 months
[libvirt] [PATCH] openvswitch: Add new port VLAN mode "dot1q-tunnel"
by luzhipeng@uniudc.com
From: ZhiPeng Lu <luzhipeng(a)uniudc.com>
Signed-off-by: ZhiPeng Lu <luzhipeng(a)uniudc.com>
---
docs/formatnetwork.html.in | 13 +++++++------
docs/schemas/networkcommon.rng | 1 +
src/conf/netdev_vlan_conf.c | 2 +-
src/util/virnetdevopenvswitch.c | 5 +++++
src/util/virnetdevvlan.h | 1 +
5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 363a72b..de223e6 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -688,16 +688,17 @@
</p>
<p>
For network connections using Open vSwitch it is also possible
- to configure 'native-tagged' and 'native-untagged' VLAN modes
+ to configure 'native-tagged' and 'native-untagged' and
+ 'dot1q-tunnel' VLAN modes
<span class="since">Since 1.1.0.</span> This is done with the
optional <code>nativeMode</code> attribute on
the <code><tag></code> subelement: <code>nativeMode</code>
- may be set to 'tagged' or 'untagged'. The <code>id</code>
- attribute of the <code><tag></code> subelement
- containing <code>nativeMode</code> sets which VLAN is considered
- to be the "native" VLAN for this interface, and
+ may be set to 'tagged' or 'untagged' or 'dot1q-tunnel'.
+ The <code>id</code> attribute of the <code><tag></code>
+ subelement containing <code>nativeMode</code> sets which VLAN is
+ considered to be the "native" VLAN for this interface, and
the <code>nativeMode</code> attribute determines whether or not
- traffic for that VLAN will be tagged.
+ traffic for that VLAN will be tagged or QinQ.
</p>
<p>
<code><vlan></code> elements can also be specified in
diff --git a/docs/schemas/networkcommon.rng b/docs/schemas/networkcommon.rng
index 2699555..11c48ff 100644
--- a/docs/schemas/networkcommon.rng
+++ b/docs/schemas/networkcommon.rng
@@ -223,6 +223,7 @@
<choice>
<value>tagged</value>
<value>untagged</value>
+ <value>dot1q-tunnel</value>
</choice>
</attribute>
</optional>
diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c
index dff49c6..79710d9 100644
--- a/src/conf/netdev_vlan_conf.c
+++ b/src/conf/netdev_vlan_conf.c
@@ -29,7 +29,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
VIR_ENUM_IMPL(virNativeVlanMode, VIR_NATIVE_VLAN_MODE_LAST,
- "default", "tagged", "untagged")
+ "default", "tagged", "untagged", "dot1q-tunnel")
int
virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 8fe06fd..ba5e333 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -91,6 +91,11 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, virNetDevVlanPtr virtVlan)
virCommandAddArg(cmd, "vlan_mode=native-untagged");
virCommandAddArgFormat(cmd, "tag=%d", virtVlan->nativeTag);
break;
+ case VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL:
+ virCommandAddArg(cmd, "vlan_mode=dot1q-tunnel");
+ virCommandAddArg(cmd, "other_config:qinq-ethtype=802.1q");
+ virCommandAddArgFormat(cmd, "tag=%d", virtVlan->nativeTag);
+ break;
case VIR_NATIVE_VLAN_MODE_DEFAULT:
default:
break;
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index be85f59..0667f9d 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -29,6 +29,7 @@ typedef enum {
VIR_NATIVE_VLAN_MODE_DEFAULT = 0,
VIR_NATIVE_VLAN_MODE_TAGGED,
VIR_NATIVE_VLAN_MODE_UNTAGGED,
+ VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL,
VIR_NATIVE_VLAN_MODE_LAST
} virNativeVlanMode;
--
1.8.3.1
5 years, 12 months