From nobody Wed Jan 15 13:48:34 2025 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17054857248191005.3206210175399; Wed, 17 Jan 2024 02:02:04 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C120D1DCA; Wed, 17 Jan 2024 05:02:03 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id ADD711E45; Wed, 17 Jan 2024 04:55:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4E05B1C60; Wed, 17 Jan 2024 04:54:57 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 81D791C5B for ; Wed, 17 Jan 2024 04:54:56 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-D1fTr7ypOt-Wvu285Oes2Q-1; Wed, 17 Jan 2024 04:54:54 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A9AEF85A58F for ; Wed, 17 Jan 2024 09:54:54 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40DCC40C6EB9 for ; Wed, 17 Jan 2024 09:54:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: D1fTr7ypOt-Wvu285Oes2Q-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH 02/18] tests: Add pseries-phb-user-alias Date: Wed, 17 Jan 2024 10:54:35 +0100 Message-ID: <20240117095451.788816-3-abologna@redhat.com> In-Reply-To: <20240117095451.788816-1-abologna@redhat.com> References: <20240117095451.788816-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: IBLCIZEJCZMTYNFHSUIC7HWEV5YQYOR4 X-Message-ID-Hash: IBLCIZEJCZMTYNFHSUIC7HWEV5YQYOR4 X-MailFrom: abologna@redhat.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header 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: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1705485726987100001 This is the same as the existing pseries-phb-simple, except that each of the controllers is given a user alias. If we tried to start the resulting guest, we'd get an error: Bus 'ua-phb0' not found This is because, at the QEMU command line level, the default PHB is not represented and so it can't be given a custom alias. We're going to address this issue in a follow-up commit. Signed-off-by: Andrea Bolognani Reviewed-by: Peter Krempa --- .../pseries-phb-user-alias.ppc64-latest.args | 36 +++++++++++++++ .../pseries-phb-user-alias.xml | 30 +++++++++++++ tests/qemuxml2argvtest.c | 1 + .../pseries-phb-user-alias.ppc64-latest.xml | 45 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 113 insertions(+) create mode 100644 tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-lat= est.args create mode 100644 tests/qemuxml2argvdata/pseries-phb-user-alias.xml create mode 100644 tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-l= atest.xml diff --git a/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.arg= s b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args new file mode 100644 index 0000000000..e64fc9aa11 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args @@ -0,0 +1,36 @@ +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-ppc64 \ +-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 pseries,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dppc_spap= r.ram \ +-accel tcg \ +-cpu POWER9 \ +-m size=3D524288k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":5368= 70912}' \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-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 \ +-device '{"driver":"spapr-pci-host-bridge","index":1,"id":"ua-phb1"}' \ +-netdev user,id=3Dhostnet0 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:a2:44:92","bus":"ua-phb0","addr":"0x1"}' \ +-netdev user,id=3Dhostnet1 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":= "52:54:00:a2:44:93","bus":"ua-phb1.0","addr":"0x1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/pseries-phb-user-alias.xml b/tests/qemu= xml2argvdata/pseries-phb-user-alias.xml new file mode 100644 index 0000000000..1f95e52747 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-phb-user-alias.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + +
+ + + + +
+ + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1be138bb0f..354f47bea3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2038,6 +2038,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PPC64("pseries-phb-simple"); DO_TEST_CAPS_LATEST_PPC64("pseries-phb-default-missing"); DO_TEST_CAPS_LATEST_PPC64("pseries-phb-numa-node"); + DO_TEST_CAPS_LATEST_PPC64("pseries-phb-user-alias"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("pseries-default-phb-numa-node", "ppc64"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("pseries-phb-invalid-target-index= -1", "ppc64"); diff --git a/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.x= ml b/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml new file mode 100644 index 0000000000..d6de2037a8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml @@ -0,0 +1,45 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + POWER9 + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + + + + + +
+ + + + +
+ +