From nobody Mon Feb 9 14:14:17 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571412632; cv=none; d=zoho.com; s=zohoarc; b=iWyPHmvshEraBycpQuOcIyFRE6PhRx90TVQj/x59HKroPP+T6wJeEN1wc2Ybk0jIYj1DbkMmyFUfLuoiFI1x7D0Zk1KrcsDXTVYfexaW5piQ13zL8GPzIZIvsTWwWs2unMhN3AD/zUmv5XiXN07vhfx6O2xkbmuG3U7qzucSits= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571412632; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FJRkOUYXIEGCo9exQcb4LdBJLX+0CtRcbVCOIDjGIU8=; b=N2Fs3joAtskJujLvurhtqKfXVt+G7pkAJMO9AykFblokr8IS2uMUz8OhZkkAyQ04yL0THvUIPHD+IviKdYRjommlgknERkBUAHlQ+2rqd2iPoEqCJmVr1kjovXpU9bqEKYBvp41u4fJJpJt2tzLBFGMYgxKyEioQY41ORWV4vv4= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571412632871991.5961632913891; Fri, 18 Oct 2019 08:30:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF97A76521; Fri, 18 Oct 2019 15:30:30 +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 7DE6660BF4; Fri, 18 Oct 2019 15:30:30 +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 1D5354EE6A; Fri, 18 Oct 2019 15:30:30 +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 x9IFUMmc001378 for ; Fri, 18 Oct 2019 11:30:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 17DB45D721; Fri, 18 Oct 2019 15:30:22 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-116-193.phx2.redhat.com [10.3.116.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E465D772; Fri, 18 Oct 2019 15:30:21 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Fri, 18 Oct 2019 10:30:11 -0500 Message-Id: <20191018153017.4819-4-jjongsma@redhat.com> In-Reply-To: <20191018153017.4819-1-jjongsma@redhat.com> References: <20191018153017.4819-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: crobinso@redhat.com Subject: [libvirt] [PATCH v3 3/9] qemu: Set capabilities properly for 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 18 Oct 2019 15:30:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Several tests were not specifying the necessary qemu capabilities for what they were testing. Due to the way that the video devices are currently validated, this is not causing any problems. But a change to video device validation in a following patch would have exposed this issue and resulted in multiple test failures about the domain configuration not supporting particular video models. Signed-off-by: Jonathon Jongsma --- tests/qemuhotplugtest.c | 3 ++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 89 ++++++++++++++++++-------------- tests/securityselinuxlabeltest.c | 9 ++++ 4 files changed, 64 insertions(+), 38 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d3da08875a..3b5d006949 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -82,6 +82,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_DISK_WWN); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_QXL); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_VGA); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA); =20 if (qemuTestCapsCacheInsert(driver.qemuCapsCache, priv->qemuCaps) < 0) goto cleanup; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5212ce50bd..7c314050f6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2917,6 +2917,7 @@ mymain(void) DO_TEST("virtio-options", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_KEYB= OARD, QEMU_CAPS_VIRTIO_MOUSE, QEMU_CAPS_VIRTIO_TABLET, QEMU_CAPS_VIRTIO_INPUT_HOST, + QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VHOST_USER_GPU, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM, diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index b9364f942f..15db9d7de9 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -359,35 +359,37 @@ mymain(void) DO_TEST("disk-mirror-old", NONE); DO_TEST("disk-mirror", NONE); DO_TEST("disk-active-commit", NONE); - DO_TEST("graphics-listen-network", NONE); - DO_TEST("graphics-vnc", NONE); - DO_TEST("graphics-vnc-websocket", NONE); - DO_TEST("graphics-vnc-sasl", NONE); - DO_TEST("graphics-vnc-tls", NONE); - DO_TEST("graphics-vnc-no-listen-attr", NONE); - DO_TEST("graphics-vnc-remove-generated-socket", NONE); + DO_TEST("graphics-listen-network", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-websocket", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-sasl", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-tls", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-no-listen-attr", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-remove-generated-socket", QEMU_CAPS_DEVICE_CIRRU= S_VGA); cfg->vncAutoUnixSocket =3D true; - DO_TEST("graphics-vnc-auto-socket-cfg", NONE); + DO_TEST("graphics-vnc-auto-socket-cfg", QEMU_CAPS_DEVICE_CIRRUS_VGA); cfg->vncAutoUnixSocket =3D false; - DO_TEST("graphics-vnc-socket", NONE); - DO_TEST("graphics-vnc-auto-socket", NONE); + DO_TEST("graphics-vnc-socket", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-vnc-auto-socket", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("graphics-vnc-egl-headless", - QEMU_CAPS_EGL_HEADLESS); - - DO_TEST("graphics-sdl", NONE); - DO_TEST("graphics-sdl-fullscreen", NONE); - DO_TEST("graphics-spice", NONE); - DO_TEST("graphics-spice-compression", NONE); - DO_TEST("graphics-spice-qxl-vga", NONE); - DO_TEST("graphics-spice-socket", NONE); - DO_TEST("graphics-spice-auto-socket", NONE); + QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_EGL_HEADLESS); + + DO_TEST("graphics-sdl", QEMU_CAPS_DEVICE_VGA); + DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-spice", QEMU_CAPS_DEVICE_QXL); + DO_TEST("graphics-spice-compression", QEMU_CAPS_DEVICE_QXL); + DO_TEST("graphics-spice-qxl-vga", QEMU_CAPS_DEVICE_QXL); + DO_TEST("graphics-spice-socket", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-spice-auto-socket", QEMU_CAPS_DEVICE_CIRRUS_VGA); cfg->spiceAutoUnixSocket =3D true; - DO_TEST("graphics-spice-auto-socket-cfg", NONE); + DO_TEST("graphics-spice-auto-socket-cfg", QEMU_CAPS_DEVICE_CIRRUS_VGA); cfg->spiceAutoUnixSocket =3D false; DO_TEST("graphics-spice-egl-headless", + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_EGL_HEADLESS); =20 DO_TEST("graphics-egl-headless-rendernode", + QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_EGL_HEADLESS, QEMU_CAPS_EGL_HEADLESS_RENDERNODE); =20 @@ -419,15 +421,15 @@ mymain(void) DO_TEST("sound", NONE); DO_TEST("sound-device", NONE); DO_TEST("watchdog", NONE); - DO_TEST("net-bandwidth", NONE); - DO_TEST("net-bandwidth2", NONE); + DO_TEST("net-bandwidth", QEMU_CAPS_DEVICE_VGA); + DO_TEST("net-bandwidth2", QEMU_CAPS_DEVICE_VGA); DO_TEST("net-mtu", NONE); DO_TEST("net-coalesce", NONE); DO_TEST("net-many-models", NONE); =20 DO_TEST("serial-tcp-tlsx509-chardev", NONE); DO_TEST("serial-tcp-tlsx509-chardev-notls", NONE); - DO_TEST("serial-spiceport", NONE); + DO_TEST("serial-spiceport", QEMU_CAPS_DEVICE_QXL); DO_TEST("serial-spiceport-nospice", NONE); DO_TEST("console-compat", NONE); DO_TEST("console-compat2", NONE); @@ -457,7 +459,9 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_ZPCI); DO_TEST("hostdev-mdev-precreated", NONE); - DO_TEST("hostdev-mdev-display", QEMU_CAPS_VFIO_PCI_DISPLAY); + DO_TEST("hostdev-mdev-display", + QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_VFIO_PCI_DISPLAY); DO_TEST("pci-rom", NONE); DO_TEST("pci-rom-disabled", NONE); DO_TEST("pci-rom-disabled-invalid", NONE); @@ -497,7 +501,7 @@ mymain(void) DO_TEST("event_idx", NONE); DO_TEST("vhost_queues", NONE); DO_TEST("interface-driver", NONE); - DO_TEST("interface-server", NONE); + DO_TEST("interface-server", QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("virtio-lun", NONE); =20 DO_TEST("usb-none", NONE); @@ -545,7 +549,7 @@ mymain(void) DO_TEST("seclabel-dynamic-none", NONE); DO_TEST("seclabel-device-multiple", NONE); DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE, - ARG_QEMU_CAPS, NONE); + ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_CIRRUS_VGA, NONE); DO_TEST("numad-static-vcpu-no-numatune", NONE); =20 DO_TEST("disk-scsi-lun-passthrough-sgio", @@ -660,8 +664,8 @@ mymain(void) QEMU_CAPS_SCSI_LSI); DO_TEST("console-virtio", NONE); DO_TEST("serial-target-port-auto", NONE); - DO_TEST("graphics-listen-network2", NONE); - DO_TEST("graphics-spice-timeout", NONE); + DO_TEST("graphics-listen-network2", QEMU_CAPS_DEVICE_CIRRUS_VGA); + DO_TEST("graphics-spice-timeout", QEMU_CAPS_DEVICE_VGA); DO_TEST("numad-auto-vcpu-no-numatune", NONE); DO_TEST("numad-auto-memory-vcpu-no-cpuset-and-placement", NONE); DO_TEST("numad-auto-memory-vcpu-cpuset", NONE); @@ -690,7 +694,7 @@ mymain(void) DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("pci-autofill-addr", NONE); + DO_TEST("pci-autofill-addr", QEMU_CAPS_DEVICE_CIRRUS_VGA); =20 DO_TEST("q35", QEMU_CAPS_DEVICE_PCI_BRIDGE, @@ -1155,10 +1159,16 @@ mymain(void) DO_TEST("memory-hotplug-nvdimm-readonly", NONE); DO_TEST("net-udp", NONE); =20 - DO_TEST("video-virtio-gpu-device", NONE); - DO_TEST("video-virtio-gpu-virgl", NONE); - DO_TEST("video-virtio-gpu-spice-gl", NONE); - DO_TEST("video-virtio-gpu-sdl-gl", NONE); + DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU); + DO_TEST("video-virtio-gpu-virgl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_VIRTIO_GPU_VIRGL); + DO_TEST("video-virtio-gpu-spice-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_VIRTIO_GPU_VIRGL); + DO_TEST("video-virtio-gpu-sdl-gl", + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_VIRTIO_GPU_VIRGL); =20 DO_TEST("virtio-input", QEMU_CAPS_VIRTIO_KEYBOARD, @@ -1182,7 +1192,8 @@ mymain(void) QEMU_CAPS_OBJECT_RNG_RANDOM, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, - QEMU_CAPS_VIRTIO_PCI_ATS); + QEMU_CAPS_VIRTIO_PCI_ATS, + QEMU_CAPS_DEVICE_VHOST_USER_GPU); =20 DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_KVM); @@ -1208,9 +1219,9 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); - DO_TEST("video-qxl-heads", NONE); - DO_TEST("video-qxl-noheads", NONE); - DO_TEST("video-virtio-gpu-secondary", NONE); + DO_TEST("video-qxl-heads", QEMU_CAPS_DEVICE_QXL); + DO_TEST("video-qxl-noheads", QEMU_CAPS_DEVICE_QXL); + DO_TEST("video-virtio-gpu-secondary", QEMU_CAPS_DEVICE_VIRTIO_GPU); DO_TEST("video-virtio-gpu-ccw", QEMU_CAPS_CCW, QEMU_CAPS_DEVICE_VIRTIO_GPU, @@ -1257,7 +1268,9 @@ mymain(void) DO_TEST("pseries-cpu-exact", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); =20 - DO_TEST("user-aliases", QEMU_CAPS_QCOW2_LUKS); + DO_TEST("user-aliases", + QEMU_CAPS_DEVICE_CIRRUS_VGA, + QEMU_CAPS_QCOW2_LUKS); DO_TEST("input-virtio-ccw", QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_KEYBOARD, diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabelt= est.c index 6f9b5c0e70..eba5b0b6af 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -340,6 +340,7 @@ mymain(void) { int ret =3D 0; int rc =3D testUserXattrEnabled(); + g_autoptr(virQEMUCaps) qemuCaps =3D NULL; =20 if (rc < 0) return EXIT_FAILURE; @@ -357,6 +358,14 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; =20 + if (!(qemuCaps =3D virQEMUCapsNew())) + return EXIT_FAILURE; + + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA); + + if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps) < 0) + return EXIT_FAILURE; + #define DO_TEST_LABELING(name) \ if (virTestRun("Labelling " # name, testSELinuxLabeling, name) < 0) \ ret =3D -1; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list