[libvirt] [PATCH v4 00/11] update NVDIMM support

Hi libvirt experts, There are some gaps between qemu and libvirt, libvirt has not supported several config options about NVDIMM memory while qemu has now, including 'align', 'pmem', 'unarmed'. So these three options is introduced in this patch set. Regards, Luyao Zhong Luyao Zhong (11): nvdimm: introduce 'alignsize' element into xml for NVDIMM memory nvdimm: introduce 'pmem' element into xml for NVDIMM memory nvdimm: introduce 'unarmed' element into xml for NVDIMM memory qemu_capabilities: introduce QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN qemu_capabilities: introduce QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM qemu_capabilities: introduce QEMU_CAPS_DEVICE_NVDIMM_UNARMED nvdimm: use DO_TEST_CAPS_LATEST to do nvdimm qemuxml2argvdata test nvdimm: qemu command-line generating for align property nvdimm: qemu command-line generating for pmem property nvdimm: qemu command-line generating for unarmed property nvdimm: update news.xml docs/formatdomain.html.in | 80 +++++++++++++--- docs/news.xml | 9 ++ docs/schemas/domaincommon.rng | 23 ++++- src/conf/domain_conf.c | 57 ++++++++++-- src/conf/domain_conf.h | 3 + src/qemu/qemu_capabilities.c | 16 +++- src/qemu/qemu_capabilities.h | 5 + src/qemu/qemu_command.c | 44 ++++++++- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_hotplug.c | 2 +- .../caps_2.10.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 2 +- .../caps_2.11.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 2 +- tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 + .../caps_2.12.0.x86_64.replies | 78 ++++++++++------ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 3 +- .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 +- tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 + .../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 103 +++++++++++++++------ tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 4 +- tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 2 + .../qemucapabilitiesdata/caps_3.1.0.x86_64.replies | 102 ++++++++++++++------ tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 5 +- .../memory-hotplug-nvdimm-access.args | 31 ------- ...memory-hotplug-nvdimm-access.x86_64-latest.args | 36 +++++++ .../memory-hotplug-nvdimm-align.x86_64-latest.args | 36 +++++++ .../memory-hotplug-nvdimm-align.xml | 58 ++++++++++++ .../memory-hotplug-nvdimm-label.args | 31 ------- .../memory-hotplug-nvdimm-label.x86_64-latest.args | 36 +++++++ .../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 36 +++++++ .../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++ ...emory-hotplug-nvdimm-unarmed.x86_64-latest.args | 36 +++++++ .../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++ tests/qemuxml2argvdata/memory-hotplug-nvdimm.args | 31 ------- .../memory-hotplug-nvdimm.x86_64-latest.args | 36 +++++++ tests/qemuxml2argvtest.c | 15 ++- .../memory-hotplug-nvdimm-align.xml | 1 + .../memory-hotplug-nvdimm-pmem.xml | 1 + .../memory-hotplug-nvdimm-unarmed.xml | 1 + tests/qemuxml2xmltest.c | 3 + 53 files changed, 1047 insertions(+), 339 deletions(-) delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml -- 2.7.4

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 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> --- 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 428b0e8..74e02a4 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: </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 5.0.0</span> + </p> + </dd> + </dl> </dd> <dt><code>target</code></dt> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 5a6c48f..395a7ea 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -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> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d8dfd16..7e59d8c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15780,6 +15780,11 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, _("path is required for model 'nvdimm'")); goto cleanup; } + + if (virDomainParseMemory("./alignsize", "./alignsize/@unit", ctxt, + &def->alignsize, false, false) < 0) + goto cleanup; + break; case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -22735,13 +22740,22 @@ 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; + } } return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -26278,6 +26292,10 @@ 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); break; case VIR_DOMAIN_MEMORY_MODEL_NONE: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5814997..848bd94 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2147,6 +2147,7 @@ struct _virDomainMemoryDef { virBitmapPtr sourceNodes; unsigned long long pagesize; /* kibibytes */ char *nvdimmPath; + unsigned long long alignsize; /* kibibytes; valid only for NVDIMM */ /* target */ int model; /* virDomainMemoryModel */ diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml new file mode 100644 index 0000000..a8c5198 --- /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/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml new file mode 120000 index 0000000..9fc6001 --- /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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 1062dee..5161f4a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1116,6 +1116,7 @@ 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("net-udp", NONE); DO_TEST("video-virtio-gpu-device", NONE); -- 2.7.4

The 'pmem' option allows users to specify whether the backend storage of memory-backend-file is a real persistent memory: <devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> <pmem/> </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> --- docs/formatdomain.html.in | 12 +++++ docs/schemas/domaincommon.rng | 5 ++ src/conf/domain_conf.c | 13 +++++ src/conf/domain_conf.h | 1 + .../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++++++++++++ .../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 148 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 74e02a4..0f50da6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8323,6 +8323,7 @@ qemu-kvm -net nic,model=? /dev/null <source> <path>/tmp/nvdimm</path> <alignsize unit='KiB'>2048</alignsize> + <pmem/> </source> <target> <size unit='KiB'>524288</size> @@ -8423,6 +8424,17 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 5.0.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 5.0.0</span> + </p> + </dd> </dl> </dd> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 395a7ea..734589e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5393,6 +5393,11 @@ <ref name="scaledInteger"/> </element> </optional> + <optional> + <element name="pmem"> + <empty/> + </element> + </optional> </interleave> </group> </choice> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7e59d8c..9edaf6d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15785,6 +15785,9 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, &def->alignsize, false, false) < 0) goto cleanup; + if (virXPathBoolean("boolean(./pmem)", ctxt)) + def->nvdimmPmem = true; + break; case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -22756,6 +22759,13 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, src->alignsize, dst->alignsize); return false; } + + if (src->nvdimmPmem != dst->nvdimmPmem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target NVDIMM pmem flag doesn't match " + "source NVDIMM pmem flag")); + return false; + } } return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -26296,6 +26306,9 @@ virDomainMemorySourceDefFormat(virBufferPtr buf, 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: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 848bd94..a63afdc 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2148,6 +2148,7 @@ struct _virDomainMemoryDef { 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 */ diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml new file mode 100644 index 0000000..060d75c --- /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 0000000..7ddbb01 --- /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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5161f4a..ef3ece8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1117,6 +1117,7 @@ mymain(void) 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("net-udp", NONE); DO_TEST("video-virtio-gpu-device", NONE); -- 2.7.4

On Mon, Dec 17, 2018 at 05:26:12PM +0800, Luyao Zhong wrote:
The 'pmem' option allows users to specify whether the backend storage of memory-backend-file is a real persistent memory:
What does this actually do in practice ? Why does it matter and if it does, why can't libvirt set the right value automatically instad of needing the user to set the XML.
<devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> <pmem/> </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> --- docs/formatdomain.html.in | 12 +++++ docs/schemas/domaincommon.rng | 5 ++ src/conf/domain_conf.c | 13 +++++ src/conf/domain_conf.h | 1 + .../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++++++++++++ .../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 148 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 74e02a4..0f50da6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8323,6 +8323,7 @@ qemu-kvm -net nic,model=? /dev/null <source> <path>/tmp/nvdimm</path> <alignsize unit='KiB'>2048</alignsize> + <pmem/> </source> <target> <size unit='KiB'>524288</size> @@ -8423,6 +8424,17 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 5.0.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 5.0.0</span> + </p> + </dd> </dl> </dd>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 395a7ea..734589e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5393,6 +5393,11 @@ <ref name="scaledInteger"/> </element> </optional> + <optional> + <element name="pmem"> + <empty/> + </element> + </optional> </interleave> </group> </choice> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7e59d8c..9edaf6d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15785,6 +15785,9 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, &def->alignsize, false, false) < 0) goto cleanup;
+ if (virXPathBoolean("boolean(./pmem)", ctxt)) + def->nvdimmPmem = true; + break;
case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -22756,6 +22759,13 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, src->alignsize, dst->alignsize); return false; } + + if (src->nvdimmPmem != dst->nvdimmPmem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target NVDIMM pmem flag doesn't match " + "source NVDIMM pmem flag")); + return false; + } }
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -26296,6 +26306,9 @@ virDomainMemorySourceDefFormat(virBufferPtr buf, 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: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 848bd94..a63afdc 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2148,6 +2148,7 @@ struct _virDomainMemoryDef { 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 */ diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml new file mode 100644 index 0000000..060d75c --- /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 0000000..7ddbb01 --- /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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5161f4a..ef3ece8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1117,6 +1117,7 @@ mymain(void) 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("net-udp", NONE);
DO_TEST("video-virtio-gpu-device", NONE); -- 2.7.4
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 2018/12/17 下午7:05, Daniel P. Berrangé wrote:
On Mon, Dec 17, 2018 at 05:26:12PM +0800, Luyao Zhong wrote:
The 'pmem' option allows users to specify whether the backend storage of memory-backend-file is a real persistent memory:
What does this actually do in practice ? Why does it matter and if it does, why can't libvirt set the right value automatically instad of needing the user to set the XML.
When 'pmem' is 'on' and QEMU is built with libpmem [2] support (configured with --enable-libpmem), QEMU will take necessary operations to guarantee the persistence of its own writes to the vNVDIMM backend.If 'pmem' is 'on' while there is no libpmem support, qemu will exit and report a "lack of libpmem support" message to ensure the persistence is available. So user must have some knowledge about QEMU, also NVDIMM, then they can use this option correctly.
<devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> <pmem/> </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> --- docs/formatdomain.html.in | 12 +++++ docs/schemas/domaincommon.rng | 5 ++ src/conf/domain_conf.c | 13 +++++ src/conf/domain_conf.h | 1 + .../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++++++++++++ .../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 148 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 74e02a4..0f50da6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8323,6 +8323,7 @@ qemu-kvm -net nic,model=? /dev/null <source> <path>/tmp/nvdimm</path> <alignsize unit='KiB'>2048</alignsize> + <pmem/> </source> <target> <size unit='KiB'>524288</size> @@ -8423,6 +8424,17 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 5.0.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 5.0.0</span> + </p> + </dd> </dl> </dd>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 395a7ea..734589e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5393,6 +5393,11 @@ <ref name="scaledInteger"/> </element> </optional> + <optional> + <element name="pmem"> + <empty/> + </element> + </optional> </interleave> </group> </choice> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7e59d8c..9edaf6d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15785,6 +15785,9 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, &def->alignsize, false, false) < 0) goto cleanup;
+ if (virXPathBoolean("boolean(./pmem)", ctxt)) + def->nvdimmPmem = true; + break;
case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -22756,6 +22759,13 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, src->alignsize, dst->alignsize); return false; } + + if (src->nvdimmPmem != dst->nvdimmPmem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target NVDIMM pmem flag doesn't match " + "source NVDIMM pmem flag")); + return false; + } }
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -26296,6 +26306,9 @@ virDomainMemorySourceDefFormat(virBufferPtr buf, 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: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 848bd94..a63afdc 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2148,6 +2148,7 @@ struct _virDomainMemoryDef { 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 */ diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml new file mode 100644 index 0000000..060d75c --- /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 0000000..7ddbb01 --- /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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5161f4a..ef3ece8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1117,6 +1117,7 @@ mymain(void) 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("net-udp", NONE);
DO_TEST("video-virtio-gpu-device", NONE); -- 2.7.4
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Regards, Daniel
Thanks, Luyao

The 'unarmed' option allows users to mark vNVDIMM read-only: <devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> </source> <target> <size unit='MiB'>4094</size> <node>0</node> <label> <size unit='MiB'>2</size> </label> <unarmed/> </target> </memory> ... </devices> Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- docs/formatdomain.html.in | 45 ++++++++++++++++------ docs/schemas/domaincommon.rng | 5 +++ src/conf/domain_conf.c | 12 ++++++ src/conf/domain_conf.h | 1 + .../memory-hotplug-nvdimm-pmem.xml | 1 + .../memory-hotplug-nvdimm-unarmed.xml | 1 + tests/qemuxml2xmltest.c | 1 + 7 files changed, 54 insertions(+), 12 deletions(-) create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0f50da6..a8cf220 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8331,6 +8331,7 @@ qemu-kvm -net nic,model=? /dev/null <label> <size unit='KiB'>128</size> </label> + <unarmed/> </target> </memory> </devices> @@ -8454,19 +8455,39 @@ 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>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 5.0.0</span> + </p> + </dd> + </dl> </dd> </dl> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 734589e..de098a5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5422,6 +5422,11 @@ </element> </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 9edaf6d..ef7156d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15844,6 +15844,9 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node, _("label size must be smaller than NVDIMM size")); goto cleanup; } + + if (virXPathBoolean("boolean(./unarmed)", ctxt)) + def->nvdimmUnarmed = true; } ret = 0; @@ -22766,6 +22769,13 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, "source NVDIMM pmem flag")); return false; } + + if (src->nvdimmUnarmed != dst->nvdimmUnarmed) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target NVDIMM unarmed flag doesn't match " + "source NVDIMM unarmed flag")); + return false; + } } return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -26344,6 +26354,8 @@ virDomainMemoryTargetDefFormat(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "</label>\n"); } + 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 a63afdc..8538d89 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2155,6 +2155,7 @@ struct _virDomainMemoryDef { int targetNode; unsigned long long size; /* kibibytes */ unsigned long long labelsize; /* kibibytes; valid only for NVDIMM */ + bool nvdimmUnarmed; /* valid only for NVDIMM */ virDomainDeviceInfo info; }; diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml new file mode 120000 index 0000000..3e57c1e --- /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 0000000..1793347 --- /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 ef3ece8..493ce1d 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1118,6 +1118,7 @@ mymain(void) 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-unarmed", NONE); DO_TEST("net-udp", NONE); DO_TEST("video-virtio-gpu-device", NONE); -- 2.7.4

On Mon, Dec 17, 2018 at 05:26:13PM +0800, Luyao Zhong wrote:
The 'unarmed' option allows users to mark vNVDIMM read-only:
Why don't we call this element <readonly/> then ?
<devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> </source> <target> <size unit='MiB'>4094</size> <node>0</node> <label> <size unit='MiB'>2</size> </label> <unarmed/> </target> </memory> ... </devices>
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 2018/12/17 下午7:07, Daniel P. Berrangé wrote:
On Mon, Dec 17, 2018 at 05:26:13PM +0800, Luyao Zhong wrote:
The 'unarmed' option allows users to mark vNVDIMM read-only:
Why don't we call this element <readonly/> then ?
Just keep the same with QEMU, hah~ :)
<devices> ... <memory model='nvdimm' access='shared'> <source> <path>/dev/dax0.0</path> </source> <target> <size unit='MiB'>4094</size> <node>0</node> <label> <size unit='MiB'>2</size> </label> <unarmed/> </target> </memory> ... </devices>
Regards, Daniel
Thanks, Luyao

On Tue, Dec 18, 2018 at 09:50:40AM +0800, Luyao Zhong wrote:
On 2018/12/17 下午7:07, Daniel P. Berrangé wrote:
On Mon, Dec 17, 2018 at 05:26:13PM +0800, Luyao Zhong wrote:
The 'unarmed' option allows users to mark vNVDIMM read-only:
Why don't we call this element <readonly/> then ?
Just keep the same with QEMU, hah~ :)
Well lets call it 'readonly' in libvirt because 'unarmed' tells users nothing useful. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 12/20/2018 12:07 AM, Daniel P. Berrangé wrote:
On Tue, Dec 18, 2018 at 09:50:40AM +0800, Luyao Zhong wrote:
On 2018/12/17 下午7:07, Daniel P. Berrangé wrote:
On Mon, Dec 17, 2018 at 05:26:13PM +0800, Luyao Zhong wrote:
The 'unarmed' option allows users to mark vNVDIMM read-only:
Why don't we call this element <readonly/> then ?
Just keep the same with QEMU, hah~ :)
Well lets call it 'readonly' in libvirt because 'unarmed' tells users nothing useful.
Got it! I'll update in next version patch.
Regards, Daniel
Thank you for your comments. Regards, Luyao

