From nobody Sat Nov 23 18:12:36 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 --- 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