From nobody Sat Nov 23 15:16:24 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=fail; 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=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 1724771342935611.0586922331698; Tue, 27 Aug 2024 08:09:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CC3C811C1; Tue, 27 Aug 2024 11:09:01 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 194E611BA; Tue, 27 Aug 2024 11:08:24 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A1EC3DDF; Tue, 27 Aug 2024 11:08:21 -0400 (EDT) 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 31F47CCB for ; Tue, 27 Aug 2024 11:08:21 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-AwgMv9JgNHC_Ug73GWAZ0A-1; Tue, 27 Aug 2024 11:08:19 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 704AA1955D4B for ; Tue, 27 Aug 2024 15:08:18 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.149]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F8BB1956052 for ; Tue, 27 Aug 2024 15:08:17 +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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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=redhat.com; s=mimecast20190719; t=1724771300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GcMxzsP4MTbzxSkShEKLyQZjuUEYR39cZwUnIIFbkjo=; b=Yug0lm/upX5n60gGSoKCZBH0nTXELe6xePaBd+5b0IAoBwRbNYhtIfSNe4kZGAocmYuaWB cfayqBtGT9wAfsgS07chC9ooSXKCenGCVLoMG2mtxNjDfyoNlUW2M7/MTiLxISWxNprbx/ oBmW+tivlDObWLh7h0OOIYwkPY0LBjo= X-MC-Unique: AwgMv9JgNHC_Ug73GWAZ0A-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH 1/4] tests: Add coverage for panic on riscv64 Date: Tue, 27 Aug 2024 17:08:10 +0200 Message-ID: <20240827150813.317166-2-abologna@redhat.com> In-Reply-To: <20240827150813.317166-1-abologna@redhat.com> References: <20240827150813.317166-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NFY4F7DTXTDBLJSKDEH2ZUBKDTJW6AXN X-Message-ID-Hash: NFY4F7DTXTDBLJSKDEH2ZUBKDTJW6AXN 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1724771344171116600 Content-Type: text/plain; charset="utf-8"; x-default="true" It merely duplicates the existing aarch64 coverage right now, but it will become actually useful with the upcoming changes. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- .../riscv64-panic-no-model.riscv64-latest.err | 1 + tests/qemuxmlconfdata/riscv64-panic-no-model.xml | 13 +++++++++++++ tests/qemuxmlconftest.c | 1 + 3 files changed, 15 insertions(+) create mode 100644 tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-la= test.err create mode 100644 tests/qemuxmlconfdata/riscv64-panic-no-model.xml diff --git a/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.er= r b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err new file mode 100644 index 0000000000..8e3f2c194d --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err @@ -0,0 +1 @@ +unsupported configuration: the QEMU binary does not support the ISA panic = device diff --git a/tests/qemuxmlconfdata/riscv64-panic-no-model.xml b/tests/qemux= mlconfdata/riscv64-panic-no-model.xml new file mode 100644 index 0000000000..9731a997ea --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-panic-no-model.xml @@ -0,0 +1,13 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4 + + hvm + + + /usr/bin/qemu-system-riscv64 + + + diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index f7c0cf4ad0..e97d0e7bdc 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2649,6 +2649,7 @@ mymain(void) DO_TEST_CAPS_LATEST("panic-double"); DO_TEST_CAPS_LATEST("panic-no-address"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("aarch64-panic-no-model", "aarch6= 4"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("riscv64-panic-no-model", "riscv6= 4"); =20 DO_TEST_CAPS_LATEST("pvpanic-pci-x86_64"); DO_TEST_CAPS_ARCH_LATEST("pvpanic-pci-aarch64", "aarch64"); --=20 2.46.0 From nobody Sat Nov 23 15:16:24 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=fail; 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=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 1724771362383273.10759011793846; Tue, 27 Aug 2024 08:09:22 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5B7FA11CC; Tue, 27 Aug 2024 11:09:21 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1D5A0126C; Tue, 27 Aug 2024 11:08:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7D5A1CCB; Tue, 27 Aug 2024 11:08:22 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 0B3B0DDF for ; Tue, 27 Aug 2024 11:08:22 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-QRw9CYEnNeq5pZOzEJqeFw-1; Tue, 27 Aug 2024 11:08:20 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B5CB21955D52 for ; Tue, 27 Aug 2024 15:08:19 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.149]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C889E19560A3 for ; Tue, 27 Aug 2024 15:08:18 +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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724771301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tmQ2W429rO5frp3Op+jXO+5jonAIGYeUlRf8JpiO2HI=; b=YtLzPK/q9utqIGibJR0VAZY6xKeVcLlRFW1YT4qVloaEoP/f8yHw6FI1PHsY81d7xzLXWl zW4jfzv9WtbmrPDQydVrszhPURzWFN1kMQtcKfDyVtzgE8DiYWSDF1bJ8XMM+2ZTp+H+ax zExUD3+lEq1wMG/eSiBiRy1C3NuoTAw= X-MC-Unique: QRw9CYEnNeq5pZOzEJqeFw-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH 2/4] qemu: Refactor default panic model Date: Tue, 27 Aug 2024 17:08:11 +0200 Message-ID: <20240827150813.317166-3-abologna@redhat.com> In-Reply-To: <20240827150813.317166-1-abologna@redhat.com> References: <20240827150813.317166-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BZ3QFVHK5KLIWHKVOTSU5ZDAIZIXGOWI X-Message-ID-Hash: BZ3QFVHK5KLIWHKVOTSU5ZDAIZIXGOWI 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1724771364211116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Perform decisions based on the architecture and machine type in a single place instead of duplicating them. This technically adds new behavior for MODEL_ISA in qemuDomainDefAddDefaultDevices(), but it doesn't make any difference functionally since we don't set addPanicDevice outside of ppc64(le) and s390(x). If we did, the lack of handling for that value would be a latent bug. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d1767c326d..e460e48fce 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4150,6 +4150,19 @@ qemuDomainGetSCSIControllerModel(const virDomainDef = *def, } =20 =20 +static virDomainPanicModel +qemuDomainDefaultPanicModel(const virDomainDef *def) +{ + if (qemuDomainIsPSeries(def)) + return VIR_DOMAIN_PANIC_MODEL_PSERIES; + + if (ARCH_IS_S390(def->os.arch)) + return VIR_DOMAIN_PANIC_MODEL_S390; + + return VIR_DOMAIN_PANIC_MODEL_ISA; +} + + static int qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, virDomainDef *def, @@ -4397,13 +4410,12 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *drive= r, return -1; =20 if (addPanicDevice) { + virDomainPanicModel defaultModel =3D qemuDomainDefaultPanicModel(d= ef); size_t j; + for (j =3D 0; j < def->npanics; j++) { if (def->panics[j]->model =3D=3D VIR_DOMAIN_PANIC_MODEL_DEFAUL= T || - (ARCH_IS_PPC64(def->os.arch) && - def->panics[j]->model =3D=3D VIR_DOMAIN_PANIC_MODEL_P= SERIES) || - (ARCH_IS_S390(def->os.arch) && - def->panics[j]->model =3D=3D VIR_DOMAIN_PANIC_MODEL_S= 390)) + def->panics[j]->model =3D=3D defaultModel) break; } =20 @@ -6100,14 +6112,8 @@ static int qemuDomainDevicePanicDefPostParse(virDomainPanicDef *panic, const virDomainDef *def) { - if (panic->model =3D=3D VIR_DOMAIN_PANIC_MODEL_DEFAULT) { - if (qemuDomainIsPSeries(def)) - panic->model =3D VIR_DOMAIN_PANIC_MODEL_PSERIES; - else if (ARCH_IS_S390(def->os.arch)) - panic->model =3D VIR_DOMAIN_PANIC_MODEL_S390; - else - panic->model =3D VIR_DOMAIN_PANIC_MODEL_ISA; - } + if (panic->model =3D=3D VIR_DOMAIN_PANIC_MODEL_DEFAULT) + panic->model =3D qemuDomainDefaultPanicModel(def); =20 return 0; } --=20 2.46.0 From nobody Sat Nov 23 15:16:24 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=fail; 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=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 1724771388669553.8435512920919; Tue, 27 Aug 2024 08:09:48 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A1AD11273; Tue, 27 Aug 2024 11:09:47 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 46FC312A2; Tue, 27 Aug 2024 11:08:29 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EC3451184; Tue, 27 Aug 2024 11:08:23 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 56C08CCB for ; Tue, 27 Aug 2024 11:08:23 -0400 (EDT) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-t9m25IOTMxCpvIiCpFFEOA-1; Tue, 27 Aug 2024 11:08:21 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E76B519560BF for ; Tue, 27 Aug 2024 15:08:20 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.149]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2335319560A3 for ; Tue, 27 Aug 2024 15:08:19 +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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724771303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BFX7P4zKMirhE4agD8eb4xloUDe6h5+RjpubwwjSG9Q=; b=UWjo6IkG5KhaNdtlxw3Ct9FS8HSfp3detHSWoSRk2YbDK2eYB83+xQce6LDpF1f/A4L30o j+tww2CFN7lKUAq2MbhmusJeWM3JIxAjX4hFimZcc3alzI+JFmHXsfReeP6PsvZaUylAVJ GUhQx/9AmAx728z1nK81plWOkFoSImE= X-MC-Unique: t9m25IOTMxCpvIiCpFFEOA-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH 3/4] qemu: Sometimes the default panic model doesn't exist Date: Tue, 27 Aug 2024 17:08:12 +0200 Message-ID: <20240827150813.317166-4-abologna@redhat.com> In-Reply-To: <20240827150813.317166-1-abologna@redhat.com> References: <20240827150813.317166-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SFCUHYQDYBDS2JV4W4K2R3GOTPNYJQRQ X-Message-ID-Hash: SFCUHYQDYBDS2JV4W4K2R3GOTPNYJQRQ 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1724771390526116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Right now the fallback behavior is to use MODEL_ISA if we haven't been able to find a better match, but that's not very useful as we're still going to hit an error later, when QEMU_CAPS_DEVICE_PANIC is not found at Validate time. Instead of doing that, allow the MODEL_DEFAULT to get all the way to Validate and report an error upon encountering it. The reported error changes slightly, but other than that the set of configurations that allow and block remains the same. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 5 ++++- src/qemu/qemu_validate.c | 6 +++++- .../aarch64-panic-no-model.aarch64-latest.err | 2 +- .../riscv64-panic-no-model.riscv64-latest.err | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e460e48fce..0cc335eb30 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4159,7 +4159,10 @@ qemuDomainDefaultPanicModel(const virDomainDef *def) if (ARCH_IS_S390(def->os.arch)) return VIR_DOMAIN_PANIC_MODEL_S390; =20 - return VIR_DOMAIN_PANIC_MODEL_ISA; + if (ARCH_IS_X86(def->os.arch)) + return VIR_DOMAIN_PANIC_MODEL_ISA; + + return VIR_DOMAIN_PANIC_MODEL_DEFAULT; } =20 =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index f74c538efe..43418033f6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1048,8 +1048,12 @@ qemuValidateDomainDefPanic(const virDomainDef *def, } break; =20 - /* default model value was changed before in post parse */ case VIR_DOMAIN_PANIC_MODEL_DEFAULT: + /* PostParse couldn't figure out a sensible default model */ + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("no panic model provided, and no default for = the architecture and machine type")); + return -1; + case VIR_DOMAIN_PANIC_MODEL_LAST: break; } diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.er= r b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err index 8e3f2c194d..139249bbc5 100644 --- a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err +++ b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err @@ -1 +1 @@ -unsupported configuration: the QEMU binary does not support the ISA panic = device +unsupported configuration: no panic model provided, and no default for the= architecture and machine type diff --git a/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.er= r b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err index 8e3f2c194d..139249bbc5 100644 --- a/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err +++ b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err @@ -1 +1 @@ -unsupported configuration: the QEMU binary does not support the ISA panic = device +unsupported configuration: no panic model provided, and no default for the= architecture and machine type --=20 2.46.0 From nobody Sat Nov 23 15:16:24 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=fail; 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=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 1724771413218250.8489655198398; Tue, 27 Aug 2024 08:10:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 271A711BA; Tue, 27 Aug 2024 11:10:12 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 116CB12AB; Tue, 27 Aug 2024 11:08:35 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4241811E9; Tue, 27 Aug 2024 11:08:30 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 DAD7C11E9 for ; Tue, 27 Aug 2024 11:08:24 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-tLT9vBO7PnygO12PUMn0Lg-1; Tue, 27 Aug 2024 11:08:23 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 566171955BED for ; Tue, 27 Aug 2024 15:08:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.149]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A89219560A3 for ; Tue, 27 Aug 2024 15:08:21 +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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724771304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H/sP8XddtPaGDXfsskX8BzSB/UKQr757ep8CNa3GXlU=; b=eHEkXKXFBPfysF4jS4SCZtwD2ADmCzt2AeH+MoqluI+MNJ5gp0a7BWpxYj/25YSHPBVEpB VH2UZ0dwtM1gsvJePOKIi/t66rAVzFIfd5767HQ2j4kU2qW2rRfpHr6YFJOz66fNb6qC83 8rhaEBozBuohXsteJYSSdNRKXADmIcU= X-MC-Unique: tLT9vBO7PnygO12PUMn0Lg-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH 4/4] qemu: Use pvpanic by default on aarch64 Date: Tue, 27 Aug 2024 17:08:13 +0200 Message-ID: <20240827150813.317166-5-abologna@redhat.com> In-Reply-To: <20240827150813.317166-1-abologna@redhat.com> References: <20240827150813.317166-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FVKWGYAOSPDGCFVYEYEPRRFYRUZBBT5T X-Message-ID-Hash: FVKWGYAOSPDGCFVYEYEPRRFYRUZBBT5T 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1724771414474116600 Content-Type: text/plain; charset="utf-8"; x-default="true" pvpanic-pci is the only reasonable implementation of a panic device for aarch64/virt guests. Right now we're asking users to provide the model name manually, but we can be more helpful and fill it in automatically instead. With this change, the aarch64-panic-no-model test no longer fails and so it's no longer useful to us. Instead, we can amend the aarch64-virt-default-models test case to include panic coverage, something that until now wasn't possible. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 3 +++ .../aarch64-panic-no-model.aarch64-latest.err | 1 - tests/qemuxmlconfdata/aarch64-panic-no-model.xml | 13 ------------- ...rt-default-models.aarch64-latest.abi-update.args | 1 + ...irt-default-models.aarch64-latest.abi-update.xml | 3 +++ .../aarch64-virt-default-models.aarch64-latest.args | 1 + .../aarch64-virt-default-models.aarch64-latest.xml | 3 +++ .../qemuxmlconfdata/aarch64-virt-default-models.xml | 2 +- tests/qemuxmlconftest.c | 1 - 9 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-la= test.err delete mode 100644 tests/qemuxmlconfdata/aarch64-panic-no-model.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0cc335eb30..4b3b5077e0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4162,6 +4162,9 @@ qemuDomainDefaultPanicModel(const virDomainDef *def) if (ARCH_IS_X86(def->os.arch)) return VIR_DOMAIN_PANIC_MODEL_ISA; =20 + if (qemuDomainIsARMVirt(def)) + return VIR_DOMAIN_PANIC_MODEL_PVPANIC; + return VIR_DOMAIN_PANIC_MODEL_DEFAULT; } =20 diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.er= r b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err deleted file mode 100644 index 139249bbc5..0000000000 --- a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: no panic model provided, and no default for the= architecture and machine type diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.xml b/tests/qemux= mlconfdata/aarch64-panic-no-model.xml deleted file mode 100644 index 5207e48bbd..0000000000 --- a/tests/qemuxmlconfdata/aarch64-panic-no-model.xml +++ /dev/null @@ -1,13 +0,0 @@ - - guest - 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 - 4194304 - 4 - - hvm - - - /usr/bin/qemu-system-aarch64 - - - diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-late= st.abi-update.args b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarc= h64-latest.abi-update.args index a503f45d0c..96fb251d80 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-= update.args +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-= update.args @@ -44,4 +44,5 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-guest/.= config \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"p= ci.5","addr":"0x0"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-late= st.abi-update.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch= 64-latest.abi-update.xml index bbe1dd931d..f27e7e1522 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-= update.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-= update.xml @@ -78,5 +78,8 @@
+ +
+ diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-late= st.args b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.= args index a503f45d0c..96fb251d80 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args @@ -44,4 +44,5 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-guest/.= config \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"p= ci.5","addr":"0x0"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-late= st.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.x= ml index bbe1dd931d..f27e7e1522 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml @@ -78,5 +78,8 @@
+ +
+ diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.xml b/tests/= qemuxmlconfdata/aarch64-virt-default-models.xml index d9ad495e75..a8029d888d 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.xml @@ -19,6 +19,6 @@