This capability tracks if memory-backend-file has align attribute or not. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_capabilities.c | 4 +++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + 13 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bf98ff7..db368b7 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -514,7 +514,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "memory-backend-memfd.hugetlb", "iothread.poll-max-ns", "machine.pseries.cap-nested-hv", - "egl-headless.rendernode" + "egl-headless.rendernode", + "memory-backend-file.align", ); @@ -1365,6 +1366,7 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = { { "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD }, + { "align", QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1ed7639..9df4a87 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -499,6 +499,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_IOTHREAD_POLLING, /* -object iothread.poll-max-ns */ QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, /* -machine pseries.cap-nested-hv */ QEMU_CAPS_EGL_HEADLESS_RENDERNODE, /* -display egl-headless,rendernode= */ + QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN, /* -object memory-backend-file,align= */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml index 8dd90f5..186a6cc 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml @@ -165,6 +165,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>345725</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml index e646103..c47ebd7 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -163,6 +163,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>426509</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml index b18bd74..49249f5 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml @@ -132,6 +132,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>2012000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>375102</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index ac97e16..54c4a65 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -206,6 +206,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>414371</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml index f11d860..24a3c2b 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -163,6 +163,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>2012050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>444946</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml index 552b319..1b5d8e6 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml @@ -103,6 +103,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>0</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml index 4f9832d..3c76f63 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml @@ -103,6 +103,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>0</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml index 1c4177c..8569de6 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml @@ -134,6 +134,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>388416</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index b2d98a6..15df8a5 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -208,6 +208,7 @@ <flag name='memory-backend-memfd'/> <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> + <flag name='memory-backend-file.align'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>425972</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml index b06b173..48f4fdf 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -166,6 +166,7 @@ <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> <flag name='machine.pseries.cap-nested-hv'/> + <flag name='memory-backend-file.align'/> <version>3000091</version> <kvmVersion>0</kvmVersion> <microcodeVersion>437731</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 6c9c0c6..6be80ce 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -209,6 +209,7 @@ <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> <flag name='egl-headless.rendernode'/> + <flag name='memory-backend-file.align'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>440395</microcodeVersion> -- 2.7.4

This capability tracks if memory-backend-file has pmem attribute or not. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + 4 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index db368b7..e5ae4b6 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -516,6 +516,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.cap-nested-hv", "egl-headless.rendernode", "memory-backend-file.align", + + /* 325 */ + "memory-backend-file.pmem", ); @@ -1367,6 +1370,7 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = { { "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD }, { "align", QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN }, + { "pmem", QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 9df4a87..84c5404 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -501,6 +501,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_EGL_HEADLESS_RENDERNODE, /* -display egl-headless,rendernode= */ QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN, /* -object memory-backend-file,align= */ + /* 325 */ + QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM, /* -object memory-backend-file,pmem= */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml index 48f4fdf..175233a 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -167,6 +167,7 @@ <flag name='iothread.poll-max-ns'/> <flag name='machine.pseries.cap-nested-hv'/> <flag name='memory-backend-file.align'/> + <flag name='memory-backend-file.pmem'/> <version>3000091</version> <kvmVersion>0</kvmVersion> <microcodeVersion>437731</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 6be80ce..faafbcd 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -210,6 +210,7 @@ <flag name='iothread.poll-max-ns'/> <flag name='egl-headless.rendernode'/> <flag name='memory-backend-file.align'/> + <flag name='memory-backend-file.pmem'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>440395</microcodeVersion> -- 2.7.4

This capability tracks if nvdimm has unarmed attribute or not. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_capabilities.c | 8 ++ src/qemu/qemu_capabilities.h | 1 + .../caps_2.10.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 2 +- .../caps_2.11.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 2 +- .../caps_2.12.0.x86_64.replies | 78 ++++++++++------ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 46 ++++++--- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 62 ++++++++----- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 103 +++++++++++++++------ tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 3 +- .../qemucapabilitiesdata/caps_3.1.0.x86_64.replies | 102 ++++++++++++++------ tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 3 +- 20 files changed, 429 insertions(+), 207 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e5ae4b6..541cf22 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -519,6 +519,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 325 */ "memory-backend-file.pmem", + "nvdimm.unarmed", ); @@ -1242,6 +1243,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsMCH[] = { { "extended-tseg-mbytes", QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES }, }; +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsNVDIMM[] = { + { "unarmed", QEMU_CAPS_DEVICE_NVDIMM_UNARMED }, +}; + /* see documentation for virQEMUQAPISchemaPathGet for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, @@ -1365,6 +1370,9 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { { "mch", virQEMUCapsDevicePropsMCH, ARRAY_CARDINALITY(virQEMUCapsDevicePropsMCH), QEMU_CAPS_DEVICE_MCH }, + { "nvdimm", virQEMUCapsDevicePropsNVDIMM, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsNVDIMM), + QEMU_CAPS_DEVICE_NVDIMM }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 84c5404..6d5ed8a 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -503,6 +503,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 325 */ QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM, /* -object memory-backend-file,pmem= */ + QEMU_CAPS_DEVICE_NVDIMM_UNARMED, /* -device nvdimm,unarmed= */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies index 0f38573..783a40c 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies @@ -4552,13 +4552,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -4742,12 +4760,12 @@ "alias": "q35" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5082,36 +5100,36 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6390,12 +6408,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6445,12 +6463,12 @@ "capability": "return-path" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16173,7 +16191,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16184,7 +16202,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16363,7 +16381,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16544,7 +16562,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16787,7 +16805,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16801,7 +16819,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -16980,7 +16998,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17161,7 +17179,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -17404,7 +17422,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml index a8d787f..8ced5f3 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -195,7 +195,7 @@ <flag name='iothread.poll-max-ns'/> <version>2010000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>364386</microcodeVersion> + <microcodeVersion>364616</microcodeVersion> <package> (v2.10.0)</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies index c9a9a70..18a2628 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies @@ -4579,13 +4579,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -4769,12 +4787,12 @@ "cpu-max": 288 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5088,24 +5106,24 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5113,12 +5131,12 @@ "passthrough", "emulator" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6413,12 +6431,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6476,12 +6494,12 @@ "capability": "x-multifd" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16349,7 +16367,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16360,7 +16378,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16540,7 +16558,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16722,7 +16740,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16967,7 +16985,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16981,7 +16999,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17161,7 +17179,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17343,7 +17361,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -17588,7 +17606,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml index 4ba2a82..0a9eeec 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -201,7 +201,7 @@ <flag name='iothread.poll-max-ns'/> <version>2011000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>368875</microcodeVersion> + <microcodeVersion>369105</microcodeVersion> <package> (v2.11.0)</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies index 675b85b..7ba3efa 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4752,11 +4752,29 @@ } { + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4810,7 +4828,7 @@ "type": "string" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4818,7 +4836,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4868,7 +4886,7 @@ "type": "string" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4876,11 +4894,11 @@ "arguments": { "typename": "spapr-machine" }, - "id": "libvirt-37" + "id": "libvirt-38" } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Class 'spapr-machine' not found" @@ -4889,7 +4907,7 @@ { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5088,12 +5106,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5607,12 +5625,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5620,12 +5638,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -5633,12 +5651,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -6925,12 +6943,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -6992,12 +7010,12 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -18365,7 +18383,7 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -18376,7 +18394,7 @@ "name": "host" } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -18566,7 +18584,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -18758,7 +18776,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19013,7 +19031,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19027,7 +19045,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -19217,7 +19235,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -19409,7 +19427,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -19664,12 +19682,12 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { "execute": "query-sev-capabilities", - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -19679,7 +19697,7 @@ "cert-chain": "AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA", "pdh": "AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA" }, - "id": "libvirt-49" + "id": "libvirt-50" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index 54c4a65..b35206e 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -209,7 +209,7 @@ <flag name='memory-backend-file.align'/> <version>2011090</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>414371</microcodeVersion> + <microcodeVersion>414601</microcodeVersion> <package>v2.12.0-rc0</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies index 428903d..3ae433d 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3454,13 +3454,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "name": "pc-0.12", "cpu-max": 255 }, @@ -3568,12 +3586,12 @@ "cpu-max": 255 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -3663,36 +3681,36 @@ "name": "qemu64" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -4786,12 +4804,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -4825,12 +4843,12 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -12835,7 +12853,7 @@ "meta-type": "array" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml index 30a8e01..b711da5 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -165,7 +165,7 @@ <flag name='mch'/> <version>2006000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>228991</microcodeVersion> + <microcodeVersion>229221</microcodeVersion> <package></package> <arch>x86_64</arch> <cpu type='kvm' name='Opteron_G5'/> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies index c764174..8eda09d 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3640,13 +3640,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -3790,12 +3808,12 @@ "cpu-max": 255 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -3888,36 +3906,36 @@ "name": "qemu64" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5015,12 +5033,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5054,12 +5072,12 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -13415,7 +13433,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml index eda68e5..443de40 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -170,7 +170,7 @@ <flag name='mch'/> <version>2007000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>240497</microcodeVersion> + <microcodeVersion>240727</microcodeVersion> <package> (v2.7.0)</package> <arch>x86_64</arch> <cpu type='kvm' name='Opteron_G5'/> diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies index 33db454..ab48387 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies @@ -3782,13 +3782,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -3952,12 +3970,12 @@ "cpu-max": 255 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4163,36 +4181,36 @@ "static": false } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5315,12 +5333,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5358,12 +5376,12 @@ "capability": "x-colo" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -14133,7 +14151,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml index 627eb44..174678f 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -173,7 +173,7 @@ <flag name='mch'/> <version>2008000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>257152</microcodeVersion> + <microcodeVersion>257382</microcodeVersion> <package> (v2.8.0)</package> <arch>x86_64</arch> <cpu type='kvm' name='host' usable='yes'/> diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies index 1057028..3b5bcdb 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies @@ -4096,13 +4096,31 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, "id": "libvirt-35" } { "return": [ { + "name": "memdev", + "type": "link<memory-backend>" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -4276,12 +4294,12 @@ "cpu-max": 255 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4563,36 +4581,36 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5841,12 +5859,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5888,12 +5906,12 @@ "capability": "release-ram" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -15179,7 +15197,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -15190,7 +15208,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -15369,7 +15387,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -15550,7 +15568,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -15791,7 +15809,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -15805,7 +15823,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -15984,7 +16002,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -16165,7 +16183,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -16406,7 +16424,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml index 3c26b38..7f9e88f 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -189,7 +189,7 @@ <flag name='iothread.poll-max-ns'/> <version>2009000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>340375</microcodeVersion> + <microcodeVersion>340605</microcodeVersion> <package> (v2.9.0)</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies index f5bbe5c..16f021c 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies @@ -4868,11 +4868,54 @@ } { + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "slot", + "type": "int32" + }, + { + "name": "node", + "type": "uint32" + }, + { + "name": "size", + "type": "uint64" + }, + { + "name": "unarmed", + "type": "bool" + }, + { + "name": "label-size", + "type": "int" + }, + { + "name": "memdev", + "type": "link<memory-backend>" + }, + { + "name": "addr", + "type": "uint64" + } + ], + "id": "libvirt-35" +} + + +{ "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4922,7 +4965,7 @@ "type": "string" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4930,7 +4973,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4980,7 +5023,7 @@ "type": "string" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4988,11 +5031,11 @@ "arguments": { "typename": "spapr-machine" }, - "id": "libvirt-37" + "id": "libvirt-38" } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Class 'spapr-machine' not found" @@ -5001,7 +5044,7 @@ { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5210,12 +5253,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5652,12 +5695,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5665,12 +5708,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -5678,12 +5721,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -6982,12 +7025,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -7057,12 +7100,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -18942,7 +18985,7 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -18953,7 +18996,7 @@ "name": "host" } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19146,7 +19189,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19341,7 +19384,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19604,7 +19647,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19618,7 +19661,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -19811,7 +19854,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -20006,7 +20049,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20269,16 +20312,16 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { "execute": "query-sev-capabilities", - "id": "libvirt-49" + "id": "libvirt-50" } { - "id": "libvirt-49", + "id": "libvirt-50", "error": { "class": "GenericError", "desc": "SEV feature is not available" diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index 15df8a5..77d1f27 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -209,9 +209,10 @@ <flag name='memory-backend-memfd.hugetlb'/> <flag name='iothread.poll-max-ns'/> <flag name='memory-backend-file.align'/> + <flag name='nvdimm.unarmed'/> <version>3000000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>425972</microcodeVersion> + <microcodeVersion>426554</microcodeVersion> <package>v3.0.0</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies index 5acae22..8c537cc 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies @@ -4914,11 +4914,53 @@ } { + "execute": "device-list-properties", + "arguments": { + "typename": "nvdimm" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "slot", + "type": "int32" + }, + { + "name": "node", + "type": "uint32" + }, + { + "name": "size", + "type": "uint64" + }, + { + "name": "unarmed", + "type": "bool" + }, + { + "name": "label-size", + "type": "int" + }, + { + "name": "memdev", + "type": "link<memory-backend>" + }, + { + "name": "addr", + "type": "uint64" + } + ], + "id": "libvirt-35" +} + +{ "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4979,7 +5021,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4987,7 +5029,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5047,7 +5089,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5055,11 +5097,11 @@ "arguments": { "typename": "spapr-machine" }, - "id": "libvirt-37" + "id": "libvirt-38" } { - "id": "libvirt-37", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Class 'spapr-machine' not found" @@ -5068,7 +5110,7 @@ { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5287,12 +5329,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5811,12 +5853,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5824,12 +5866,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -5837,12 +5879,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -7116,12 +7158,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -7191,12 +7233,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -19381,7 +19423,7 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -19392,7 +19434,7 @@ "name": "host" } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19594,7 +19636,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19798,7 +19840,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20073,7 +20115,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20087,7 +20129,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -20289,7 +20331,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -20493,7 +20535,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20768,16 +20810,16 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { "execute": "query-sev-capabilities", - "id": "libvirt-49" + "id": "libvirt-50" } { - "id": "libvirt-49", + "id": "libvirt-50", "error": { "class": "GenericError", "desc": "SEV feature is not available" diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index faafbcd..58395cf 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -211,9 +211,10 @@ <flag name='egl-headless.rendernode'/> <flag name='memory-backend-file.align'/> <flag name='memory-backend-file.pmem'/> + <flag name='nvdimm.unarmed'/> <version>3000092</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>440395</microcodeVersion> + <microcodeVersion>440976</microcodeVersion> <package>v3.1.0-rc2-48-g039d4e3df0</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> -- 2.7.4

Depracate DO_TEST to do nvdimm qemuxml2argvdata tests, because DO_TEST_CAPS_LATEST is a better choice. the DO_TEST need to specify all qemu capabilities and is not easy for scaling. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- .../memory-hotplug-nvdimm-access.args | 31 ------------------- ...memory-hotplug-nvdimm-access.x86_64-latest.args | 36 ++++++++++++++++++++++ .../memory-hotplug-nvdimm-label.args | 31 ------------------- .../memory-hotplug-nvdimm-label.x86_64-latest.args | 36 ++++++++++++++++++++++ tests/qemuxml2argvdata/memory-hotplug-nvdimm.args | 31 ------------------- .../memory-hotplug-nvdimm.x86_64-latest.args | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 12 ++------ 7 files changed, 111 insertions(+), 102 deletions(-) delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.args deleted file mode 100644 index eecd8ca..0000000 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.args +++ /dev/null @@ -1,31 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=none \ -/usr/bin/qemu-system-i686 \ --name QEMUGuest1 \ --S \ --machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ --m size=219136k,slots=16,maxmem=1099511627776k \ --smp 2,sockets=2,cores=1,threads=1 \ --numa node,nodeid=0,cpus=0-1,mem=214 \ --object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ -share=no,size=536870912 \ --device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -server,nowait \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --no-acpi \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ --device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\ -bootindex=1 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args new file mode 100644 index 0000000..f11de69 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=219136k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=214 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +share=no,size=536870912 \ +-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.args deleted file mode 100644 index 199c57d..0000000 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.args +++ /dev/null @@ -1,31 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=none \ -/usr/bin/qemu-system-i686 \ --name QEMUGuest1 \ --S \ --machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ --m size=219136k,slots=16,maxmem=1099511627776k \ --smp 2,sockets=2,cores=1,threads=1 \ --numa node,nodeid=0,cpus=0-1,mem=214 \ --object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ -share=no,size=536870912 \ --device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -server,nowait \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --no-acpi \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ --device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\ -bootindex=1 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args new file mode 100644 index 0000000..6c224b9 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=219136k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=214 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +share=no,size=536870912 \ +-device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.args deleted file mode 100644 index f695a2b..0000000 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.args +++ /dev/null @@ -1,31 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=none \ -/usr/bin/qemu-system-i686 \ --name QEMUGuest1 \ --S \ --machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ --m size=1048576k,slots=16,maxmem=1099511627776k \ --smp 2,sockets=2,cores=1,threads=1 \ --numa node,nodeid=0,cpus=0-1,mem=1024 \ --object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ -size=536870912 \ --device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -server,nowait \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --no-acpi \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ --device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\ -bootindex=1 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args new file mode 100644 index 0000000..6309250 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=1048576k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=1024 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +size=536870912 \ +-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 287e9d4..09bd887 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2755,15 +2755,9 @@ mymain(void) DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("memory-hotplug-nvdimm", - QEMU_CAPS_DEVICE_NVDIMM, - QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("memory-hotplug-nvdimm-access", - QEMU_CAPS_DEVICE_NVDIMM, - QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("memory-hotplug-nvdimm-label", - QEMU_CAPS_DEVICE_NVDIMM, - QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm"); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access"); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-label"); DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, -- 2.7.4

According to the result parsing from xml, add align property into QEMU command line. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_command.c | 14 +++++++++ .../memory-hotplug-nvdimm-align.x86_64-latest.args | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 51 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 66a4a35..eeb49de 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3398,6 +3398,20 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0) goto cleanup; + if (mem->alignsize) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("align property is not available " + "with this QEMU binary")); + goto cleanup; + } + if (virJSONValueObjectAdd(props, + "U:align", + mem->alignsize * 1024, + NULL) < 0) + goto cleanup; + } + if (mem->sourceNodes) { nodemask = mem->sourceNodes; } else { diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args new file mode 100644 index 0000000..7017719 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=219136k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=214 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +share=no,size=536870912,align=2097152 \ +-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 09bd887..f0e9e8f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2758,6 +2758,7 @@ mymain(void) DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-label"); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-align"); DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, -- 2.7.4

