From nobody Tue Mar 3 03:06:30 2026 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=1771871635; cv=none; d=zohomail.com; s=zohoarc; b=NflWCMZ+m7JYMwLzXBuO88h8D5+VqU0T5+AsOtA8tDxtXeMcICfc48xv+Xawszgl5/LiROeDbtCy4n5UuMT21Kv0Fnoa6uKuKyDvkqExua0aKXXRrnba7C3sOPy0uDKJV538KbLSjt0vaaHohKOfRD/1g1Mja+N9OPgNVTDF7bc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871635; 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=j79ctdmpjUFEnPmL44ONQZsdVrE1ECbmbQg3CWFI6LM=; b=RXnygiUZn3KFYVaz6/hdci4nfG90vOpffXO3dtl1RyNyZRQp19RmdDx38tmKKlWLHUM6mTGTZN9o20EYWvi/kD9nmbJuuUHGR44JbUQ9aqi7SAi/L4S0NRLsm/2hU3yJjGSay6HLxnFNCH9t5A5dAOeNcOUI50teKDKc/n/GvW0= 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 1771871635123561.0806111964891; Mon, 23 Feb 2026 10:33:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4D40F41B3F; Mon, 23 Feb 2026 13:33:54 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B46D641BB5; Mon, 23 Feb 2026 13:31:35 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id EC5B2419C7; Mon, 23 Feb 2026 13:31:30 -0500 (EST) 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 60FFC419C0 for ; Mon, 23 Feb 2026 13:31:30 -0500 (EST) 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-94-AlIoh8ZIMS6pMcMJ_d2jRg-1; Mon, 23 Feb 2026 13:31:28 -0500 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 848661956075 for ; Mon, 23 Feb 2026 18:31:27 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9C1241955D71 for ; Mon, 23 Feb 2026 18:31:26 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871490; 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=j79ctdmpjUFEnPmL44ONQZsdVrE1ECbmbQg3CWFI6LM=; b=bsp4Wn87b0uATguRIv58DT5RqpTkfQq4b869mJopDKAujynqAqCr1u71XUBD5zhb8SXEto l+bArhS1/sH86unjKlkJaI0p7szoqOJYWgSAhBGwYHW+fv8olspQeoGQi4BmOW2dSyqJ/D TFb2bFGV7l6jcqoF9wJpkjVI2eRyquU= X-MC-Unique: AlIoh8ZIMS6pMcMJ_d2jRg-1 X-Mimecast-MFC-AGG-ID: AlIoh8ZIMS6pMcMJ_d2jRg_1771871487 To: devel@lists.libvirt.org Subject: [PATCH v4 01/36] docs: Rename "BIOS bootloader" section to "guest firmware" Date: Mon, 23 Feb 2026 19:30:44 +0100 Message-ID: <20260223183119.501349-2-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: anVCaKrOz2AbXv8dxuQj8SYTodQ-8FM8O-H79rrKlRU_1771871487 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VYVS3SBUNPEPJJUZ3OGF3LN4HZ2MKDZ2 X-Message-ID-Hash: VYVS3SBUNPEPJJUZ3OGF3LN4HZ2MKDZ2 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: 1771871635993158500 Content-Type: text/plain; charset="utf-8"; x-default="true" The new name is much more accurate since the documentation is applicable to firmware other than BIOS, notably UEFI. An empty container is used to keep old links working. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- docs/formatcaps.rst | 2 +- docs/formatdomain.rst | 24 ++++++++++++++---------- docs/formatdomaincaps.rst | 19 ++++++++++++------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/docs/formatcaps.rst b/docs/formatcaps.rst index fa8ab5197f..9458e1289a 100644 --- a/docs/formatcaps.rst +++ b/docs/formatcaps.rst @@ -172,7 +172,7 @@ The ```` element will typically wrap up the fol= lowing elements: Emulator (device model) path, for use in `emulator `__ element of domain XML. ``loader`` - Loader path, for use in `loader `= __ + Loader path, for use in `loader `__ element of domain XML. ``machine`` Machine type, for use in diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 82788c15a2..db664857af 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -103,12 +103,16 @@ Operating system booting There are a number of different ways to boot virtual machines each with th= eir own pros and cons. =20 +Guest firmware +~~~~~~~~~~~~~~ =20 -BIOS bootloader -~~~~~~~~~~~~~~~ +.. container:: + :name: bios-bootloader + + .. this container only exists to keep old links working =20 -Booting via the BIOS is available for hypervisors supporting full -virtualization. In this case the BIOS has a boot order priority (floppy, +Booting via a guest firmware is available for hypervisors supporting full +virtualization. In this case the firmware has a boot order priority (flopp= y, harddisk, cdrom, network) determining where to obtain/find the boot image. =20 :: @@ -411,10 +415,10 @@ and full virtualized guests. =20 ``type`` This element has the same semantics as described earlier in the - `BIOS bootloader`_ section. + `guest firmware`_ section. ``loader`` This element has the same semantics as described earlier in the - `BIOS bootloader`_ section. + `guest firmware`_ section. ``kernel`` The contents of this element specify the fully-qualified path to the ke= rnel image in the host OS. @@ -3752,7 +3756,7 @@ paravirtualized driver is specified via the ``disk`` = element. attribute is an 8 character string which can be queried by guests on S3= 90 via sclp or diag 308. Linux guests on S390 can use ``loadparm`` to select a= boot entry. :since:`Since 3.5.0` The per-device ``boot`` elements cannot be = used - together with general boot elements in `BIOS bootloader`_ + together with general boot elements in `guest firmware`_ section. :since:`Since 0.8.8` ``encryption`` since:`Since 3.9.0` the ``encryption`` element is preferred @@ -4917,7 +4921,7 @@ or: Specifies that the device is bootable. The ``order`` attribute determin= es the order in which devices will be tried during boot sequence. The per-devi= ce ``boot`` elements cannot be used together with general boot elements in - `BIOS bootloader`_ section. :since:`Since 0.8.8` for PCI + `guest firmware`_ section. :since:`Since 0.8.8` for PCI devices, :since:`Since 1.0.1` for USB devices. ``rom`` The ``rom`` element is used to change how a PCI device's ROM is present= ed to @@ -5144,7 +5148,7 @@ USB device redirection through a character device is = supported Specifies that the device is bootable. The ``order`` attribute determin= es the order in which devices will be tried during boot sequence. The per-devi= ce ``boot`` elements cannot be used together with general boot elements in - `BIOS bootloader`_ section. ( :since:`Since 1.0.1` ) + `guest firmware`_ section. ( :since:`Since 1.0.1` ) ``redirfilter`` The\ ``redirfilter``\ element is used for creating the filter rule to f= ilter out certain devices from redirection. It uses sub-element ```` = to @@ -6400,7 +6404,7 @@ Specifying boot order For hypervisors which support this, you can set a specific NIC to be used = for network boot. The ``order`` attribute determines the order in which device= s will be tried during boot sequence. The per-device ``boot`` elements cannot be = used -together with general boot elements in `BIOS bootloader`_ +together with general boot elements in `guest firmware`_ section. :since:`Since 0.8.8` =20 Interface ROM BIOS configuration diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index cca827923c..22a6d5d067 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -72,11 +72,11 @@ The root element that emulator capability XML document = starts with has name Describes the `virtualization type `__ (or so called domain type). ``machine`` - The domain's `machine type `__. Sinc= e not + The domain's `machine type `__. Since= not every hypervisor has a sense of machine types this element might be omi= tted in such drivers. ``arch`` - The domain's `architecture `__. + The domain's `architecture `__. =20 CPU Allocation ~~~~~~~~~~~~~~ @@ -95,12 +95,17 @@ capabilities, e.g. virtual CPUs: ``vcpu`` The maximum number of supported virtual CPUs =20 -BIOS bootloader -~~~~~~~~~~~~~~~ +Guest firmware +~~~~~~~~~~~~~~ + +.. container:: + :name: bios-bootloader + + .. this container only exists to keep old links working =20 -Sometimes users might want to tweak some BIOS knobs or use UEFI. For cases= like -that, `os `__ element exposes what valu= es can -be passed to its children. +Exposes information about supported +`guest firmware `__ configurations for +domains. =20 :: =20 --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771871724; cv=none; d=zohomail.com; s=zohoarc; b=Flv5h30oXfH+uMbKxCo/UUjaXoSLKKajLJZ71oiKScGA5GUKcvykgQWJ5CW9J0qQKgJapm28jRKPBHoDhzGOyx5gfDcyAiRR5Mq6A1c+Jh9FzC5NFhDsKfsED2REbvFgNSQ55YSK4oye2Eb8l0MsIKEmRGMjBxHmqmKdMbJ8LfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871724; 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=+8bRe8ccxhh0YgPR91m84D7Ubk5bWIyzV/NXW3kt4ws=; b=W2/sz6fLtSug2fZzFVwT5vDVcZ7Urxpit7NvLjXozN4URBW368ahps9eS7g2Vd1f8FyaO0tqau06F5kAU9pWGfnIiGGti8/FRQYbIIHD4vPtD1rkFdTOYaKmFhKGp+CPK1odny4HHugQxQpLo8brSEG/ojGldcZYV5z69zANhZk= 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 1771871723907231.2848353986285; Mon, 23 Feb 2026 10:35:23 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 210E241BE8; Mon, 23 Feb 2026 13:35:23 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id BD01B41C04; Mon, 23 Feb 2026 13:31:56 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 05461419C9; Mon, 23 Feb 2026 13:31:52 -0500 (EST) 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 7B74F41A55 for ; Mon, 23 Feb 2026 13:31:32 -0500 (EST) 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-696-SZjh6Jg0PuO4UkkQKC91hg-1; Mon, 23 Feb 2026 13:31:30 -0500 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 A32481956094 for ; Mon, 23 Feb 2026 18:31:29 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E2421955D71 for ; Mon, 23 Feb 2026 18:31:27 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871492; 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=+8bRe8ccxhh0YgPR91m84D7Ubk5bWIyzV/NXW3kt4ws=; b=PN1ShiqbvNuoelqP1f37zI/B2aDrVzOUGSTw3/Njc1phEMpziwo6VnYKH7mJ32yJpUGypI K4oiaxQp+7IhCqMbOKGnd4C4zGyQkdltqlsvnr6+WUUBnRC4hBAGNflLKXbe9qvpEf07dA HbYsLpPM3WS/QPbd7wWpFLZWB5FMdMA= X-MC-Unique: SZjh6Jg0PuO4UkkQKC91hg-1 X-Mimecast-MFC-AGG-ID: SZjh6Jg0PuO4UkkQKC91hg_1771871489 To: devel@lists.libvirt.org Subject: [PATCH v4 02/36] docs: Improvement related to firmware selection Date: Mon, 23 Feb 2026 19:30:45 +0100 Message-ID: <20260223183119.501349-3-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: Py7fjhlscfvDFWTK8R4OtBJNP6mA7ud1bihPNMzDQdY_1771871489 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WPI3J6DMI74AESOVDSQUGTZQEBVDVDOE X-Message-ID-Hash: WPI3J6DMI74AESOVDSQUGTZQEBVDVDOE 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: 1771871726206158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Recommend that users take advantage of firmware autoselection and discourage providing paths manually. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- docs/formatdomaincaps.rst | 59 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 22a6d5d067..3426b7c9cd 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -145,15 +145,17 @@ domains. ... =20 -The ``firmware`` enum corresponds to the ``firmware`` attribute of the ``o= s`` -element in the domain XML. The presence of this enum means libvirt is capa= ble of -the so-called firmware auto-selection feature. And the listed firmware val= ues -represent the accepted input in the domain XML. Note that the ``firmware``= enum -reports only those values for which a firmware "descriptor file" exists on= the -host. Firmware descriptor file is a small JSON document that describes det= ails -about a given BIOS or UEFI binary on the host, e.g. the firmware binary pa= th, -its architecture, supported machine types, NVRAM template, etc. This ensur= es -that the reported values won't cause a failure on guest boot. +The presence of the ``firmware`` enum means that libvirt can perform firmw= are +autoselection, and each of the values is guaranteed to be usable. In the +domain XML, firmware autoselection is enabled as follows: + +:: + + + ... + +Autoselection is the recommended mechanism for configuring the guest firmw= are. +Providing paths and other information manually is discouraged. =20 The ```` element :since:`(since 12.1.0)` contains one enum for each of the features that can be used to fine-tune the firmware @@ -196,27 +198,34 @@ such as: would not work, since ``no`` is not one of the valid values advertised by the ``secureBoot`` enum. =20 -For the ``loader`` element, the following can occur: +The information contained in the ```` element is not relevant when +using firmware autoselection, which is the recommended approach to guest +firmware configuration, and as such can largely be ignored. Its subelements +are the following: =20 ``value`` - List of known firmware binary paths. Currently this is used only to adv= ertise - the known location of OVMF binaries for QEMU. OVMF binaries will only be - listed if they actually exist on host. + One element for each known firmware binary present on the system. + + Note that a binary being present here indicates that the file exists an= d it + is compatible with the architecture/machine type, but does not provide = any + insight into which mechanism (see ``type`` below) should be used to loa= d it. ``type`` - Whether the boot loader is a typical BIOS (``rom``) or a UEFI firmware - (``pflash``). Each ``value`` sub-element under the ``type`` enum repres= ents a - possible value for the ``type`` attribute for the element in = the - domain XML. E.g. the presence of ``pfalsh`` under the ``type`` enum mea= ns - that a domain XML can use UEFI firmware via: type=3D"pflash" - ...>/path/to/the/firmware/binary/. + Whether firmware can be loaded using a ``pflash`` device (UEFI only) or= as + a ``rom`` (either UEFI or BIOS). ``readonly`` - Options for the ``readonly`` attribute of the element in the = domain - XML. + Supported values for the ``readonly`` attribute of the ```` el= ement + in the domain XML. ``secure`` - Options for the ``secure`` attribute of the element in the do= main - XML. Note that the value ``yes`` is listed only if libvirt detects a fi= rmware - descriptor file that has path to an OVMF binary that supports Secure bo= ot, - and lists its architecture and supported machine type. + Supported values for the ``secure`` attribute of the ```` elem= ent + in the domain XML. + + Note that the value ``yes`` is listed if libvirt detects a firmware + descriptor file that points to a firmware binary that implements Secure + Boot and is compatible with the architecture/machine type, but the UEFI + variable store template associated with it might not have the usual set= of + Secure Boot certificates enrolled. To figure out whether it's actually + possible to enforce Secure Boot, look at the ``enrolledKeys`` enum insi= de + the ```` element instead. =20 CPU configuration ~~~~~~~~~~~~~~~~~ --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771871779; cv=none; d=zohomail.com; s=zohoarc; b=cxJO2QuCxgKplKaahMkuuxliycir8n0vqreVO6d/qlFvTxBF9mKe9z1bI6YxHEu+9tkY2Ah0GDqpTCvC6tO/nro11Wzqm+RtZhgUfH3lwatA9SMYsACUHPzyOxECZ6kmpTtz5hmgIaSNsd5mDHHnQeHSep0U4CnWT59XpWcCXzc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871779; 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=yVHRSNbj3isDe27hDsdh/jwsSy+1ghh/6pnQHDl0Jo4=; b=QdvAIpjq8UMS9wWP+3qdeLJ2XfSthTsxmHfgF+9F3JRizZ2jsg6x1ukb3tfXFEnPWuH3mbp991SakLjVpZJSIK5nJepXnCdByeY6uR0ClDqMNAs/HKFArXrJQ3sqdr4PlqsXlowD5Csh/1KHdptEzt/ptCNVLknyqZAmVeZ/RQc= 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 1771871779004321.5352336328814; Mon, 23 Feb 2026 10:36:19 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4172841C09; Mon, 23 Feb 2026 13:36:18 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 9A33A41C7F; Mon, 23 Feb 2026 13:32:08 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 7352241C2C; Mon, 23 Feb 2026 13:32:04 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 078FF41B02 for ; Mon, 23 Feb 2026 13:31:33 -0500 (EST) 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-127-SnWVwqq4OVekxwi1CwJDEQ-1; Mon, 23 Feb 2026 13:31:32 -0500 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 68305195608A for ; Mon, 23 Feb 2026 18:31:31 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5BAD01955D71 for ; Mon, 23 Feb 2026 18:31:29 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871493; 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=yVHRSNbj3isDe27hDsdh/jwsSy+1ghh/6pnQHDl0Jo4=; b=fxKv05o2P9y+A+F6qxqHJdAi/cQGzYQ3X4cwR0pbQ6YLQ3Q9Kkq2ADOxKfzULMjsXrgzK/ f9QNe5l1wgKSlBYb2w7bp3uuhL4Co+i9pAD25QoGnhiaq2u29SNYlRsjdd6NR4+TX/Q9Cz lN/SiXK9B2ytPmQIHQZ5G++8EFlJIhc= X-MC-Unique: SnWVwqq4OVekxwi1CwJDEQ-1 X-Mimecast-MFC-AGG-ID: SnWVwqq4OVekxwi1CwJDEQ_1771871491 To: devel@lists.libvirt.org Subject: [PATCH v4 03/36] qemu_firmware: Only set format for custom loader if path is present Date: Mon, 23 Feb 2026 19:30:46 +0100 Message-ID: <20260223183119.501349-4-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: F7GXrfGRelnb2s2lDhgjnpStJQPPZUETNxd1k1GJSZE_1771871491 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MNNINCGEJD3ZTFAYFOK6ZA7NPT6TGTI2 X-Message-ID-Hash: MNNINCGEJD3ZTFAYFOK6ZA7NPT6TGTI2 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: 1771871780512158500 We only set the template format if the template path is present, and we should be consistent with that. The format on its own is not very interesting anyway. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Acked-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_firmware.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 436b06c388..519828f6f9 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1662,8 +1662,10 @@ qemuFirmwareFillDomainCustom(virDomainDef *def) if (!loader) return; =20 - if (!loader->format) + if (loader->path && + !loader->format) { loader->format =3D VIR_STORAGE_FILE_RAW; + } =20 if (loader->nvramTemplate && !loader->nvramTemplateFormat) { --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771871855; cv=none; d=zohomail.com; s=zohoarc; b=eM4B0+T+nNs2otXVIyKVBWqM/AWdzktDGwKQ9H/u+uH6BaJcw/dYk2tpdi6uZ6Fv3EPZ0FB6JFiwd/vkJ9bvQnwcwcINlzw8mucC+56aEb+1bZ8b2hVjw1NRYa073fv93gW241zK/n7kUvxMxFJwreQyiGafaBcZNEF5KguQGDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871855; 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=a/dL9q96yqNF+Otz1S6EJY8bFQM9ZHDq2dH4l9OG9e4=; b=iporaHKvZOA4i2QEiKUuWilkQziagt0Pj/eUBi4Xb2iH/pY9u6DIZwteWYxyuD0jrjT5sUvEYl3p0Wf7Q4gySE9Kz3r8ctzHpxDhENhDYIIlw/q5tBIrbAsdElQru264NvckBnbo3Nmfc7OzHif6lwGfqzaD1Te4NqF4klQs4N8= 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 1771871855668634.0889609511324; Mon, 23 Feb 2026 10:37:35 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id E5A5841C05; Mon, 23 Feb 2026 13:37:34 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 1207941B9C; Mon, 23 Feb 2026 13:34:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id CE61741B5B; Mon, 23 Feb 2026 13:33:55 -0500 (EST) 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 B1F5841BB4 for ; Mon, 23 Feb 2026 13:31:35 -0500 (EST) Received: from mx-prod-mc-01.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-122-KXhgMxGpOz-0ZgkffLBLqA-1; Mon, 23 Feb 2026 13:31:33 -0500 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0AF3719560A7 for ; Mon, 23 Feb 2026 18:31:33 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 29E6D1955D71 for ; Mon, 23 Feb 2026 18:31:31 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871495; 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=a/dL9q96yqNF+Otz1S6EJY8bFQM9ZHDq2dH4l9OG9e4=; b=iVFWslShy4Zh6cJ8uGlu4IOG9DMADnXECpAcaBJrkTyAc8gduCWLCxlLHI7eEPVM1v5Eir vOgBUe7VZ4LQJMrJxg2SjOCEhwr4bs0Fn115anvsrhEs2OTsF5ijGcr5fqZgOmCKcSaoy6 SzbLfgGYFRI94VsSI792NXhHs/nhGAI= X-MC-Unique: KXhgMxGpOz-0ZgkffLBLqA-1 X-Mimecast-MFC-AGG-ID: KXhgMxGpOz-0ZgkffLBLqA_1771871493 To: devel@lists.libvirt.org Subject: [PATCH v4 04/36] conf: Move type=rom default for loader to drivers Date: Mon, 23 Feb 2026 19:30:47 +0100 Message-ID: <20260223183119.501349-5-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: _egBtYD020B0xMCAy1j1fgUeC9jTJPqna3bnZmzZQ44_1771871493 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DRZHAQG3HB77LN4LKT52SDTI73CCXA5B X-Message-ID-Hash: DRZHAQG3HB77LN4LKT52SDTI73CCXA5B 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: 1771871856842158500 Right now we set this default in the common parsing code, which is not a big problem per se but would get in the way of some upcoming changes. Leave this choice to individual drivers instead. Only the QEMU and Xen drivers use the value for anything, so we can limit the amount of code duplication this change causes. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Acked-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_postparse.c | 19 ------------------- src/libxl/libxl_domain.c | 6 ++++++ src/qemu/qemu_firmware.c | 5 +++++ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index 38e731348d..cbaae75c02 100644 --- a/src/conf/domain_postparse.c +++ b/src/conf/domain_postparse.c @@ -89,22 +89,6 @@ virDomainDefPostParseMemory(virDomainDef *def, } =20 =20 -static int -virDomainDefPostParseOs(virDomainDef *def) -{ - if (!def->os.loader) - return 0; - - if (def->os.loader->path && - def->os.loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_NONE) { - /* By default, loader is type of 'rom' */ - def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; - } - - return 0; -} - - static void virDomainDefPostParseMemtune(virDomainDef *def) { @@ -1251,9 +1235,6 @@ virDomainDefPostParseCommon(virDomainDef *def, if (virDomainDefPostParseMemory(def, data->parseFlags) < 0) return -1; =20 - if (virDomainDefPostParseOs(def) < 0) - return -1; - virDomainDefPostParseMemtune(def); =20 if (virDomainDefRejectDuplicateControllers(def) < 0) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 9842d6fece..c6717e31cf 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -279,6 +279,12 @@ libxlDomainDefPostParse(virDomainDef *def, def->features[VIR_DOMAIN_FEATURE_ACPI] =3D VIR_TRISTATE_SWITCH= _ON; } =20 + if (def->os.loader && + def->os.loader->path && + !def->os.loader->type) { + def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; + } + /* add implicit balloon device */ if (def->memballoon =3D=3D NULL) { virDomainMemballoonDef *memballoon; diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 519828f6f9..6a074055ca 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1662,6 +1662,11 @@ qemuFirmwareFillDomainCustom(virDomainDef *def) if (!loader) return; =20 + if (loader->path && + !loader->type) { + loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; + } + if (loader->path && !loader->format) { loader->format =3D VIR_STORAGE_FILE_RAW; --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771871985; cv=none; d=zohomail.com; s=zohoarc; b=NshwWv/5r3UhCDntPuSsXqhNXVrIcV/p7intV7UaWbTCByCCMssxRDpLq33FcRSSBDA/BjRvX8iaNprWxqKcTJZ5zr7OCaMmkfAZmyZaTVctalleoz3sKFOr777kEhBu99xOe5DFr/s8PLcoEbxr/jkvUp6U5SStQmx6h6dF/X4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871985; 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=sx//IRWi8L8hAOEFetDHmxM0CnBkBzCQz29djigG2CY=; b=mAKnGlVR9kA9I5PBunZ43cVqbsgg8LNEzgEXwFKrfRRnfxUXHG4fzcBGisXJH5SDY5+saaXPqexuSFHgLerNV5v76fbDs4cvkx6BE9Xsbfi8IysoYCkupvlNkgTQBg39CatqhiCHTb/7AVgM0JTFHQSHOHebZYlCdrjC81vHY8M= 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 1771871984981460.80077223492117; Mon, 23 Feb 2026 10:39:44 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0DDDC41C78; Mon, 23 Feb 2026 13:39:44 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 014FA41A88; Mon, 23 Feb 2026 13:34:21 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 568B841B54; Mon, 23 Feb 2026 13:34:14 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 5C41D41AFC for ; Mon, 23 Feb 2026 13:31:37 -0500 (EST) 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-325-KOcm-7jWPOmNgrot2WFI8Q-1; Mon, 23 Feb 2026 13:31:35 -0500 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 EE5341956088 for ; Mon, 23 Feb 2026 18:31:34 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C50DF1955D71 for ; Mon, 23 Feb 2026 18:31:33 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871497; 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=sx//IRWi8L8hAOEFetDHmxM0CnBkBzCQz29djigG2CY=; b=iSpDLjp9MSkKB5jTJDqOBMk08yZ05LAOVJrd5kBOkGMi4FsJN87vVYrw1hU7a9WizgkSJc EiLKGq6InYK9PUAp/jJR67ILosop6mpvci/3UayMDS/PWu9MgQXgVf/TzCUaF+MF/Fr3Kg /rPrlEbItF0Z5MjvG67ilKjJUazQziw= X-MC-Unique: KOcm-7jWPOmNgrot2WFI8Q-1 X-Mimecast-MFC-AGG-ID: KOcm-7jWPOmNgrot2WFI8Q_1771871495 To: devel@lists.libvirt.org Subject: [PATCH v4 05/36] tests: Rename custom JSON firmware descriptors Date: Mon, 23 Feb 2026 19:30:48 +0100 Message-ID: <20260223183119.501349-6-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: 4DnNLnVX5_94yL75T9-HZucrnCMEAVuHWmHi_aSze_M_1771871495 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5TQM535C7CN73LOVWUUJPFXIALRVJZLU X-Message-ID-Hash: 5TQM535C7CN73LOVWUUJPFXIALRVJZLU 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: 1771871985465158500 Most of the JSON firmware descriptors in our test suite come from the Fedora package for edk2, but there are a few additional ones that we have created ourselves to ensure coverage of uncommon or problematic scenarios. In order to make sure that such descriptors are clearly marked as custom, rename them to include the string "libvirt" in the path. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Acked-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrang=C3=A9 --- .../etc/qemu/firmware/20-bios.json | 1 - .../etc/qemu/firmware/20-libvirt-bios.json | 1 + .../etc/qemu/firmware/59-combined.json | 1 - .../etc/qemu/firmware/59-libvirt-combined.json | 1 + .../{92-masked.json =3D> 92-libvirt-masked.json} | 0 .../{10-bios.json =3D> 10-libvirt-bios.json} | 0 ...90-combined.json =3D> 90-libvirt-combined.json} | 0 .../{91-bios.json =3D> 91-libvirt-bios.json} | 0 .../{92-masked.json =3D> 92-libvirt-masked.json} | 0 .../{93-invalid.json =3D> 93-libvirt-invalid.json} | 0 tests/qemufirmwaretest.c | 16 ++++++++-------- 11 files changed, 10 insertions(+), 10 deletions(-) delete mode 120000 tests/qemufirmwaredata/etc/qemu/firmware/20-bios.json create mode 120000 tests/qemufirmwaredata/etc/qemu/firmware/20-libvirt-bio= s.json delete mode 120000 tests/qemufirmwaredata/etc/qemu/firmware/59-combined.js= on create mode 120000 tests/qemufirmwaredata/etc/qemu/firmware/59-libvirt-com= bined.json rename tests/qemufirmwaredata/etc/qemu/firmware/{92-masked.json =3D> 92-li= bvirt-masked.json} (100%) rename tests/qemufirmwaredata/home/user/.config/qemu/firmware/{10-bios.jso= n =3D> 10-libvirt-bios.json} (100%) rename tests/qemufirmwaredata/usr/share/qemu/firmware/{90-combined.json = =3D> 90-libvirt-combined.json} (100%) rename tests/qemufirmwaredata/usr/share/qemu/firmware/{91-bios.json =3D> 9= 1-libvirt-bios.json} (100%) rename tests/qemufirmwaredata/usr/share/qemu/firmware/{92-masked.json =3D>= 92-libvirt-masked.json} (100%) rename tests/qemufirmwaredata/usr/share/qemu/firmware/{93-invalid.json =3D= > 93-libvirt-invalid.json} (100%) diff --git a/tests/qemufirmwaredata/etc/qemu/firmware/20-bios.json b/tests/= qemufirmwaredata/etc/qemu/firmware/20-bios.json deleted file mode 120000 index 2c274dddc2..0000000000 --- a/tests/qemufirmwaredata/etc/qemu/firmware/20-bios.json +++ /dev/null @@ -1 +0,0 @@ -../../../usr/share/qemu/firmware/91-bios.json \ No newline at end of file diff --git a/tests/qemufirmwaredata/etc/qemu/firmware/20-libvirt-bios.json = b/tests/qemufirmwaredata/etc/qemu/firmware/20-libvirt-bios.json new file mode 120000 index 0000000000..fab8877c3e --- /dev/null +++ b/tests/qemufirmwaredata/etc/qemu/firmware/20-libvirt-bios.json @@ -0,0 +1 @@ +../../../usr/share/qemu/firmware/91-libvirt-bios.json \ No newline at end of file diff --git a/tests/qemufirmwaredata/etc/qemu/firmware/59-combined.json b/te= sts/qemufirmwaredata/etc/qemu/firmware/59-combined.json deleted file mode 120000 index da9099ffb7..0000000000 --- a/tests/qemufirmwaredata/etc/qemu/firmware/59-combined.json +++ /dev/null @@ -1 +0,0 @@ -../../../usr/share/qemu/firmware/90-combined.json \ No newline at end of file diff --git a/tests/qemufirmwaredata/etc/qemu/firmware/59-libvirt-combined.j= son b/tests/qemufirmwaredata/etc/qemu/firmware/59-libvirt-combined.json new file mode 120000 index 0000000000..74e63c4574 --- /dev/null +++ b/tests/qemufirmwaredata/etc/qemu/firmware/59-libvirt-combined.json @@ -0,0 +1 @@ +../../../usr/share/qemu/firmware/90-libvirt-combined.json \ No newline at end of file diff --git a/tests/qemufirmwaredata/etc/qemu/firmware/92-masked.json b/test= s/qemufirmwaredata/etc/qemu/firmware/92-libvirt-masked.json similarity index 100% rename from tests/qemufirmwaredata/etc/qemu/firmware/92-masked.json rename to tests/qemufirmwaredata/etc/qemu/firmware/92-libvirt-masked.json diff --git a/tests/qemufirmwaredata/home/user/.config/qemu/firmware/10-bios= .json b/tests/qemufirmwaredata/home/user/.config/qemu/firmware/10-libvirt-b= ios.json similarity index 100% rename from tests/qemufirmwaredata/home/user/.config/qemu/firmware/10-bios.= json rename to tests/qemufirmwaredata/home/user/.config/qemu/firmware/10-libvirt= -bios.json diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/90-combined.jso= n b/tests/qemufirmwaredata/usr/share/qemu/firmware/90-libvirt-combined.json similarity index 100% rename from tests/qemufirmwaredata/usr/share/qemu/firmware/90-combined.json rename to tests/qemufirmwaredata/usr/share/qemu/firmware/90-libvirt-combine= d.json diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json b/= tests/qemufirmwaredata/usr/share/qemu/firmware/91-libvirt-bios.json similarity index 100% rename from tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json rename to tests/qemufirmwaredata/usr/share/qemu/firmware/91-libvirt-bios.js= on diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/92-masked.json = b/tests/qemufirmwaredata/usr/share/qemu/firmware/92-libvirt-masked.json similarity index 100% rename from tests/qemufirmwaredata/usr/share/qemu/firmware/92-masked.json rename to tests/qemufirmwaredata/usr/share/qemu/firmware/92-libvirt-masked.= json diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/93-invalid.json= b/tests/qemufirmwaredata/usr/share/qemu/firmware/93-libvirt-invalid.json similarity index 100% rename from tests/qemufirmwaredata/usr/share/qemu/firmware/93-invalid.json rename to tests/qemufirmwaredata/usr/share/qemu/firmware/93-libvirt-invalid= .json diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c index 2eb9d8e701..e09f50592b 100644 --- a/tests/qemufirmwaretest.c +++ b/tests/qemufirmwaretest.c @@ -84,7 +84,7 @@ testFWPrecedence(const void *opaque G_GNUC_UNUSED) g_autofree char *fakehome =3D NULL; g_auto(GStrv) fwList =3D NULL; const char *expected[] =3D { - SYSCONFDIR "/qemu/firmware/20-bios.json", + SYSCONFDIR "/qemu/firmware/20-libvirt-bios.json", PREFIX "/share/qemu/firmware/30-edk2-ovmf-4m-qcow2-x64-sb-enrolled= .json", PREFIX "/share/qemu/firmware/31-edk2-ovmf-2m-raw-x64-sb-enrolled.j= son", PREFIX "/share/qemu/firmware/40-edk2-ovmf-4m-qcow2-x64-sb.json", @@ -98,12 +98,12 @@ testFWPrecedence(const void *opaque G_GNUC_UNUSED) PREFIX "/share/qemu/firmware/51-edk2-ovmf-2m-raw-x64-nosb.json", PREFIX "/share/qemu/firmware/52-edk2-aarch64-verbose-qcow2.json", PREFIX "/share/qemu/firmware/53-edk2-aarch64-verbose-raw.json", - SYSCONFDIR "/qemu/firmware/59-combined.json", + SYSCONFDIR "/qemu/firmware/59-libvirt-combined.json", PREFIX "/share/qemu/firmware/60-edk2-ovmf-x64-amdsev.json", PREFIX "/share/qemu/firmware/60-edk2-ovmf-x64-inteltdx.json", - PREFIX "/share/qemu/firmware/90-combined.json", - PREFIX "/share/qemu/firmware/91-bios.json", - PREFIX "/share/qemu/firmware/93-invalid.json", + PREFIX "/share/qemu/firmware/90-libvirt-combined.json", + PREFIX "/share/qemu/firmware/91-libvirt-bios.json", + PREFIX "/share/qemu/firmware/93-libvirt-invalid.json", NULL }; const char **e; @@ -285,9 +285,9 @@ mymain(void) DO_PARSE_TEST("usr/share/qemu/firmware/53-edk2-aarch64-verbose-raw.jso= n"); DO_PARSE_TEST("usr/share/qemu/firmware/60-edk2-ovmf-x64-amdsev.json"); DO_PARSE_TEST("usr/share/qemu/firmware/60-edk2-ovmf-x64-inteltdx.json"= ); - DO_PARSE_TEST("usr/share/qemu/firmware/90-combined.json"); - DO_PARSE_TEST("usr/share/qemu/firmware/91-bios.json"); - DO_PARSE_FAILURE_TEST("usr/share/qemu/firmware/93-invalid.json"); + DO_PARSE_TEST("usr/share/qemu/firmware/90-libvirt-combined.json"); + DO_PARSE_TEST("usr/share/qemu/firmware/91-libvirt-bios.json"); + DO_PARSE_FAILURE_TEST("usr/share/qemu/firmware/93-libvirt-invalid.json= "); =20 if (virTestRun("QEMU FW precedence test", testFWPrecedence, NULL) < 0) ret =3D -1; --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771871915; cv=none; d=zohomail.com; s=zohoarc; b=iIWfWtCwLzLWJeqhNTJ2Uqhh6BCjaB9y+BTRoxqbY8FkbIAJoXO3cZYaXrynMvoXzNA9Cvx/C1oRVHGyODvvUlPKyE1dlTmqadzR5mH7ZT7MdoESzr0KqBXIAhkLBHtMPTCuClDw0pCDB7uok6T/ookm5voa40kLpavCbbfnPqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771871915; 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=YPLRF0RjzPRMol61TFyvN0wRBTdEcu038pbkbGlWh2A=; b=d8LpF+VYXN1oGr3widD+B0w79tU8pVZzFNbd9QjTrfPWtsN7vtPo40sKV7Tn2LrH+yms7EQFwif4JWI5N+3a8xiSzOK1SALN0ECY8rTH8HXr3Q67A4zfP3KkyOu0jqqwJiYpzQNVG5LWoXI/UDcYeL9YKbETcPNjK1WUNb18DrI= 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 1771871915538580.1502253019809; Mon, 23 Feb 2026 10:38:35 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6736B41BC5; Mon, 23 Feb 2026 13:38:34 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8B40A41CA3; Mon, 23 Feb 2026 13:34:19 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id EC85741A07; Mon, 23 Feb 2026 13:34:13 -0500 (EST) 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 BF917419EA for ; Mon, 23 Feb 2026 13:31:39 -0500 (EST) Received: from mx-prod-mc-06.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-164-eOId_YerPUKjRTQQHTO-TQ-1; Mon, 23 Feb 2026 13:31:37 -0500 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8EA81800451 for ; Mon, 23 Feb 2026 18:31:36 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A16441955D71 for ; Mon, 23 Feb 2026 18:31:35 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871499; 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=YPLRF0RjzPRMol61TFyvN0wRBTdEcu038pbkbGlWh2A=; b=YjCRoVKqURNQ47nOzG3xEBdQZBOo/SJRBsgIXQWdpuMS9XLTy/l06aj8GsGIN6w6wizE+u GSGJ75C6nVPIreef2gkAJ/eZn33e8pWJ48DHPumz+BJphycpzsw/TQiI8b47lx8n8WUEtU uTDokTrSDcU1pcRIydUdm/FdiRELON8= X-MC-Unique: eOId_YerPUKjRTQQHTO-TQ-1 X-Mimecast-MFC-AGG-ID: eOId_YerPUKjRTQQHTO-TQ_1771871496 To: devel@lists.libvirt.org Subject: [PATCH v4 06/36] schema: Introduce osnvram define Date: Mon, 23 Feb 2026 19:30:49 +0100 Message-ID: <20260223183119.501349-7-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: EM9i7fgOJMjYByeAupqVoDw7MZRyP6twcxr5XxGqQSk_1771871496 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Y327UK2ZLSE4VOVQ2OAQBBMHW26UWAFI X-Message-ID-Hash: Y327UK2ZLSE4VOVQ2OAQBBMHW26UWAFI 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: 1771871917275158500 Content-Type: text/plain; charset="utf-8"; x-default="true" This moves the definition of the element out of the fairly complex oshvm define and will make it easier to later add the element without making things unmanageable. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/conf/schemas/domaincommon.rng | 54 +++++++++++++++++-------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index dafbdc63e7..e09f6e80f3 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -349,31 +349,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -452,6 +428,34 @@ =20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771872071; cv=none; d=zohomail.com; s=zohoarc; b=Wn21ym+HG+iNMaMgy/rje5duGZgtxWFV3Ccad/+98vBWmG4JUbjfQpNNMn/AXLGz9qpc8r9dKhRjFBPnSQSs+/miNtqtRz+uFed2N9R3ebBWq7uX71pP+j20TXje5cskZozZk5ITLubc3fVGaeWhMt750MXF5I6VLorh0xp4+/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771872071; 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=68uRN2TGu4stNLup+dSLgULnAdD7X/w0Gx4Ip0qCeLk=; b=GytwIeIZsu70yTuJvaKQKru4VgBG2hhvpUlIA7QvxDivZV7R+WspqHxZOYLec8kn3x7AJBh/xhUpKdYU9TNNBJAlbAsUcqYL9vsA1fnIBO14R1ajI+rkXhqk8DjIMFmuUNf/ZfZIsJnf5QbBwEO7qoVbsJsPbxxuNlMC8imXCOo= 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 1771872071416802.5524051570453; Mon, 23 Feb 2026 10:41:11 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8494141BC1; Mon, 23 Feb 2026 13:41:10 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B78FA41D29; Mon, 23 Feb 2026 13:34:24 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 87626419DD; Mon, 23 Feb 2026 13:34:14 -0500 (EST) 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 09BF8419CA for ; Mon, 23 Feb 2026 13:31:42 -0500 (EST) Received: from mx-prod-mc-01.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-624-GPGgBRRpOOaoLBBr3UqtiQ-1; Mon, 23 Feb 2026 13:31:40 -0500 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4CBA019560A5 for ; Mon, 23 Feb 2026 18:31:39 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A052F1955D71 for ; Mon, 23 Feb 2026 18:31:37 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871501; 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=68uRN2TGu4stNLup+dSLgULnAdD7X/w0Gx4Ip0qCeLk=; b=DMKj+YBUhm8gA3oiWK31hvE+D5D4khAre6lN6Rqki0XRH19Bxs+JGkhuPrfLD2QvWILM+l Ocps/yLs/zHbEDzXCqaxbq6oxoq3no0ss7e/dgM/9NtdWf4p6qJJn3Fub3B2k4MsA7uplE HyB74Rs+LLsuO0hkHO5JKsOsYs3+yoQ= X-MC-Unique: GPGgBRRpOOaoLBBr3UqtiQ-1 X-Mimecast-MFC-AGG-ID: GPGgBRRpOOaoLBBr3UqtiQ_1771871499 To: devel@lists.libvirt.org Subject: [PATCH v4 07/36] conf: Parse and format varstore element Date: Mon, 23 Feb 2026 19:30:50 +0100 Message-ID: <20260223183119.501349-8-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: T9-kEIvHb8PlNiV4eoRWhz58O9BYaFWu018gtI_6Qpc_1771871499 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2VWXEJTGP3J3GXIZWBYER7EDR74JJWXN X-Message-ID-Hash: 2VWXEJTGP3J3GXIZWBYER7EDR74JJWXN 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: 1771872072036158500 Content-Type: text/plain; charset="utf-8"; x-default="true" This will be used to configure the backing storage used by the uefi-vars QEMU device. Dealing with the element itself is trivial, however we have to refactor the existing code which deals with the loader and nvram elements slightly: in particular, we can no longer perform an early exit if those elements are absent. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 23 +++++++-- docs/kbase/secureboot.rst | 46 +++++++++++------- src/conf/domain_conf.c | 79 ++++++++++++++++++++++++++++--- src/conf/domain_conf.h | 9 ++++ src/conf/schemas/domaincommon.rng | 22 ++++++++- src/conf/virconftypes.h | 2 + src/libvirt_private.syms | 2 + 7 files changed, 156 insertions(+), 27 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index db664857af..7871613017 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -196,9 +196,9 @@ harddisk, cdrom, network) determining where to obtain/f= ind the boot image. =20 ``firmware`` The ``firmware`` attribute allows management applications to automatica= lly - fill ```` and ```` elements and possibly enable some - features required by selected firmware. Accepted values are ``bios`` and - ``efi``. + fill ```` and ```` or ```` elements and pos= sibly + enable some features required by selected firmware. Accepted values are + ``bios`` and ``efi``. The selection process scans for files describing installed firmware ima= ges in specified location and uses the most specific one which fulfills domain requirements. The locations in order of preference (from generic to most @@ -311,6 +311,23 @@ harddisk, cdrom, network) determining where to obtain/= find the boot image. It is not valid to provide this element if the loader is marked as stateless. =20 +``varstore`` + This works much the same way as the ```` element described abov= e, + except that variable storage is handled by the ``uefi-vars`` QEMU device + instead of being backed by a pflash device. :since:`Since 12.1.0 (QEMU = only)` + + The ``path`` attribute contains the path of the domain-specific file wh= ere + variables are stored, while the ``template`` attribute points to a temp= late + that the domain-specific file can be (re)generated from. Assuming that = the + necessary JSON firmware descriptor files are present, both attributes w= ill + be filled in automatically by libvirt. + + Using ```` instead of ```` is particularly useful on + non-x86 architectures such as aarch64, where it represent the only way = to + get Secure Boot working. It can be used on x86 too, and doing so will m= ake + it possible to keep UEFI authenticated variables safe from tampering wi= thout + requiring the use of SMM emulation. + ``boot`` The ``dev`` attribute takes one of the values "fd", "hd", "cdrom" or "network" and is used to specify the next boot device to consider. The diff --git a/docs/kbase/secureboot.rst b/docs/kbase/secureboot.rst index 6c22b08d22..b411b65f00 100644 --- a/docs/kbase/secureboot.rst +++ b/docs/kbase/secureboot.rst @@ -74,8 +74,8 @@ Changing an existing VM =20 When a VM is defined, libvirt will pick the firmware that best satisfies the provided criteria and record this information for use -on subsequent boots. The resulting XML configuration will look like -this: +on subsequent boots. The resulting XML configuration will look either +like this: =20 :: =20 @@ -88,14 +88,28 @@ this: /var/lib= /libvirt/qemu/nvram/vm_VARS.fd =20 +or like this: + +:: + + + + + + + /usr/share/edk2/aarch64/QEMU_EFI.q= emuvars.fd + + + In order to force libvirt to repeat the firmware autoselection -process, it's necessary to remove the ```` and ```` -elements. Failure to do so will likely result in an error. +process, it's necessary to remove the ```` as well as the +```` or ```` elements, depending on what's +applicable. Failure to do so will likely result in an error. =20 Note that updating the XML configuration as described above is -**not** enough to change the Secure Boot status: the NVRAM file -associated with the VM has to be regenerated from its template as -well. +**not** enough to change the Secure Boot status: the NVRAM/varstore +file associated with the VM has to be regenerated from its template +as well. =20 In order to do that, update the XML and then start the VM with =20 @@ -107,9 +121,9 @@ This option is only available starting with libvirt 8.1= .0, so if your version of libvirt is older than that you will have to delete the NVRAM file manually before starting the VM. =20 -Most guest operating systems will be able to cope with the NVRAM file -being reinitialized, but in some cases the VM will be unable to boot -after the change. +Most guest operating systems will be able to cope with the +NVRAM/varstore file being reinitialized, but in some cases the VM +will be unable to boot after the change. =20 =20 Additional information @@ -126,15 +140,15 @@ can be used to validate the operating system signatur= e need to be provided as well. =20 Asking for the ``enrolled-keys`` firmware feature to be enabled will -cause libvirt to initialize the NVRAM file associated with the VM -from a template that contains a suitable set of keys. These keys -being present will cause the firmware to enforce the Secure Boot +cause libvirt to initialize the NVRAM/varstore file associated with +the VM from a template that contains a suitable set of keys. These +keys being present will cause the firmware to enforce the Secure Boot signing requirements. =20 The opposite configuration, where the feature is explicitly disabled, -will result in no keys being present in the NVRAM file. Unable to -verify signatures, the firmware will allow even unsigned operating -systems to run. +will result in no keys being present in the NVRAM/varstore file. +Unable to verify signatures, the firmware will allow even unsigned +operating systems to run. =20 If running unsigned code is desired, it's also possible to ask for the ``secure-boot`` feature to be disabled, which will cause libvirt diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 453e301041..1384e9f3ab 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3960,6 +3960,27 @@ virDomainLoaderDefFree(virDomainLoaderDef *loader) g_free(loader); } =20 +virDomainVarstoreDef * +virDomainVarstoreDefNew(void) +{ + virDomainVarstoreDef *def =3D NULL; + + def =3D g_new0(virDomainVarstoreDef, 1); + + return def; +} + +void +virDomainVarstoreDefFree(virDomainVarstoreDef *varstore) +{ + if (!varstore) + return; + + g_free(varstore->path); + g_free(varstore->template); + g_free(varstore); +} + =20 static void virDomainResctrlMonDefFree(virDomainResctrlMonDef *domresmon) @@ -4062,6 +4083,7 @@ virDomainOSDefClear(virDomainOSDef *os) virDomainOSACPITableDefFree(os->acpiTables[i]); g_free(os->acpiTables); virDomainLoaderDefFree(os->loader); + virDomainVarstoreDefFree(os->varstore); g_free(os->bootloader); g_free(os->bootloaderArgs); } @@ -18088,6 +18110,17 @@ virDomainLoaderDefParseXMLLoader(virDomainLoaderDe= f *loader, } =20 =20 +static int +virDomainVarstoreDefParseXML(virDomainVarstoreDef *varstore, + xmlNodePtr varstoreNode) +{ + varstore->path =3D virXMLPropString(varstoreNode, "path"); + varstore->template =3D virXMLPropString(varstoreNode, "template"); + + return 0; +} + + static int virDomainLoaderDefParseXML(virDomainLoaderDef *loader, xmlNodePtr loaderNode, @@ -18535,16 +18568,29 @@ virDomainDefParseBootLoaderOptions(virDomainDef *= def, xmlNodePtr loaderNode =3D virXPathNode("./os/loader[1]", ctxt); xmlNodePtr nvramNode =3D virXPathNode("./os/nvram[1]", ctxt); xmlNodePtr nvramSourceNode =3D virXPathNode("./os/nvram/source[1]", ct= xt); + xmlNodePtr varstoreNode =3D virXPathNode("./os/varstore[1]", ctxt); =20 - if (!loaderNode && !nvramNode) - return 0; + if (nvramNode && varstoreNode) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Cannot have both and ")); + return -1; + } =20 - def->os.loader =3D virDomainLoaderDefNew(); + if (loaderNode || nvramNode) { + def->os.loader =3D virDomainLoaderDefNew(); =20 - if (virDomainLoaderDefParseXML(def->os.loader, - loaderNode, nvramNode, nvramSourceNode, - ctxt, xmlopt, flags) < 0) - return -1; + if (virDomainLoaderDefParseXML(def->os.loader, + loaderNode, nvramNode, nvramSourceN= ode, + ctxt, xmlopt, flags) < 0) + return -1; + } + + if (varstoreNode) { + def->os.varstore =3D virDomainVarstoreDefNew(); + + if (virDomainVarstoreDefParseXML(def->os.varstore, varstoreNode) <= 0) + return -1; + } =20 return 0; } @@ -28248,6 +28294,20 @@ virDomainLoaderDefFormat(virBuffer *buf, return 0; } =20 +static int +virDomainVarstoreDefFormat(virBuffer *buf, + virDomainVarstoreDef *varstore) +{ + g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; + + virBufferEscapeString(&attrBuf, " template=3D'%s'", varstore->template= ); + virBufferEscapeString(&attrBuf, " path=3D'%s'", varstore->path); + + virXMLFormatElementEmpty(buf, "varstore", &attrBuf, NULL); + + return 0; +} + static void virDomainKeyWrapDefFormat(virBuffer *buf, virDomainKeyWrapDef *keywrap) { @@ -29720,6 +29780,11 @@ virDomainDefFormatInternalSetRootName(virDomainDef= *def, if (def->os.loader && virDomainLoaderDefFormat(buf, def->os.loader, xmlopt, flags) < 0) return -1; + + if (def->os.varstore && + virDomainVarstoreDefFormat(buf, def->os.varstore) < 0) + return -1; + virBufferEscapeString(buf, "%s\n", def->os.kernel); virBufferEscapeString(buf, "%s\n", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index a13f6d79e9..e63230beec 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2423,6 +2423,14 @@ struct _virDomainLoaderDef { virDomainLoaderDef *virDomainLoaderDefNew(void); void virDomainLoaderDefFree(virDomainLoaderDef *loader); =20 +struct _virDomainVarstoreDef { + char *path; + char *template; +}; + +virDomainVarstoreDef *virDomainVarstoreDefNew(void); +void virDomainVarstoreDefFree(virDomainVarstoreDef *varstore); + typedef enum { VIR_DOMAIN_IOAPIC_NONE =3D 0, VIR_DOMAIN_IOAPIC_QEMU, @@ -2576,6 +2584,7 @@ struct _virDomainOSDef { size_t nacpiTables; virDomainOSACPITableDef **acpiTables; virDomainLoaderDef *loader; + virDomainVarstoreDef *varstore; char *bootloader; char *bootloaderArgs; int smbios_mode; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index e09f6e80f3..376218118d 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -349,7 +349,10 @@ - + + + + @@ -456,6 +459,23 @@ =20 + + + + + + + + + + + + + + + + + diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index 6e2573035a..0596791a4d 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -164,6 +164,8 @@ typedef struct _virDomainLeaseDef virDomainLeaseDef; =20 typedef struct _virDomainLoaderDef virDomainLoaderDef; =20 +typedef struct _virDomainVarstoreDef virDomainVarstoreDef; + typedef struct _virDomainMemballoonDef virDomainMemballoonDef; =20 typedef struct _virDomainMemoryDef virDomainMemoryDef; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index b200037189..19edf7eb12 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -719,6 +719,8 @@ virDomainTPMProfileRemoveDisabledTypeToString; virDomainTPMVersionTypeFromString; virDomainTPMVersionTypeToString; virDomainUSBDeviceDefForeach; +virDomainVarstoreDefFree; +virDomainVarstoreDefNew; virDomainVideoDefaultRAM; virDomainVideoDefClear; virDomainVideoDefFree; --=20 2.53.0 From nobody Tue Mar 3 03:06:30 2026 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=1771872250; cv=none; d=zohomail.com; s=zohoarc; b=Q8ZQZxQGogCGKlGvkm7nQt3j5/pjSkiDkYtFZ7ONt91+KBiZFc1ZsbQsq3VEwwymIlc9YV7JnYGj9mMCKfFRxcLMHUfanymjmNKYeh9754wJg9r36DeQxzwOWSmQZsz0ubEWSaX5cAoA6gGS5X1Dp5GrVSgYSZyp2tkPjS8yLK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771872250; 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=keT7FYa8RvEzAB/RNjHpKZ8NZ3Gg/PhfzeJF9NrkHQs=; b=gFCqfluH4TvMU+8Nshcn3xDgi4YfQEhx8q0D2nveniNjm9m7MaaV0HDB1BQZtnVFcZg2FSjcNafFp2bzk17teQGtHbBsx8xhfffkkbaJuwQVEweb86kAjsk/I+4oYZXA08gHVsX9Gs773rHNPr0HfmQNs9LrqRBjSlvn5l2OxHg= 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 1771872250741863.034235560119; Mon, 23 Feb 2026 10:44:10 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id DB6BA41AF0; Mon, 23 Feb 2026 13:44:09 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B4AC141DC7; Mon, 23 Feb 2026 13:34:30 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D291741B17; Mon, 23 Feb 2026 13:34:15 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 B102641B1D for ; Mon, 23 Feb 2026 13:31:43 -0500 (EST) Received: from mx-prod-mc-06.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-103-QkfhAZWNMJG08sTuxmx2tg-1; Mon, 23 Feb 2026 13:31:42 -0500 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 564631800282 for ; Mon, 23 Feb 2026 18:31:41 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.44.32.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1908B1955D71 for ; Mon, 23 Feb 2026 18:31:39 +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=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1771871503; 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=keT7FYa8RvEzAB/RNjHpKZ8NZ3Gg/PhfzeJF9NrkHQs=; b=Mhe7mafoEF5nJ5TKVAUA6Qb/zTu9Q8l/0M73u5v4EaZQCstL474IATY0HuFk/0G7UFZ/ML lKowjML3gWRJTdViGEOF3iYra9xq4ERR9KdrC4jDbTC+qnWBaR+dkdiexlMcE6yVG2J3k9 tf3gGHNu+cc3vnkVAawn3bH4//KVB8Y= X-MC-Unique: QkfhAZWNMJG08sTuxmx2tg-1 X-Mimecast-MFC-AGG-ID: QkfhAZWNMJG08sTuxmx2tg_1771871501 To: devel@lists.libvirt.org Subject: [PATCH v4 08/36] conf: Update validation to consider varstore element Date: Mon, 23 Feb 2026 19:30:51 +0100 Message-ID: <20260223183119.501349-9-abologna@redhat.com> In-Reply-To: <20260223183119.501349-1-abologna@redhat.com> References: <20260223183119.501349-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-MFC-PROC-ID: pJOuHha1mif3tqg-n_Hz7L2uqnwXeIHNa9KPcEOgCUk_1771871501 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GSK4C6EFOG52MGBX3GHEZHCRBFXZH5DN X-Message-ID-Hash: GSK4C6EFOG52MGBX3GHEZHCRBFXZH5DN 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: 1771872251219158500 The code is reworked quite significantly, but most of the existing checks are preserved. Those that aren't, notably the one that allowed pflash as the only acceptable non-stateless firmware type, are intentionally removed because they will no longer reflect reality once support for the uefi-vars QEMU device is introduced. As a side effect, reworking the function in this fashion resolves a subtle bug: due to the early exits that were being performed when the loader element was missing, the checks at the bottom of the function (related to the shim and kernel elements) were effectively never performed. This is no longer the case. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Acked-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_validate.c | 82 +++++++------------ ...-auto-bios-not-stateless.x86_64-latest.err | 2 +- ...-auto-bios-not-stateless.x86_64-latest.xml | 35 ++++++++ ...firmware-auto-bios-nvram.x86_64-latest.err | 2 +- ...nual-bios-not-stateless.x86_64-latest.args | 32 ++++++++ ...anual-bios-not-stateless.x86_64-latest.err | 1 - ...anual-bios-not-stateless.x86_64-latest.xml | 28 +++++++ ...nual-efi-nvram-stateless.x86_64-latest.err | 2 +- ...nvram-template-stateless.x86_64-latest.err | 2 +- ...ware-manual-efi-rw-nvram.x86_64-latest.err | 2 +- tests/qemuxmlconftest.c | 7 +- 11 files changed, 135 insertions(+), 60 deletions(-) create mode 100644 tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.= x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/firmware-manual-bios-not-stateles= s.x86_64-latest.args delete mode 100644 tests/qemuxmlconfdata/firmware-manual-bios-not-stateles= s.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/firmware-manual-bios-not-stateles= s.x86_64-latest.xml diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 1ad614935f..7e3da84767 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1723,100 +1723,78 @@ virDomainDefOSValidate(const virDomainDef *def, virDomainXMLOption *xmlopt) { virDomainLoaderDef *loader =3D def->os.loader; + virDomainVarstoreDef *varstore =3D def->os.varstore; + virDomainOsDefFirmware firmware =3D def->os.firmware; + int *firmwareFeatures =3D def->os.firmwareFeatures; + bool usesNvram =3D loader && (loader->nvram || loader->nvramTemplate |= | loader->nvramTemplateFormat); =20 - if (def->os.firmware) { + if (firmware) { if (xmlopt && !(xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_F= W_AUTOSELECT)) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("firmware auto selection not implemented for = this driver")); return -1; } =20 - if (def->os.firmwareFeatures && - def->os.firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_EN= ROLLED_KEYS] =3D=3D VIR_TRISTATE_BOOL_YES && - def->os.firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_SE= CURE_BOOT] =3D=3D VIR_TRISTATE_BOOL_NO) { + if (firmwareFeatures && + firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_ENROLLED_K= EYS] =3D=3D VIR_TRISTATE_BOOL_YES && + firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_SECURE_BOO= T] =3D=3D VIR_TRISTATE_BOOL_NO) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("firmware feature 'enrolled-keys' cannot be e= nabled when firmware feature 'secure-boot' is disabled")); return -1; } - - if (!loader) - return 0; - - if (loader->nvram && def->os.firmware !=3D VIR_DOMAIN_OS_DEF_FIRMW= ARE_EFI) { - virReportError(VIR_ERR_XML_DETAIL, - _("firmware type '%1$s' does not support nvram"= ), - virDomainOsDefFirmwareTypeToString(def->os.firm= ware)); - return -1; - } } else { - if (def->os.firmwareFeatures) { + if (firmwareFeatures) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("cannot use feature-based firmware autoselect= ion when firmware autoselection is disabled")); return -1; } =20 - if (!loader) - return 0; - - if (!loader->path) { + if (loader && !loader->path) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("no loader path specified and firmware auto s= election disabled")); return -1; } } =20 - if (loader->readonly =3D=3D VIR_TRISTATE_BOOL_NO) { - if (loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_ROM) { + if (loader && loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_ROM) { + if (loader->readonly =3D=3D VIR_TRISTATE_BOOL_NO) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("ROM loader type cannot be used as read/write= ")); return -1; } =20 - if (loader->nvramTemplate) { - virReportError(VIR_ERR_XML_DETAIL, "%s", - _("NVRAM template is not permitted when loader = is read/write")); + if (loader->format && + loader->format !=3D VIR_STORAGE_FILE_RAW) { + virReportError(VIR_ERR_XML_DETAIL, + _("Invalid format '%1$s' for ROM loader type"), + virStorageFileFormatTypeToString(loader->format= )); return -1; } + } =20 - if (loader->nvram) { + if (usesNvram && varstore) { virReportError(VIR_ERR_XML_DETAIL, "%s", - _("NVRAM is not permitted when loader is read/w= rite")); + _("Only one of NVRAM/varstore can be used")); return -1; - } } =20 - if (loader->stateless =3D=3D VIR_TRISTATE_BOOL_YES) { - if (loader->nvramTemplate) { - virReportError(VIR_ERR_XML_DETAIL, "%s", - _("NVRAM template is not permitted when loader = is stateless")); + if (usesNvram || varstore) { + if (firmware && firmware !=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { + virReportError(VIR_ERR_XML_DETAIL, + _("Firmware type '%1$s' does not support variab= le storage (NVRAM/varstore)"), + virDomainOsDefFirmwareTypeToString(firmware)); return -1; } =20 - if (loader->nvram) { - virReportError(VIR_ERR_XML_DETAIL, "%s", - _("NVRAM is not permitted when loader is statel= ess")); - return -1; - } - } else if (loader->stateless =3D=3D VIR_TRISTATE_BOOL_NO) { - if (def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) { - if (def->os.loader->type !=3D VIR_DOMAIN_LOADER_TYPE_PFLASH) { - virReportError(VIR_ERR_XML_DETAIL, "%s", - _("Only pflash loader type permits NVRAM")); - return -1; - } - } else if (def->os.firmware !=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { + if (loader && loader->stateless =3D=3D VIR_TRISTATE_BOOL_YES) { virReportError(VIR_ERR_XML_DETAIL, "%s", - _("Only EFI firmware permits NVRAM")); + _("Variable storage (NVRAM/varstore) is not per= mitted when loader is stateless")); return -1; } - } =20 - if (loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_ROM) { - if (loader->format && - loader->format !=3D VIR_STORAGE_FILE_RAW) { - virReportError(VIR_ERR_XML_DETAIL, - _("Invalid format '%1$s' for ROM loader type"), - virStorageFileFormatTypeToString(loader->format= )); + if (loader && loader->readonly =3D=3D VIR_TRISTATE_BOOL_NO) { + virReportError(VIR_ERR_XML_DETAIL, "%s", + _("Variable storage (NVRAM/varstore) is not per= mitted when loader is read/write")); return -1; } } diff --git a/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-= latest.err b/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-= latest.err index b058f970a4..743fe27a97 100644 --- a/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-latest.= err +++ b/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-latest.= err @@ -1 +1 @@ -Only EFI firmware permits NVRAM +operation failed: Unable to find 'bios' firmware that is compatible with t= he current configuration diff --git a/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-= latest.xml b/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-= latest.xml new file mode 100644 index 0000000000..062835e351 --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-auto-bios-not-stateless.x86_64-latest.= xml @@ -0,0 +1,35 @@ + + guest + 63840878-0deb-4095-97e6-fc444d9bc9fa + 1048576 + 1048576 + 1 + + hvm + + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + +