From nobody Wed Feb 11 11:34:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488201854106707.5750402496773; Mon, 27 Feb 2017 05:24:14 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RDL8Ns009023; Mon, 27 Feb 2017 08:21:09 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1RDJsap027131 for ; Mon, 27 Feb 2017 08:19:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 75380660C0; Mon, 27 Feb 2017 13:19:54 +0000 (UTC) Received: from lisa.redhat.com (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id C22D22D655; Mon, 27 Feb 2017 13:19:53 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 27 Feb 2017 14:19:28 +0100 Message-Id: <9fcfbb52936617ed74975ae70cd038c621ca681b.1488201118.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/14] qemu: Implement @access for banks 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 11 +++++++-- src/qemu/qemu_command.h | 1 + src/qemu/qemu_hotplug.c | 2 +- .../qemuxml2argv-memory-hotplug-nvdimm-access.args | 26 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 2 ++ 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdi= mm-access.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 46a6ca9f0..287387055 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3090,6 +3090,7 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, * for default * @autoNodeset: fallback nodeset in case of automatic NUMA placement * @memPathReq: request memory-backend-file with specific mem-path + * @memAccessReq: specifically requested memAccess mode * @force: forcibly use one of the backends * * Creates a configuration object that represents memory backend of given = guest @@ -3122,6 +3123,7 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendPro= ps, virBitmapPtr userNodeset, virBitmapPtr autoNodeset, const char *memPathReq, + virDomainMemoryAccess memAccessReq, bool force) { virDomainHugePagePtr master_hugepage =3D NULL; @@ -3154,6 +3156,9 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendPro= ps, memAccess =3D virDomainNumaGetNodeMemoryAccessMode(def->numa, gues= tNode); } =20 + if (memAccessReq) + memAccess =3D memAccessReq; + if (virDomainNumatuneGetMode(def->numa, guestNode, &mode) < 0 && virDomainNumatuneGetMode(def->numa, -1, &mode) < 0) mode =3D VIR_DOMAIN_NUMATUNE_MEM_STRICT; @@ -3352,7 +3357,9 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def, =20 if ((rc =3D qemuBuildMemoryBackendStr(&props, &backendType, cfg, qemuC= aps, def, cell, memsize, 0, NULL, - auto_nodeset, NULL, false)) < 0) + auto_nodeset, NULL, + VIR_DOMAIN_MEMORY_ACCESS_DEFAULT, + false)) < 0) goto cleanup; =20 if (!(*backendStr =3D virQEMUBuildObjectCommandlineFromJSON(backendTyp= e, @@ -3394,7 +3401,7 @@ qemuBuildMemoryDimmBackendStr(virDomainMemoryDefPtr m= em, if (qemuBuildMemoryBackendStr(&props, &backendType, cfg, qemuCaps, def, mem->targetNode, mem->size, mem->pagesiz= e, mem->sourceNodes, auto_nodeset, mem->pat= h, - true) < 0) + mem->access, true) < 0) goto cleanup; =20 ret =3D virQEMUBuildObjectCommandlineFromJSON(backendType, alias, prop= s); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index e23930255..e32e1718d 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -135,6 +135,7 @@ int qemuBuildMemoryBackendStr(virJSONValuePtr *backendP= rops, virBitmapPtr userNodeset, virBitmapPtr autoNodeset, const char *memPath, + virDomainMemoryAccess memAccessReq, bool force); =20 char *qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 51b87804d..f2299f66e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2219,7 +2219,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, if (qemuBuildMemoryBackendStr(&props, &backendType, cfg, priv->qemuCap= s, vm->def, mem->targetNode, mem->size, mem->pagesize, mem->sourceNodes, NULL, - mem->path, true) < 0) + mem->path, mem->access, true) < 0) goto cleanup; =20 if (virDomainMemoryInsert(vm->def, mem) < 0) { diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-acce= ss.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.= args new file mode 100644 index 000000000..d398b2294 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,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,memdev=3Dmemnvdimm0,id=3Dnvdimm0,slot=3D0 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-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 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 05a51a389..97a2c55cd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2335,6 +2335,8 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("memory-hotplug-nvdimm", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_DEVI= CE_NVDIMM, QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); + DO_TEST("memory-hotplug-nvdimm-access", QEMU_CAPS_MACHINE_OPT, QEMU_CA= PS_DEVICE_NVDIMM, + QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_= MEMORY_FILE); =20 DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP, --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list