From nobody Sun Apr 28 21:49: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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554127495165969.2738986936633; Mon, 1 Apr 2019 07:04:55 -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 C408E308FEC2; Mon, 1 Apr 2019 14:04:53 +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 9AEA95D9C5; Mon, 1 Apr 2019 14:04:53 +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 5B1C9180338C; Mon, 1 Apr 2019 14:04:53 +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 x31E4gWo026837 for ; Mon, 1 Apr 2019 10:04:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3142C5D70E; Mon, 1 Apr 2019 14:04:42 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 807175D71D for ; Mon, 1 Apr 2019 14:04:41 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 1 Apr 2019 16:04:33 +0200 Message-Id: <436388d7a9fd30554016d303b6a88a8823201eae.1554127340.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] qemuxml2argvdata: Drop useless spaces at the beginning of lines 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: , 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.49]); Mon, 01 Apr 2019 14:04:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There are three test XMLs that have useless spaces at the beginning of each line. I intend to add these to qemuxml2xmltest and make xmlout a symlink to the original XML. In order to do that the XMLs must look better than they do now. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- .../fd-memory-numa-topology2.xml | 62 ++++++++-------- .../fd-memory-numa-topology3.xml | 64 ++++++++--------- tests/qemuxml2argvdata/memfd-memory-numa.xml | 72 +++++++++---------- 3 files changed, 99 insertions(+), 99 deletions(-) diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml b/tests/qe= muxml2argvdata/fd-memory-numa-topology2.xml index 49beff188b..31f4567737 100644 --- a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml +++ b/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml @@ -1,31 +1,31 @@ - - instance-00000092 - 126f2720-6f8e-45ab-a886-ec9277079a67 - 14680064 - 14680064 - - - - - - 20 - - hvm - - - - - - - - - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - - + + instance-00000092 + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + + 20 + + hvm + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml b/tests/qe= muxml2argvdata/fd-memory-numa-topology3.xml index 7933507592..42d8a3bdad 100644 --- a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml +++ b/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml @@ -1,32 +1,32 @@ - - instance-00000092 - 126f2720-6f8e-45ab-a886-ec9277079a67 - 14680064 - 14680064 - - - - - - 32 - - hvm - - - - - - - - - - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - - + + instance-00000092 + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + + 32 + + hvm + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.xml b/tests/qemuxml2a= rgvdata/memfd-memory-numa.xml index 8416a990fa..41c1f9bfc2 100644 --- a/tests/qemuxml2argvdata/memfd-memory-numa.xml +++ b/tests/qemuxml2argvdata/memfd-memory-numa.xml @@ -1,36 +1,36 @@ - - instance-00000092 - 126f2720-6f8e-45ab-a886-ec9277079a67 - 14680064 - 14680064 - - - - - - - - - - - - 8 - - hvm - - - - - - - - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - - + + instance-00000092 + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + + + + + + + + 8 + + hvm + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 21:49: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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554127487188546.0319135855997; Mon, 1 Apr 2019 07:04:47 -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 5B67181E09; Mon, 1 Apr 2019 14:04:45 +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 350DF5D70E; Mon, 1 Apr 2019 14:04:45 +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 E41CC1803389; Mon, 1 Apr 2019 14:04:44 +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 x31E4hR4026846 for ; Mon, 1 Apr 2019 10:04:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A7D25D70E; Mon, 1 Apr 2019 14:04:43 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81B135D71A for ; Mon, 1 Apr 2019 14:04:42 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 1 Apr 2019 16:04:34 +0200 Message-Id: <19385bc130a08cf40f9257d189479a7d79f91244.1554127340.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] qemuxml2xmltest: Move virObjectUnref() call 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: , 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.25]); Mon, 01 Apr 2019 14:04:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The current location looks very arbitrary. Move it to the end of the mymain() function so it is less confusing. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tests/qemuxml2xmltest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 83a0d1cf7b..87336484d1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1158,8 +1158,6 @@ mymain(void) QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, QEMU_CAPS_VIRTIO_PCI_ATS); =20 - virObjectUnref(cfg); - DO_TEST("acpi-table", NONE); =20 DO_TEST("video-device-pciaddr-default", @@ -1297,6 +1295,7 @@ mymain(void) if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 + virObjectUnref(cfg); qemuTestDriverFree(&driver); VIR_FREE(fakerootdir); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 21:49: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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554127495786688.0072672725663; Mon, 1 Apr 2019 07:04:55 -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 9A0F2A6E00; Mon, 1 Apr 2019 14:04:54 +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 66C7D2B5A0; Mon, 1 Apr 2019 14:04:54 +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 219A118033A2; Mon, 1 Apr 2019 14:04:54 +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 x31E4hXY026857 for ; Mon, 1 Apr 2019 10:04:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id D60975D70E; Mon, 1 Apr 2019 14:04:43 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A43C5D71A for ; Mon, 1 Apr 2019 14:04:43 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 1 Apr 2019 16:04:35 +0200 Message-Id: <4b9f0c24fb4a770cb8d7366602f8c89283535fc0.1554127340.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] qemuxml2xmltest: Add memfd tests 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: , 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.38]); Mon, 01 Apr 2019 14:04:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Somehow, these were not tested. Use symlinks to point expected output back to the input. This way we can also fix some discrepancies in the input XMLs. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- .../fd-memory-no-numa-topology.xml | 14 +++++++++++--- .../fd-memory-numa-topology.xml | 12 ++++++++++-- .../fd-memory-numa-topology2.xml | 12 ++++++++++-- .../fd-memory-numa-topology3.xml | 12 ++++++++++-- .../memfd-memory-numa.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/memfd-memory-numa.xml | 18 +++++++++++++----- .../fd-memory-no-numa-topology.xml | 1 + .../fd-memory-numa-topology.xml | 1 + .../fd-memory-numa-topology2.xml | 1 + .../fd-memory-numa-topology3.xml | 1 + tests/qemuxml2xmloutdata/memfd-memory-numa.xml | 1 + tests/qemuxml2xmltest.c | 14 ++++++++++++++ 12 files changed, 74 insertions(+), 15 deletions(-) create mode 120000 tests/qemuxml2xmloutdata/fd-memory-no-numa-topology.xml create mode 120000 tests/qemuxml2xmloutdata/fd-memory-numa-topology.xml create mode 120000 tests/qemuxml2xmloutdata/fd-memory-numa-topology2.xml create mode 120000 tests/qemuxml2xmloutdata/fd-memory-numa-topology3.xml create mode 120000 tests/qemuxml2xmloutdata/memfd-memory-numa.xml diff --git a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml b/tests/= qemuxml2argvdata/fd-memory-no-numa-topology.xml index 243b65d36f..4c30761110 100644 --- a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml +++ b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml @@ -1,4 +1,4 @@ - + instance-00000092 126f2720-6f8e-45ab-a886-ec9277079a67 14680064 @@ -16,12 +16,20 @@ - + destroy restart destroy /usr/bin/qemu-system-x86_64 - + +
+ + + + + +
+ diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology.xml b/tests/qem= uxml2argvdata/fd-memory-numa-topology.xml index ca5402dbb0..f22a8e81f8 100644 --- a/tests/qemuxml2argvdata/fd-memory-numa-topology.xml +++ b/tests/qemuxml2argvdata/fd-memory-numa-topology.xml @@ -19,12 +19,20 @@ - + destroy restart destroy /usr/bin/qemu-system-x86_64 - + +
+ + + + + +
+ diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml b/tests/qe= muxml2argvdata/fd-memory-numa-topology2.xml index 31f4567737..925f39b6ab 100644 --- a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml +++ b/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml @@ -1,4 +1,4 @@ - + instance-00000092 126f2720-6f8e-45ab-a886-ec9277079a67 14680064 @@ -26,6 +26,14 @@ destroy /usr/bin/qemu-system-x86_64 - + +
+ + + + + +
+ diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml b/tests/qe= muxml2argvdata/fd-memory-numa-topology3.xml index 42d8a3bdad..71a8e083c9 100644 --- a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml +++ b/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml @@ -1,4 +1,4 @@ - + instance-00000092 126f2720-6f8e-45ab-a886-ec9277079a67 14680064 @@ -27,6 +27,14 @@ destroy /usr/bin/qemu-system-x86_64 - + +
+ + + + + +
+ diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/= tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args index ee425a737b..c582878a12 100644 --- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args +++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args @@ -31,7 +31,7 @@ share=3Dyes,size=3D15032385536,host-nodes=3D3,policy=3Dpr= eferred \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-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/qemuxml2argvdata/memfd-memory-numa.xml b/tests/qemuxml2a= rgvdata/memfd-memory-numa.xml index 41c1f9bfc2..f088f01d11 100644 --- a/tests/qemuxml2argvdata/memfd-memory-numa.xml +++ b/tests/qemuxml2argvdata/memfd-memory-numa.xml @@ -1,20 +1,20 @@ - + instance-00000092 126f2720-6f8e-45ab-a886-ec9277079a67 14680064 14680064 - + + 8 - + - 8 hvm @@ -31,6 +31,14 @@ destroy /usr/bin/qemu-system-x86_64 - + +
+ + + + + +
+ diff --git a/tests/qemuxml2xmloutdata/fd-memory-no-numa-topology.xml b/test= s/qemuxml2xmloutdata/fd-memory-no-numa-topology.xml new file mode 120000 index 0000000000..4a35465bd2 --- /dev/null +++ b/tests/qemuxml2xmloutdata/fd-memory-no-numa-topology.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/fd-memory-no-numa-topology.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/fd-memory-numa-topology.xml b/tests/q= emuxml2xmloutdata/fd-memory-numa-topology.xml new file mode 120000 index 0000000000..6ccadd7e24 --- /dev/null +++ b/tests/qemuxml2xmloutdata/fd-memory-numa-topology.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/fd-memory-numa-topology.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/fd-memory-numa-topology2.xml b/tests/= qemuxml2xmloutdata/fd-memory-numa-topology2.xml new file mode 120000 index 0000000000..9c5ab497de --- /dev/null +++ b/tests/qemuxml2xmloutdata/fd-memory-numa-topology2.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/fd-memory-numa-topology2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/fd-memory-numa-topology3.xml b/tests/= qemuxml2xmloutdata/fd-memory-numa-topology3.xml new file mode 120000 index 0000000000..40ae69bcb0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/fd-memory-numa-topology3.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/fd-memory-numa-topology3.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/memfd-memory-numa.xml b/tests/qemuxml= 2xmloutdata/memfd-memory-numa.xml new file mode 120000 index 0000000000..a610bf7a49 --- /dev/null +++ b/tests/qemuxml2xmloutdata/memfd-memory-numa.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/memfd-memory-numa.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 87336484d1..4b8b0db0c6 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1158,6 +1158,20 @@ mymain(void) QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, QEMU_CAPS_VIRTIO_PCI_ATS); =20 + DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_KVM); + DO_TEST("fd-memory-numa-topology2", QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_KVM); + DO_TEST("fd-memory-numa-topology3", QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_KVM); + + DO_TEST("fd-memory-no-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_KVM); + + DO_TEST("memfd-memory-numa", + QEMU_CAPS_OBJECT_MEMORY_MEMFD, + QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB); + DO_TEST("acpi-table", NONE); =20 DO_TEST("video-device-pciaddr-default", --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 21:49: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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554127501514736.3998809127467; Mon, 1 Apr 2019 07:05:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24E7CC0641E2; Mon, 1 Apr 2019 14:04:59 +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 E4ED227CB9; Mon, 1 Apr 2019 14:04: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 345A83FA49; Mon, 1 Apr 2019 14:04:58 +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 x31E4ktZ026872 for ; Mon, 1 Apr 2019 10:04:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92BC85D71D; Mon, 1 Apr 2019 14:04:46 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16A205D71A for ; Mon, 1 Apr 2019 14:04:44 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 1 Apr 2019 16:04:36 +0200 Message-Id: <5814dc5ddd3365b17f7d5302c26af790b922bcaf.1554127340.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] virfile: Introduce and use virFileGetDefaultHugepage 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: , 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 01 Apr 2019 14:05:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This helper returns the default hugetlbfs mount point from given array of mount points. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 1 + src/qemu/qemu_conf.c | 12 ++++-------- src/util/virfile.c | 25 +++++++++++++++++++++++++ src/util/virfile.h | 3 +++ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 73ef24d66f..d372997605 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1862,6 +1862,7 @@ virFileFindResourceFull; virFileFlock; virFileFreeACLs; virFileGetACLs; +virFileGetDefaultHugepage; virFileGetHugepageSize; virFileGetMountReverseSubtree; virFileGetMountSubtree; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 42122dcd97..41ce0a978d 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1914,16 +1914,12 @@ qemuGetDomainDefaultHugepath(const virDomainDef *de= f, virHugeTLBFSPtr hugetlbfs, size_t nhugetlbfs) { - size_t i; + virHugeTLBFSPtr p; =20 - for (i =3D 0; i < nhugetlbfs; i++) - if (hugetlbfs[i].deflt) - break; + if (!(p =3D virFileGetDefaultHugepage(hugetlbfs, nhugetlbfs))) + p =3D &hugetlbfs[0]; =20 - if (i =3D=3D nhugetlbfs) - i =3D 0; - - return qemuGetDomainHugepagePath(def, &hugetlbfs[i]); + return qemuGetDomainHugepagePath(def, p); } =20 =20 diff --git a/src/util/virfile.c b/src/util/virfile.c index ec8d85929c..9f1a965acb 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3735,6 +3735,31 @@ virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs ATTRIBU= TE_UNUSED, } #endif /* defined __linux__ */ =20 +/** + * virFileGetDefaultHugepage: + * @fs: array of hugetlbfs mount points + * @nfs: number of items in @fs + * + * In the passed array of hugetlbfs mount points @fs find the + * default one. It's the one which has no '-o pagesize'. + * + * Returns: default hugepage, or + * NULL if none found + */ +virHugeTLBFSPtr +virFileGetDefaultHugepage(virHugeTLBFSPtr fs, + size_t nfs) +{ + size_t i; + + for (i =3D 0; i < nfs; i++) { + if (fs[i].deflt) + return &fs[i]; + } + + return NULL; +} + int virFileIsSharedFS(const char *path) { return virFileIsSharedFSType(path, diff --git a/src/util/virfile.h b/src/util/virfile.h index 3dedb7666a..df35a32bcc 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -334,6 +334,9 @@ int virFileGetHugepageSize(const char *path, int virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs, size_t *ret_nfs); =20 +virHugeTLBFSPtr virFileGetDefaultHugepage(virHugeTLBFSPtr fs, + size_t nfs); + int virFileSetupDev(const char *path, const char *mount_options); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 21:49: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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554127511128977.2331876577101; Mon, 1 Apr 2019 07:05:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D4753087931; Mon, 1 Apr 2019 14:05:09 +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 EDAE65C3F8; Mon, 1 Apr 2019 14:05:08 +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 7D8723FA4C; Mon, 1 Apr 2019 14:05:08 +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 x31E4mt8026882 for ; Mon, 1 Apr 2019 10:04:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 82A075D71D; Mon, 1 Apr 2019 14:04:48 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0566D5D71A for ; Mon, 1 Apr 2019 14:04:46 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 1 Apr 2019 16:04:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] qemuBuildMemoryBackendProps: Get pagesize early 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: , 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 01 Apr 2019 14:05:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1693066 Up until memfd introduction (in 24b74d187ca) we did not need to know @pagesize because qemuGetDomainHupageMemPath() could deal with it being zero (value of zero means use the default hugetlbfs mount). But since for memfd we are not passing a path to hugetlbfs mount rather the page size value we need to know its value upfront. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 14 +++++++ ...memory-default-hugepage.x86_64-latest.args | 37 ++++++++++++++++ .../memfd-memory-default-hugepage.xml | 42 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../memfd-memory-default-hugepage.xml | 1 + tests/qemuxml2xmltest.c | 3 ++ 6 files changed, 98 insertions(+) create mode 100644 tests/qemuxml2argvdata/memfd-memory-default-hugepage.x8= 6_64-latest.args create mode 100644 tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml create mode 120000 tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.= xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f81d20e5f7..ba1b56c2da 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3547,6 +3547,20 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backend= Props, pagesize =3D 0; needHugepage =3D false; useHugepage =3D false; + } else if (pagesize =3D=3D 0) { + virHugeTLBFSPtr p; + + if (!cfg->nhugetlbfs) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("hugetlbfs filesystem is not mounted " + "or disabled by administrator config")); + goto cleanup; + } + + if (!(p =3D virFileGetDefaultHugepage(cfg->hugetlbfs, cfg->nhugetl= bfs))) + p =3D &cfg->hugetlbfs[0]; + + pagesize =3D p->size; } =20 if (!(props =3D virJSONValueNewObject())) diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-la= test.args b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-lat= est.args new file mode 100644 index 0000000000..c582878a12 --- /dev/null +++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.ar= gs @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-instance-00000092 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-instance-00000092/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-instance-00000092/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-instance-00000092/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dinstance-00000092,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-instance-00000092/master-key.aes \ +-machine pc-i440fx-wily,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 14336 \ +-mem-prealloc \ +-realtime mlock=3Doff \ +-smp 8,sockets=3D1,cores=3D8,threads=3D1 \ +-object memory-backend-memfd,id=3Dram-node0,hugetlb=3Dyes,hugetlbsize=3D20= 97152,\ +share=3Dyes,size=3D15032385536,host-nodes=3D3,policy=3Dpreferred \ +-numa node,nodeid=3D0,cpus=3D0-7,memdev=3Dram-node0 \ +-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ +-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 \ +-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/qemuxml2argvdata/memfd-memory-default-hugepage.xml b/tes= ts/qemuxml2argvdata/memfd-memory-default-hugepage.xml new file mode 100644 index 0000000000..45ff012711 --- /dev/null +++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml @@ -0,0 +1,42 @@ + + instance-00000092 + 126f2720-6f8e-45ab-a886-ec9277079a67 + 14680064 + 14680064 + + + + + + + 8 + + + + + hvm + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0c0dcae197..ae9b77eee6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3045,6 +3045,7 @@ mymain(void) QEMU_CAPS_KVM); =20 DO_TEST_CAPS_LATEST("memfd-memory-numa"); + DO_TEST_CAPS_LATEST("memfd-memory-default-hugepage"); =20 DO_TEST("cpu-check-none", QEMU_CAPS_KVM); DO_TEST("cpu-check-partial", QEMU_CAPS_KVM); diff --git a/tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml b/t= ests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml new file mode 120000 index 0000000000..27d38522c2 --- /dev/null +++ b/tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/memfd-memory-default-hugepage.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4b8b0db0c6..a17cbdb633 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1171,6 +1171,9 @@ mymain(void) DO_TEST("memfd-memory-numa", QEMU_CAPS_OBJECT_MEMORY_MEMFD, QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB); + DO_TEST("memfd-memory-default-hugepage", + QEMU_CAPS_OBJECT_MEMORY_MEMFD, + QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB); =20 DO_TEST("acpi-table", NONE); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list