From nobody Sat Nov 23 18:47:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=szczek.dev ARC-Seal: i=1; a=rsa-sha256; t=1723454071; cv=none; d=zohomail.com; s=zohoarc; b=Cc+UllbDR4DDSdNMFuiFbntqqZdm7Rnlti/D3F8IfbxoMRby0XG1NeTz2LduIg27tU4GZFC++vN1jaKZMQOjunJwy97vNXlGB1eI7O3h0FSS111JlbG6kX/DWJ6+Yc+6VPrBd8loOgn4yyqJRZv19y7ukcylcoR3YurmqcszsMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723454071; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=HnfLejkdtYBcy+ODUka1EO4TVWupXQ2kqO49Sj5cuF4=; b=OEYiEVWo+CHFq0b/GHlTUNdAj2mBdxFJT4PaB4iFcG84haCoxnH3qot+029t+HhcivnJXghDIEqPUi06qXeCAXdIQYXWXWDmsa1t4p5U4A2EzCwJJz13bfQ2lHjpCPPv4SpeFsujVPt0VUAVyp488xhkwYphkKixV12ecaEN8pQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 172345407177436.010562551571184; Mon, 12 Aug 2024 02:14:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B303015AC; Mon, 12 Aug 2024 05:14:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 0A39C15E8; Mon, 12 Aug 2024 05:09:06 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 306FA13E9; Sun, 11 Aug 2024 12:58:30 -0400 (EDT) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 23D7713C8 for ; Sun, 11 Aug 2024 12:58:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szczek.dev; s=protonmail3; t=1723395507; x=1723654707; bh=HnfLejkdtYBcy+ODUka1EO4TVWupXQ2kqO49Sj5cuF4=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=k56R0LXJREEM4GXD6cl/XF9wraQH8jw904slUQb6XZWz+P7DmYEQQjZpV4etAaiv9 IdnHLkyP7yUdaBp5KYVuV761NJqq/PMRIVg5EMo8CGA4SchpkD+bzRGkMhzuO9Pfi5 GmVlYRHCj6ddpCf/QTRaBKOe4OcuMzUF4U/E5dUsJpCTHmziv9R4lI20+ZTLfZC41p eo9uf02gEV6i+GfRzeRp8rSIKXBmXtkWLKLb5k4kJGs08nE0Eqm13X3OtUMZIH8AQl 6ozIeo18RFpBsoH4WOl5/pR6a8h1SHa6h1NtcmUAm02jA9nIa3aWBu34gyOEQ8vT7j YaCxqb496tbDQ== Date: Sun, 11 Aug 2024 16:58:22 +0000 To: "devel@lists.libvirt.org" From: =?utf-8?Q?Kamil_Szcz=C4=99k?= Subject: [PATCH v2 5/6] qemuxmlconftest: Add test cases for the new 'ps2' feature Message-ID: In-Reply-To: References: Feedback-ID: 37679334:user:proton X-Pm-Message-ID: 3ffa9c8ec64a5d5efd2a2d55ef074d95c354fe5a MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: kamil@szczek.dev X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: B2O4KVZYTZOP4SPSOB56RYPELKM4NAJH X-Message-ID-Hash: B2O4KVZYTZOP4SPSOB56RYPELKM4NAJH X-Mailman-Approved-At: Mon, 12 Aug 2024 09:08:49 -0400 X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @szczek.dev) X-ZM-MESSAGEID: 1723454073456116600 Content-Type: text/plain; charset="utf-8" Introduce tests to verify that the 'ps2' feature is correctly parsed when given either 'dirty' XML from a user or 'clean' canonical XML, as produced by libvirt. This also tests the transformation from libvirt's internal state to the aforementioned canonical form and to a QEMU command line. As a bonus, we also test some known bad configurations: - When user explicitly adds ps2 bus inputs, but also explicitly disables the 'ps2' feature. - When user explicitly enables the 'vmport' feature, but also explicitly disables the 'ps2' feature. This is not supported by QEMU and will result in vmport device not being created without emitting any warning or error. Signed-off-by: Kamil Szcz=C4=99k --- ...-off-explicit-ps2-inputs.x86_64-latest.err | 1 + .../machine-i8042-off-explicit-ps2-inputs.xml | 19 +++++++++++ ...hine-i8042-off-vmport-on.x86_64-latest.err | 1 + .../machine-i8042-off-vmport-on.xml | 18 ++++++++++ .../machine-i8042-off.x86_64-6.2.0.err | 1 + .../machine-i8042-off.x86_64-latest.args | 33 ++++++++++++++++++ .../machine-i8042-off.x86_64-latest.xml | 32 +++++++++++++++++ tests/qemuxmlconfdata/machine-i8042-off.xml | 17 ++++++++++ .../machine-i8042-on.x86_64-6.2.0.err | 1 + .../machine-i8042-on.x86_64-latest.args | 33 ++++++++++++++++++ .../machine-i8042-on.x86_64-latest.xml | 34 +++++++++++++++++++ tests/qemuxmlconfdata/machine-i8042-on.xml | 17 ++++++++++ tests/qemuxmlconftest.c | 6 ++++ 13 files changed, 213 insertions(+) create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-in= puts.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-in= puts.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_6= 4-latest.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.a= rgs create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.x= ml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-6.2.0.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.ar= gs create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.xml diff --git a/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x8= 6_64-latest.err b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inpu= ts.x86_64-latest.err new file mode 100644 index 0000000000..4fed60aa37 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x86_64-la= test.err @@ -0,0 +1 @@ +unsupported configuration: ps2 bus inputs require the ps2 feature not to b= e disabled diff --git a/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xm= l b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml new file mode 100644 index 0000000000..f90677670b --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + diff --git a/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-lates= t.err b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err new file mode 100644 index 0000000000..0c3b7280c0 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err @@ -0,0 +1 @@ +unsupported configuration: vmport feature requires the ps2 feature not to = be disabled diff --git a/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml b/tests/= qemuxmlconfdata/machine-i8042-off-vmport-on.xml new file mode 100644 index 0000000000..957da054b8 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml @@ -0,0 +1,18 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + + /usr/bin/qemu-system-x86_64 + + + + diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err b/tes= ts/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err new file mode 100644 index 0000000000..3a12712915 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err @@ -0,0 +1 @@ +unsupported configuration: ps2 feature state cannot be controlled with thi= s QEMU binary diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args b/t= ests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args new file mode 100644 index 0000000000..e340d164fc --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine q35,usb=3Doff,i8042=3Doff,dump-guest-core=3Doff,memory-backend=3D= pc.ram,acpi=3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=3Doff \ +-watchdog-action reset \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml b/te= sts/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml new file mode 100644 index 0000000000..b5c503e6df --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + +