From nobody Fri Mar 29 06:33:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153974317618774.53752658489918; Tue, 16 Oct 2018 19:26:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EB2C7CBB6; Wed, 17 Oct 2018 02:26:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6029360490; Wed, 17 Oct 2018 02:26:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 294054CA94; Wed, 17 Oct 2018 02:26:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9H2NP67022739 for ; Tue, 16 Oct 2018 22:23:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 156D179B52; Wed, 17 Oct 2018 02:23:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C40371D5B for ; Wed, 17 Oct 2018 02:23:22 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AD33C058CB9 for ; Wed, 17 Oct 2018 02:23:21 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 19:23:21 -0700 Received: from zly-optiplex-9020.bj.intel.com ([10.238.135.151]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2018 19:23:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,389,1534834800"; d="scan'208";a="88901805" From: Luyao Zhong To: libvir-list@redhat.com Date: Wed, 17 Oct 2018 10:21:43 +0800 Message-Id: <1539742905-15644-2-git-send-email-luyao.zhong@intel.com> In-Reply-To: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> References: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:21 +0000 (UTC) for IP:'192.55.52.115' DOMAIN:'mga14.intel.com' HELO:'mga14.intel.com' FROM:'luyao.zhong@intel.com' RCPT:'' X-RedHat-Spam-Score: -5.001 (RCVD_IN_DNSWL_HI, SPF_PASS) 192.55.52.115 mga14.intel.com 192.55.52.115 mga14.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Luyao Zhong , Zhong@redhat.com Subject: [libvirt] [RFC 1/3] xml: introduce more config elements for NVDIMM memory X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Oct 2018 02:26:14 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In order to align with QEMU ,four more parameters about NVDIMM will be introduced into Libvirt xml. 1.alignsize The 'alignsize' option allows users to specify the 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 pagesize. For example, mmap a device DAX on NVDIMM maybe 2M-aligned. 2.pmem The 'pmem' option allows users to specify whether the backend storage of memory-backend-file is a real persistent memory that can be accessed in SNIA NVM Programming Model. If the vNVDIMM backend is in host persistent memory , and 'pmem' is 'on' and QEMU is built with libpmem, qemu will guarantee the persistence of its own writes to the vNVDIMM backend. 3.persistence The 'persistence' option allows users to set platform-supported features about NVDIMM data persistence of a guest. It has two values, 'mem-ctrl' means the platform supports flushing dirty data from the memory controller to the NVDIMMs in the event of power loss, 'cpu' means The platform supports flushing dirty data from the CPU cache to the NVDIMMs in the event of power loss, which contains what 'mem-ctrl' means. 4.unarmed The 'unarmed' option allows users to mark vNVDIMM read-only. Only one type of vNVDIMM backends can guarantee the guest write persistence, which is the device DAX on the real NVDIMM device (e.g., /dev/dax0.0). When using other types of backends, it's suggested to set 'unarmed' option to 'on', so the guest Linux NVDIMM driver will mark such vNVDIMM device as read-only. For more details, see https://github.com/qemu/qemu/blob/master/docs/nvdimm.txt Signed-off-by: Zhong,Luyao --- docs/formatdomain.html.in | 98 ++++++++++++++++++++++++++++++++++++---= ---- docs/schemas/domaincommon.rng | 31 ++++++++++++-- 2 files changed, 111 insertions(+), 18 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8189959..9dec984 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8258,6 +8258,8 @@ qemu-kvm -net nic,model=3D? /dev/null <memory model=3D'nvdimm'> <source> <path>/tmp/nvdimm</path> + <alignsize unit=3D'KiB'>2048</alignsize> + <pmem>on</pmem> </source> <target> <size unit=3D'KiB'>524288</size> @@ -8265,6 +8267,8 @@ qemu-kvm -net nic,model=3D? /dev/null <label> <size unit=3D'KiB'>128</size> </label> + <persistence>cpu</persistence> + <unarmed>on</unarmed> </target> </memory> </devices> @@ -8339,10 +8343,38 @@ qemu-kvm -net nic,model=3D? /dev/null =20

- For model nvdimm this element is mandatory and has a - single child element path that represents a path - in the host that backs the nvdimm module in the guest. + For model nvdimm this element is mandatory. The + mandatory child element path represents a path in + the host that backs the nvdimm module in the guest. If + nvdimm is provided, then the following optional + elements can be provided as well:

+ +
+
alignsize
+
+

+ 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 device DAX on NVDIMM maybe 2M-aligned. +

+
+ +
pmem
+
+

+ This element can be used to specify whether the backend stor= age + of memory-backend-file is a real persistent memory that can = be + accessed in SNIA NVM Programming Model. If the backend is a= real + persistence memory and pmem is set to 'on', QEM= U will + guarantee the persistence of its own writes to the vNVDIMM b= ackend, + but which can work well with libpmem support (QEMU configure= d with + --enable-libpmem). +

+
+
=20
target
@@ -8361,19 +8393,55 @@ qemu-kvm -net nic,model=3D? /dev/null NUMA nodes configured.

- For NVDIMM type devices one can optionally use - label and its subelement size - to configure the size of namespaces label storage - within the NVDIMM module. The size element - has usual meaning described - here. - For QEMU domains the following restrictions apply: + Besides, the following optional elements can be provided as well= for + NVDIMM type devices:

-
    -
  1. the minimum label size is 128KiB,
  2. -
  3. the remaining size (total-size - label-size) has to be align= ed to - 4KiB
  4. -
+ +
+
label
+
+

+ For NVDIMM type devices one can optionally use + label and its subelement size + to configure the size of namespaces label storage + within the NVDIMM module. The size element + has usual meaning described + here. + For QEMU domains the following restrictions apply: +

+
    +
  1. the minimum label size is 128KiB,
  2. +
  3. the remaining size (total-size - label-size) will be ali= gned to + 4KiB as default.
  4. +
+
+ +
persistence
+
+

+ The persistence element can be set to "mem-ctl"= or "cpu", + which indicate platform-supported features about NVDIMM data= persistence. + 'mem-ctrl' means the platform supports flushing dirty data f= rom the memory + controller to the NVDIMMs in the event of power loss, 'cpu' = means The platform + supports flushing dirty data from the CPU cache to the NVDIM= Ms in the event + of power loss, which contains what 'mem-ctrl' means. + ACPI 6.2 Errata A added support for a new Platform Capabilit= ies Structure + in NFIT, so the guest ACPI NFIT will be filled in according = to the persistence + option. +

+
+ +
unarmed
+
+

+ The unarmed element can be used to mark vNVDIMM= read-only + through setting unarmed flag in guest NFIT.Currently the onl= y vNVDIMM backend + can guarantee the guest write persistence is device DAX on L= inux, so it's + suggested to set unarmed to 'on' when using oth= er types of + backends. +

+
+
=20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 099a949..cca7869 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5353,9 +5353,21 @@ - - - + + + + + + + + + + + + + + + @@ -5379,6 +5391,19 @@ + + + + mem-ctrl + cpu + + + + + + + + --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 06:33:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1539743102569193.50027521625532; Tue, 16 Oct 2018 19:25:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84F8930832CA; Wed, 17 Oct 2018 02:25:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47B897F8E4; Wed, 17 Oct 2018 02:25:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DE5444BB79; Wed, 17 Oct 2018 02:24:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9H2NSYw022750 for ; Tue, 16 Oct 2018 22:23:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 596F6768DC; Wed, 17 Oct 2018 02:23:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CCB97F8F1 for ; Wed, 17 Oct 2018 02:23:28 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C708C0587CE for ; Wed, 17 Oct 2018 02:23:26 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 19:23:26 -0700 Received: from zly-optiplex-9020.bj.intel.com ([10.238.135.151]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2018 19:23:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,389,1534834800"; d="scan'208";a="88901813" From: Luyao Zhong To: libvir-list@redhat.com Date: Wed, 17 Oct 2018 10:21:44 +0800 Message-Id: <1539742905-15644-3-git-send-email-luyao.zhong@intel.com> In-Reply-To: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> References: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:26 +0000 (UTC) for IP:'192.55.52.115' DOMAIN:'mga14.intel.com' HELO:'mga14.intel.com' FROM:'luyao.zhong@intel.com' RCPT:'' X-RedHat-Spam-Score: -5.001 (RCVD_IN_DNSWL_HI, SPF_PASS) 192.55.52.115 mga14.intel.com 192.55.52.115 mga14.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Luyao Zhong , Zhong@redhat.com Subject: [libvirt] [RFC 2/3] xml: update xml parsing and formating about NVDIMM memory X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 17 Oct 2018 02:25:01 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Four new parameters were introduced into libvirt xml, including 'align', 'pmem', 'persistence' and 'unarmed', which are related to NVDIMM memory device. So we need parse and format the xml to save these configurations.Besides, more testcases related to these parameters were added to verify the xml2xml process. Signed-off-by: Zhong,Luyao --- src/conf/domain_conf.c | 115 +++++++++++++++++= ++-- src/conf/domain_conf.h | 14 +++ src/libvirt_private.syms | 2 + .../memory-hotplug-nvdimm-align.xml | 1 + .../memory-hotplug-nvdimm-persistence.xml | 1 + .../memory-hotplug-nvdimm-pmem.xml | 1 + .../memory-hotplug-nvdimm-unarmed.xml | 1 + tests/qemuxml2xmltest.c | 4 + 8 files changed, 132 insertions(+), 7 deletions(-) create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persiste= nce.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.= xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9911d56..1326116 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -932,6 +932,12 @@ VIR_ENUM_IMPL(virDomainMemoryModel, "dimm", "nvdimm") =20 +VIR_ENUM_IMPL(virDomainMemoryPersistence, + VIR_DOMAIN_MEMORY_PERSISTENCE_LAST, + "", + "mem-ctrl", + "cpu") + VIR_ENUM_IMPL(virDomainShmemModel, VIR_DOMAIN_SHMEM_MODEL_LAST, "ivshmem", "ivshmem-plain", @@ -15656,7 +15662,9 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, virDomainMemoryDefPtr def) { int ret =3D -1; + int val; char *nodemask =3D NULL; + char *ndPmem =3D NULL; xmlNodePtr save =3D ctxt->node; ctxt->node =3D node; =20 @@ -15685,6 +15693,21 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, _("path is required for model 'nvdimm'")); goto cleanup; } + + if (virDomainParseMemory("./alignsize", "./alignsize/@unit", ctxt, + &def->alignsize, false, false) < 0) + goto cleanup; + + if ((ndPmem =3D virXPathString("string(./pmem)", ctxt))) { + if ((val =3D virTristateSwitchTypeFromString(ndPmem)) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("Invalid value of nvdimm 'pmem': %s"), + ndPmem); + goto cleanup; + } + def->nvdimmPmem =3D val; + } + VIR_FREE(ndPmem); break; =20 case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -15696,6 +15719,7 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, =20 cleanup: VIR_FREE(nodemask); + VIR_FREE(ndPmem); ctxt->node =3D save; return ret; } @@ -15710,6 +15734,9 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node, xmlNodePtr save =3D ctxt->node; ctxt->node =3D node; int rv; + int val; + char *ndPrst =3D NULL; + char *ndUnarmed =3D NULL; =20 /* initialize to value which marks that the user didn't specify it */ def->targetNode =3D -1; @@ -15741,11 +15768,35 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node, _("label size must be smaller than NVDIMM size"= )); goto cleanup; } + + if ((ndPrst =3D virXPathString("string(./persistence)", ctxt))) { + if ((val =3D virDomainMemoryPersistenceTypeFromString(ndPrst)) = < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("Invalid value of nvdimm 'persistence': %s= "), + ndPrst); + goto cleanup; + } + def->nvdimmPersistence =3D val; + } + VIR_FREE(ndPrst); + + if ((ndUnarmed =3D virXPathString("string(./unarmed)", ctxt))) { + if ((val =3D virTristateSwitchTypeFromString(ndUnarmed)) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("Invalid value of nvdimm 'unarmed': %s"), + ndUnarmed); + goto cleanup; + } + def->nvdimmUnarmed =3D val; + } + VIR_FREE(ndUnarmed); } =20 ret =3D 0; =20 cleanup: + VIR_FREE(ndPrst); + VIR_FREE(ndUnarmed); ctxt->node =3D save; return ret; } @@ -22447,13 +22498,49 @@ virDomainMemoryDefCheckABIStability(virDomainMemo= ryDefPtr src, return false; } =20 - if (src->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - src->labelsize !=3D 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 =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM) { + if (src->labelsize !=3D dst->labelsize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NVDIMM label size '%llu' doesn't matc= h " + "source NVDIMM label size '%llu'"), + src->labelsize, dst->labelsize); + return false; + } + + if (src->alignsize !=3D dst->alignsize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NVDIMM alignment '%llu' doesn't match= " + "source NVDIMM alignment '%llu'"), + src->alignsize, dst->alignsize); + return false; + } + + if (src->nvdimmPmem !=3D dst->nvdimmPmem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NVDIMM pmem flag '%s' doesn't match " + "source NVDIMM pmem flag '%s'"), + virTristateSwitchTypeToString(src->nvdimmPmem), + virTristateSwitchTypeToString(dst->nvdimmPmem)); + return false; + } + + if (src->nvdimmPersistence !=3D dst->nvdimmPersistence) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NVDIMM persistence value '%s' doesn't= match " + "source NVDIMM persistence value '%s'"), + virDomainMemoryPersistenceTypeToString(src->nvd= immPersistence), + virDomainMemoryPersistenceTypeToString(dst->nvd= immPersistence)); + return false; + } + + if (src->nvdimmUnarmed !=3D dst->nvdimmUnarmed) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target NVDIMM unarmed flag '%s' doesn't matc= h " + "source NVDIMM unarmed flag '%s'"), + virTristateSwitchTypeToString(src->nvdimmUnarme= d), + virTristateSwitchTypeToString(dst->nvdimmUnarme= d)); + return false; + } } =20 return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info); @@ -25939,6 +26026,14 @@ virDomainMemorySourceDefFormat(virBufferPtr buf, =20 case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: virBufferEscapeString(buf, "%s\n", def->nvdimmPath); + + if (def->alignsize) + virBufferAsprintf(buf, "%llu\n", + def->alignsize); + + if (def->nvdimmPmem) + virBufferEscapeString(buf, "%s\n", + virTristateSwitchTypeToString(def->nvdim= mPmem)); break; =20 case VIR_DOMAIN_MEMORY_MODEL_NONE: @@ -25974,6 +26069,12 @@ virDomainMemoryTargetDefFormat(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); } + if (def->nvdimmPersistence) + virBufferEscapeString(buf, "%s\n", + virDomainMemoryPersistenceTypeToString(def->= nvdimmPersistence)); + if (def->nvdimmUnarmed) + virBufferEscapeString(buf, "%s\n", + virTristateSwitchTypeToString(def->nvdimmUna= rmed)); =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e30a4b2..057aaea 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2133,6 +2133,14 @@ typedef enum { VIR_DOMAIN_MEMORY_MODEL_LAST } virDomainMemoryModel; =20 +typedef enum { + VIR_DOMAIN_MEMORY_PERSISTENCE_NONE, + VIR_DOMAIN_MEMORY_PERSISTENCE_MEMCTRL, + VIR_DOMAIN_MEMORY_PERSISTENCE_CPU, + + VIR_DOMAIN_MEMORY_PERSISTENCE_LAST, +} virDomainMemoryPersistence; + struct _virDomainMemoryDef { virDomainMemoryAccess access; virTristateBool discard; @@ -2141,12 +2149,17 @@ struct _virDomainMemoryDef { virBitmapPtr sourceNodes; unsigned long long pagesize; /* kibibytes */ char *nvdimmPath; + unsigned long long alignsize; /* kibibytes; valid only for NVDIMM */ + int nvdimmPmem; /* enum virTristateSwitch; valid only for NVDIMM */ =20 /* target */ int model; /* virDomainMemoryModel */ int targetNode; unsigned long long size; /* kibibytes */ unsigned long long labelsize; /* kibibytes; valid only for NVDIMM */ + int nvdimmPersistence; /* enum virDomainMemoryPersistence; + valid only for NVDIMM*/ + int nvdimmUnarmed; /* enum virTristateSwitch; valid only for NVDIMM */ =20 virDomainDeviceInfo info; }; @@ -3448,6 +3461,7 @@ VIR_ENUM_DECL(virDomainTPMVersion) VIR_ENUM_DECL(virDomainMemoryModel) VIR_ENUM_DECL(virDomainMemoryBackingModel) VIR_ENUM_DECL(virDomainMemorySource) +VIR_ENUM_DECL(virDomainMemoryPersistence) VIR_ENUM_DECL(virDomainMemoryAllocation) VIR_ENUM_DECL(virDomainIOMMUModel) VIR_ENUM_DECL(virDomainVsockModel) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9236391..e925f7b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -436,6 +436,8 @@ virDomainMemoryFindByDef; virDomainMemoryFindInactiveByDef; virDomainMemoryInsert; virDomainMemoryModelTypeToString; +virDomainMemoryPersistenceTypeFromString; +virDomainMemoryPersistenceTypeToString; virDomainMemoryRemove; virDomainMemorySourceTypeFromString; virDomainMemorySourceTypeToString; diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml b/tes= ts/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/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml= b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml new file mode 120000 index 0000000..0c0de1b --- /dev/null +++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml b/test= s/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/t= ests/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 89640f6..4a931f2 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1089,6 +1089,10 @@ mymain(void) DO_TEST("memory-hotplug-nvdimm", NONE); DO_TEST("memory-hotplug-nvdimm-access", NONE); DO_TEST("memory-hotplug-nvdimm-label", NONE); + DO_TEST("memory-hotplug-nvdimm-align", NONE); + DO_TEST("memory-hotplug-nvdimm-pmem", NONE); + DO_TEST("memory-hotplug-nvdimm-persistence", NONE); + DO_TEST("memory-hotplug-nvdimm-unarmed", NONE); DO_TEST("net-udp", NONE); =20 DO_TEST("video-virtio-gpu-device", NONE); --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 06:33:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1539743115696612.5794076727698; Tue, 16 Oct 2018 19:25:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A0E512F8FD; Wed, 17 Oct 2018 02:25:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04E967BE49; Wed, 17 Oct 2018 02:25:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 88B7C4CAA0; Wed, 17 Oct 2018 02:25:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9H2Nkg2022771 for ; Tue, 16 Oct 2018 22:23:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB0191057041; Wed, 17 Oct 2018 02:23:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2557103BAB4 for ; Wed, 17 Oct 2018 02:23:40 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AB1E88313 for ; Wed, 17 Oct 2018 02:23:39 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 19:23:37 -0700 Received: from zly-optiplex-9020.bj.intel.com ([10.238.135.151]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2018 19:23:36 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,389,1534834800"; d="scan'208";a="88901826" From: Luyao Zhong To: libvir-list@redhat.com Date: Wed, 17 Oct 2018 10:21:45 +0800 Message-Id: <1539742905-15644-4-git-send-email-luyao.zhong@intel.com> In-Reply-To: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> References: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 17 Oct 2018 02:23:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 17 Oct 2018 02:23:39 +0000 (UTC) for IP:'134.134.136.100' DOMAIN:'mga07.intel.com' HELO:'mga07.intel.com' FROM:'luyao.zhong@intel.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 134.134.136.100 mga07.intel.com 134.134.136.100 mga07.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Luyao Zhong , Zhong@redhat.com Subject: [libvirt] [RFC 3/3] qemu: update qemu command-line generating for NVDIMM memory X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 17 Oct 2018 02:25:14 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" According to the result parsing from xml, add corresponding properties into QEMU command line, including 'align', 'pmem', 'persistence' and 'nvdimm-persistence'. And add testcases related to these properties. Signed-off-by: Zhong,Luyao --- src/qemu/qemu_command.c | 25 ++++++++++ .../memory-hotplug-nvdimm-align.args | 31 ++++++++++++ .../memory-hotplug-nvdimm-align.xml | 58 ++++++++++++++++++= ++++ .../memory-hotplug-nvdimm-persistence.args | 31 ++++++++++++ .../memory-hotplug-nvdimm-persistence.xml | 58 ++++++++++++++++++= ++++ .../memory-hotplug-nvdimm-pmem.args | 31 ++++++++++++ .../memory-hotplug-nvdimm-pmem.xml | 58 ++++++++++++++++++= ++++ .../memory-hotplug-nvdimm-unarmed.args | 31 ++++++++++++ .../memory-hotplug-nvdimm-unarmed.xml | 58 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 12 +++++ 10 files changed, 393 insertions(+) create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistenc= e.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistenc= e.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.ar= gs create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 887947d..466a466 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3319,6 +3319,22 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backend= Props, if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0) goto cleanup; =20 + if (mem->alignsize) { + if (virJSONValueObjectAdd(props, + "U:align", + mem->alignsize * 1024, + NULL) < 0) + goto cleanup; + } + + if (mem->nvdimmPmem) { + if (virJSONValueObjectAdd(props, + "s:pmem", + virTristateSwitchTypeToString(mem->nvdim= mPmem), + NULL) < 0) + goto cleanup; + } + if (mem->sourceNodes) { nodemask =3D mem->sourceNodes; } else { @@ -3480,6 +3496,10 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) if (mem->labelsize) virBufferAsprintf(&buf, "label-size=3D%llu,", mem->labelsize *= 1024); =20 + if (mem->nvdimmUnarmed) + virBufferAsprintf(&buf, "unarmed=3D%s,", + virTristateSwitchTypeToString(mem->nvdimmUna= rmed)); + virBufferAsprintf(&buf, "memdev=3Dmem%s,id=3D%s", mem->info.alias, mem->info.alias); =20 @@ -7256,6 +7276,11 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, goto cleanup; } virBufferAddLit(&buf, ",nvdimm=3Don"); + + if (def->mems[i]->nvdimmPersistence) { + virBufferAsprintf(&buf, ",nvdimm-persistence=3D%s", + virDomainMemoryPersistenceTypeToString(d= ef->mems[i]->nvdimmPersistence)); + } break; } } diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args b/test= s/qemuxml2argvdata/memory-hotplug-nvdimm-align.args new file mode 100644 index 0000000..432f622 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don \ +-m size=3D219136k,slots=3D16,maxmem=3D1099511627776k \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-numa node,nodeid=3D0,cpus=3D0-1,mem=3D214 \ +-object memory-backend-file,id=3Dmemnvdimm0,prealloc=3Dyes,mem-path=3D/tmp= /nvdimm,\ +share=3Dno,size=3D536870912,align=3D2097152 \ +-device nvdimm,node=3D0,memdev=3Dmemnvdimm0,id=3Dnvdimm0,slot=3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ +bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 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 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1099511627776 + 1267710 + 1267710 + 2 + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + /tmp/nvdimm + 2048 + + + 523264 + 0 + +
+ + + diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.args = b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.args new file mode 100644 index 0000000..8ff03e3 --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don,nvdimm= -persistence=3Dmem-ctrl \ +-m size=3D219136k,slots=3D16,maxmem=3D1099511627776k \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-numa node,nodeid=3D0,cpus=3D0-1,mem=3D214 \ +-object memory-backend-file,id=3Dmemnvdimm0,prealloc=3Dyes,mem-path=3D/tmp= /nvdimm,\ +share=3Dno,size=3D536870912 \ +-device nvdimm,node=3D0,memdev=3Dmemnvdimm0,id=3Dnvdimm0,slot=3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ +bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml b= /tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml new file mode 100644 index 0000000..28f2b7f --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml @@ -0,0 +1,58 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1099511627776 + 1267710 + 1267710 + 2 + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + /tmp/nvdimm + + + 523264 + 0 + mem-ctrl + +
+ + + diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args b/tests= /qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args new file mode 100644 index 0000000..d34ac5b --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don \ +-m size=3D219136k,slots=3D16,maxmem=3D1099511627776k \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-numa node,nodeid=3D0,cpus=3D0-1,mem=3D214 \ +-object memory-backend-file,id=3Dmemnvdimm0,prealloc=3Dyes,mem-path=3D/tmp= /nvdimm,\ +share=3Dno,size=3D536870912,pmem=3Don \ +-device nvdimm,node=3D0,memdev=3Dmemnvdimm0,id=3Dnvdimm0,slot=3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ +bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/= qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml new file mode 100644 index 0000000..b221ddb --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml @@ -0,0 +1,58 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1099511627776 + 1267710 + 1267710 + 2 + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + /tmp/nvdimm + on + + + 523264 + 0 + +
+ + + diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.args b/te= sts/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.args new file mode 100644 index 0000000..64dcc5a --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don \ +-m size=3D219136k,slots=3D16,maxmem=3D1099511627776k \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-numa node,nodeid=3D0,cpus=3D0-1,mem=3D214 \ +-object memory-backend-file,id=3Dmemnvdimm0,prealloc=3Dyes,mem-path=3D/tmp= /nvdimm,\ +share=3Dno,size=3D536870912 \ +-device nvdimm,node=3D0,unarmed=3Don,memdev=3Dmemnvdimm0,id=3Dnvdimm0,slot= =3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ +bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml b/tes= ts/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml new file mode 100644 index 0000000..f60abbf --- /dev/null +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml @@ -0,0 +1,58 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1099511627776 + 1267710 + 1267710 + 2 + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + /tmp/nvdimm + + + 523264 + 0 + on + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a7cde3e..05ffca5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2717,6 +2717,18 @@ mymain(void) 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("memory-hotplug-nvdimm-align", + QEMU_CAPS_DEVICE_NVDIMM, + QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); + DO_TEST("memory-hotplug-nvdimm-pmem", + QEMU_CAPS_DEVICE_NVDIMM, + QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); + DO_TEST("memory-hotplug-nvdimm-persistence", + QEMU_CAPS_DEVICE_NVDIMM, + QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); + DO_TEST("memory-hotplug-nvdimm-unarmed", + QEMU_CAPS_DEVICE_NVDIMM, + QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); =20 DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list