According to the result parsing from xml, add pmem property into QEMU command line. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_command.c | 14 +++++++++ .../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 51 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index eeb49de..6a06161 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3412,6 +3412,20 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, goto cleanup; } + if (mem->nvdimmPmem) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("pmem property is not available " + "with this QEMU binary")); + goto cleanup; + } + if (virJSONValueObjectAdd(props, + "s:pmem", + mem->nvdimmPmem ? "on" : "off", + NULL) < 0) + goto cleanup; + } + if (mem->sourceNodes) { nodemask = mem->sourceNodes; } else { diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args new file mode 100644 index 0000000..9d0ecfc --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=219136k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=214 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +share=no,size=536870912,pmem=on \ +-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f0e9e8f..b1a0c0b 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2759,6 +2759,7 @@ mymain(void) DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-label"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-align"); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-pmem"); DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, -- 2.7.4

According to the result parsing from xml, add unarmed property into QEMU command line. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- src/qemu/qemu_command.c | 16 ++++++++-- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_hotplug.c | 2 +- ...emory-hotplug-nvdimm-unarmed.x86_64-latest.args | 36 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.x86_64-latest.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6a06161..c60b097 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3567,7 +3567,8 @@ qemuBuildMemoryDimmBackendStr(virBufferPtr buf, char * -qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) +qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem, + qemuDomainObjPrivatePtr priv) { virBuffer buf = VIR_BUFFER_INITIALIZER; const char *device; @@ -3595,6 +3596,17 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) if (mem->labelsize) virBufferAsprintf(&buf, "label-size=%llu,", mem->labelsize * 1024); + if (mem->nvdimmUnarmed) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_NVDIMM_UNARMED)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("unarmed property is not available " + "with this QEMU binary")); + return NULL; + } + virBufferAsprintf(&buf, "unarmed=%s,", + mem->nvdimmUnarmed ? "on" : "off"); + } + virBufferAsprintf(&buf, "memdev=mem%s,id=%s", mem->info.alias, mem->info.alias); @@ -7894,7 +7906,7 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-object"); virCommandAddArgBuffer(cmd, &buf); - if (!(dimmStr = qemuBuildMemoryDeviceStr(def->mems[i]))) + if (!(dimmStr = qemuBuildMemoryDeviceStr(def->mems[i], priv))) return -1; virCommandAddArgList(cmd, "-device", dimmStr, NULL); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 4647260..1a4f1f5 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -128,7 +128,8 @@ int qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, virDomainMemoryDefPtr mem, bool force); -char *qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem); +char *qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem, + qemuDomainObjPrivatePtr priv); /* Current, best practice */ char *qemuBuildPCIHostdevDevStr(const virDomainDef *def, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8da0233..a1c3ca9 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2563,7 +2563,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, if (virAsprintf(&objalias, "mem%s", mem->info.alias) < 0) goto cleanup; - if (!(devstr = qemuBuildMemoryDeviceStr(mem))) + if (!(devstr = qemuBuildMemoryDeviceStr(mem, priv))) goto cleanup; if (qemuBuildMemoryBackendProps(&props, objalias, cfg, diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.x86_64-latest.args new file mode 100644 index 0000000..783d16b --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \ +-m size=219136k,slots=16,maxmem=1099511627776k \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0-1,mem=214 \ +-object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\ +share=no,size=536870912 \ +-device nvdimm,node=0,unarmed=on,memdev=memnvdimm0,id=nvdimm0,slot=0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b1a0c0b..bd30c25 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2760,6 +2760,7 @@ mymain(void) DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-label"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-align"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-pmem"); + DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-unarmed"); DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, -- 2.7.4

add more configure options for NVDIMM Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 5bdbd34..dde98a1 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -65,6 +65,15 @@ qemu: Add support for ARMv6l guests </summary> </change> + <change> + <summary> + NVDIMM: support more configurations + </summary> + <description> + Introduce more configuration options, including 'alignsize', 'pmem', + 'unarmed'. + </description> + </change> </section> <section title="Bug fixes"> </section> -- 2.7.4
participants (3)
-
Daniel P. Berrangé
-
Luyao Zhong
-
Zhong, Luyao