From nobody Mon Sep 8 02:33:05 2025 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756140133; cv=none; d=zohomail.com; s=zohoarc; b=ZVGmc8qcbgZSojEp+w7Ox9kVygk0i7+K6mcL1c3bhCeTIl9Isj9gKCg+5LWavqkhA7uRIzrfbllvrlPw+1bnyzd2/YoYusVNH1J5h1s3iQUsU7mj1+J7aRII5VvWFTpCItRuf/bfYDK/gzknMsRHvmilAxQo1HQpKfuNpLeebD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756140133; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=dDIUUDrZzE6N+NDY4V4ExeCdBOveq9lbseiH5enSVSA=; b=azPE2rwWkpLwO8JRwJboiJ+e4cT8bC+3/tC4iTzDRDcicAdr2d59YsVb1LeNucmT2pYspk92e3ay5vCRel0EG7vYS4m9+l9zU9w9wn2VT7dPnVhf3xy5NHObQ7+Mib8zwcENOSWj29KIdd0cf5/2zs1ve1aCAL2Ef50GFCtQ8/k= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756140133051974.8853743738647; Mon, 25 Aug 2025 09:42:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 0B6A543EF8; Mon, 25 Aug 2025 12:42:11 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id C3BAE440C8; Mon, 25 Aug 2025 12:22:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 179F243E60; Mon, 25 Aug 2025 12:21:52 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 2102B43E5F for ; Mon, 25 Aug 2025 12:19:55 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-zXTgBQCmNnej334WoINnZw-1; Mon, 25 Aug 2025 12:19:53 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2F7D51800345 for ; Mon, 25 Aug 2025 16:19:45 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.224.68]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6144130001A2 for ; Mon, 25 Aug 2025 16:19:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756138794; 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=dDIUUDrZzE6N+NDY4V4ExeCdBOveq9lbseiH5enSVSA=; b=L2g40Xj0yW+R+v2d7nru39dlmFzyJ3GqDRdiN2tK+uFWxdh74m9VL6QiC+GHoRhWGU45Xp oqu+AsreujpU40JWmtV+V5rzYOIFSfKs70doDCdYjmQZdMs3Brx7PihRVwZgjNYUPD5VSu LhwvBFwYj3cXyJ3wOImrln8YMO7Pzf8= X-MC-Unique: zXTgBQCmNnej334WoINnZw-1 X-Mimecast-MFC-AGG-ID: zXTgBQCmNnej334WoINnZw_1756138792 To: devel@lists.libvirt.org Subject: [PATCH v2 06/10] qemu: Fix matching for read/write firmware Date: Mon, 25 Aug 2025 18:19:29 +0200 Message-ID: <20250825161933.228626-7-abologna@redhat.com> In-Reply-To: <20250825161933.228626-1-abologna@redhat.com> References: <20250825161933.228626-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: O4Cegj7bPhSRf7H6q0CE4fJ0yOH6Li740IbmGwhFGtk_1756138792 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XK6Q5KEZYOE2VV5MDNAIAICTJGACXNT2 X-Message-ID-Hash: XK6Q5KEZYOE2VV5MDNAIAICTJGACXNT2 X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756140133923116600 Content-Type: text/plain; charset="utf-8"; x-default="true" We currently always pick a read-only firmware unless we are explicitly asked for a read/write one, which is probably what most people expect anyway but doesn't really make sense otherwise: if no specific requirement has been provided by the user, both read-only and read/write firmwares should be allowed to match. This won't result in any change in practice, since distros are not shipping read/write builds of edk2 anyway. If they started doing that, it would be their responsibility to ensure that they are ordered after the read-only builds. Signed-off-by: Andrea Bolognani Reviewed-by: Jim Fehlig --- src/qemu/qemu_firmware.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 6ead61d59c..5bd34ea87f 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1318,6 +1318,13 @@ qemuFirmwareMatchDomain(const virDomainDef *def, return false; } =20 + /* Same for read-only status */ + if (loader && + loader->readonly =3D=3D VIR_TRISTATE_BOOL_YES && + flash->mode =3D=3D QEMU_FIRMWARE_FLASH_MODE_COMBINED) { + VIR_DEBUG("Discarding read/write loader"); + return false; + } if (loader && loader->readonly =3D=3D VIR_TRISTATE_BOOL_NO && flash->mode !=3D QEMU_FIRMWARE_FLASH_MODE_COMBINED) { --=20 2.51.0