From nobody Sun May 12 14:24:25 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153798311249021.78442549677152; Wed, 26 Sep 2018 10:31:52 -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 59B51308A94D; Wed, 26 Sep 2018 17:31:49 +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 202C1194A5; Wed, 26 Sep 2018 17:31:48 +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 A1D0F181A12E; Wed, 26 Sep 2018 17:31:44 +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 w8QHVhJq006413 for ; Wed, 26 Sep 2018 13:31:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0529360928; Wed, 26 Sep 2018 17:31:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF1BC60C17 for ; Wed, 26 Sep 2018 17:31:40 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (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 94C6236A5EE for ; Wed, 26 Sep 2018 17:31:38 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Wed, 26 Sep 2018 11:31:30 -0600 From: Jim Fehlig To: libvir-list@redhat.com Date: Wed, 26 Sep 2018 11:31:19 -0600 Message-Id: <20180926173119.3405-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 26 Sep 2018 17:31:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 26 Sep 2018 17:31:39 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: reintroduce tests for libxl's legacy nested setting 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 26 Sep 2018 17:31:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The preferred location for setting the nested CPU flag changed in Xen 4.10 and is advertised via the LIBXL_HAVE_BUILDINFO_NESTED_HVM define. Commit 95d19cd0 changed libxl to use the new preferred location but unconditionally changed the tests, causing 'make check' failures against Xen < 4.10 that do not contain the new location. Commit e94415d5 fixed the failures by only running the tests when LIBXL_HAVE_BUILDINFO_NESTED_HVM is defined. Since libvirt supports several versions of Xen that use the old nested location, it is prudent to test the flag is set correctly. This patch reintroduces the tests for the legacy location of the nested setting. Signed-off-by: Jim Fehlig Reviewed-by: Erik Skultety --- We could probably get by with one test for the old nested location, in which case I'd drop vnuma-hvm-legacy-nest. Any opinions on that? .../fullvirt-cpuid-legacy-nest.json | 60 ++++++ .../fullvirt-cpuid-legacy-nest.xml | 34 ++++ .../vnuma-hvm-legacy-nest.json | 178 ++++++++++++++++++ .../vnuma-hvm-legacy-nest.xml | 100 ++++++++++ tests/libxlxml2domconfigtest.c | 3 + 5 files changed, 375 insertions(+) diff --git a/tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.json b= /tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.json new file mode 100644 index 0000000000..cdc8b9867d --- /dev/null +++ b/tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.json @@ -0,0 +1,60 @@ +{ + "c_info": { + "type": "hvm", + "name": "XenGuest2", + "uuid": "c7a5fdb2-cdaf-9455-926a-d65c16db1809" + }, + "b_info": { + "max_vcpus": 1, + "avail_vcpus": [ + 0 + ], + "max_memkb": 592896, + "target_memkb": 403456, + "shadow_memkb": 5656, + "cpuid": [ + { + "leaf": 1, + "ecx": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0", + "edx": "xxxxxxxxxxxxxxxxxxxxxxxxxxx1xxxx" + } + ], + "sched_params": { + }, + "type.hvm": { + "pae": "True", + "apic": "True", + "acpi": "True", + "nested_hvm": "False", + "nographic": "True", + "vnc": { + "enable": "False" + }, + "sdl": { + "enable": "False" + }, + "spice": { + + }, + "boot": "c", + "rdm": { + + } + }, + "arch_arm": { + + } + }, + "disks": [ + { + "pdev_path": "/dev/HostVG/XenGuest2", + "vdev": "hda", + "backend": "phy", + "format": "raw", + "removable": 1, + "readwrite": 1 + } + ], + "on_reboot": "restart", + "on_crash": "restart" +} diff --git a/tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.xml b/= tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.xml new file mode 100644 index 0000000000..4f06db0714 --- /dev/null +++ b/tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.xml @@ -0,0 +1,34 @@ + + XenGuest2 + c7a5fdb2-cdaf-9455-926a-d65c16db1809 + 592896 + 403456 + 1 + + hvm + + + + + + + + + + + + + destroy + restart + restart + + + + + +
+ + + + + diff --git a/tests/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.json b/test= s/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.json new file mode 100644 index 0000000000..3b2fc5f40f --- /dev/null +++ b/tests/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.json @@ -0,0 +1,178 @@ +{ + "c_info": { + "type": "hvm", + "name": "test-hvm", + "uuid": "2147d599-9cc6-c0dc-92ab-4064b5446e9b" + }, + "b_info": { + "max_vcpus": 6, + "avail_vcpus": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "vnuma_nodes": [ + { + "memkb": 2097152, + "distances": [ + 10, + 21, + 31, + 41, + 51, + 61 + ], + "vcpus": [ + 0 + ] + }, + { + "memkb": 2097152, + "distances": [ + 21, + 10, + 21, + 31, + 41, + 51 + ], + "vcpus": [ + 1 + ] + }, + { + "memkb": 2097152, + "distances": [ + 31, + 21, + 10, + 21, + 31, + 41 + ], + "vcpus": [ + 2 + ] + }, + { + "memkb": 2097152, + "distances": [ + 41, + 31, + 21, + 10, + 21, + 31 + ], + "vcpus": [ + 3 + ] + }, + { + "memkb": 2097152, + "distances": [ + 51, + 41, + 31, + 21, + 10, + 21 + ], + "vcpus": [ + 4 + ] + }, + { + "memkb": 2097152, + "distances": [ + 61, + 51, + 41, + 31, + 21, + 10 + ], + "vcpus": [ + 5 + ] + } + ], + "max_memkb": 1048576, + "target_memkb": 1048576, + "video_memkb": 8192, + "shadow_memkb": 14336, + "device_model_version": "qemu_xen", + "device_model": "/bin/true", + "sched_params": { + + }, + "type.hvm": { + "pae": "True", + "apic": "True", + "acpi": "True", + "nested_hvm": "True", + "vga": { + "kind": "cirrus" + }, + "vnc": { + "enable": "True", + "listen": "0.0.0.0", + "findunused": "False" + }, + "sdl": { + "enable": "False" + }, + "spice": { + + }, + "boot": "c", + "rdm": { + + } + }, + "arch_arm": { + + } + }, + "disks": [ + { + "pdev_path": "/var/lib/xen/images/test-hvm.img", + "vdev": "hda", + "backend": "qdisk", + "format": "raw", + "removable": 1, + "readwrite": 1 + } + ], + "nics": [ + { + "devid": 0, + "mac": "00:16:3e:66:12:b4", + "bridge": "br0", + "script": "/etc/xen/scripts/vif-bridge", + "nictype": "vif_ioemu" + } + ], + "vfbs": [ + { + "devid": -1, + "vnc": { + "enable": "True", + "listen": "0.0.0.0", + "findunused": "False" + }, + "sdl": { + "enable": "False" + } + } + ], + "vkbs": [ + { + "devid": -1 + } + ], + "on_reboot": "restart" +} diff --git a/tests/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.xml b/tests= /libxlxml2domconfigdata/vnuma-hvm-legacy-nest.xml new file mode 100644 index 0000000000..6e265e31a9 --- /dev/null +++ b/tests/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.xml @@ -0,0 +1,100 @@ + + test-hvm + None + 2147d599-9cc6-c0dc-92ab-4064b5446e9b + 1048576 + 1048576 + 6 + destroy + restart + destroy + + + hvm + /usr/lib/xen/boot/hvmloader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /bin/true + + + + + + + + +