From nobody Tue Feb 10 01:20:04 2026 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 1545297361218745.0442856128112; Thu, 20 Dec 2018 01:16:01 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E09397F41D; Thu, 20 Dec 2018 09:15:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0F9E1019624; Thu, 20 Dec 2018 09:15:58 +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 52A2D181B9F6; Thu, 20 Dec 2018 09:15:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBK9FvZj030562 for ; Thu, 20 Dec 2018 04:15:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9F9A317F26; Thu, 20 Dec 2018 09:15:57 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 949F817AA8 for ; Thu, 20 Dec 2018 09:15:56 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 BDA9889ACA for ; Thu, 20 Dec 2018 09:15:55 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 01:15:55 -0800 Received: from zly-optiplex-9020.bj.intel.com ([10.238.135.151]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2018 01:15:54 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,376,1539673200"; d="scan'208";a="131518666" From: Luyao Zhong To: libvir-list@redhat.com Date: Thu, 20 Dec 2018 17:14:47 +0800 Message-Id: <1545297290-25463-9-git-send-email-luyao.zhong@intel.com> In-Reply-To: <1545297290-25463-1-git-send-email-luyao.zhong@intel.com> References: <1545297290-25463-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.26]); Thu, 20 Dec 2018 09:15:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 20 Dec 2018 09:15:56 +0000 (UTC) for IP:'134.134.136.20' DOMAIN:'mga02.intel.com' HELO:'mga02.intel.com' FROM:'luyao.zhong@intel.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 134.134.136.20 mga02.intel.com 134.134.136.20 mga02.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v5 08/11] nvdimm: qemu command-line generating for align property 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 20 Dec 2018 09:15:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" According to the result parsing from xml, add align property into QEMU command line: -object memory-backend-file,...[,align=3Dxxx] Signed-off-by: Luyao Zhong Reviewed-by: John Ferlan --- 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 *backend= Props, if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0) goto cleanup; =20 + if (mem->alignsize) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_A= LIGN)) { + 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 =3D mem->sourceNodes; } else { diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-late= st.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=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don \ +-m size=3D219136k,slots=3D16,maxmem=3D1099511627776k \ +-realtime mlock=3Doff \ +-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,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d419827..5d26781 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"); =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