From nobody Tue Feb 10 05:43:57 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=1770647962; cv=none; d=zohomail.com; s=zohoarc; b=OlAoTtoI5b8ysv0FVY8tvlJLyPJBJEHjQ9T1UT8xvtEqjDPO4P6vqtrufZX7EpPUj23xuDBY6jRv5LfsxAaDuGDKL9/lUhogStor9Duadfu1XLTap0wYqrDJPdcobr5c3xPjJJw7wb5/nMSeB7z4wgpQU3n5tlN3kNyMTdti/vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770647962; 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=OLAwKGbswdZHre4VYOlDLM0gLTFMREWVI/zslvqAm74=; b=dUA/CizkNk9M4K+va797twK+lWuz3JsZuYlkP9cUhRcWCaoHyzt4utKTnnCzpNDFDs3a/hYrGvVXYNctqZWV+9xjn5j7NXyCDKc/2BN7xaVAqmzhCJKUOxD6iO782+EshrNfZR56eYTwdlp8CUr9hB0Hifvp8IBvzQ37TxEcNJA= 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 1770647962224538.1701703340505; Mon, 9 Feb 2026 06:39:22 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id A423C43FB3; Mon, 9 Feb 2026 09:39:21 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5CF6944432; Mon, 9 Feb 2026 09:05:34 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2300241B64; Mon, 9 Feb 2026 09:02:35 -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 B591F43F78 for ; Mon, 9 Feb 2026 08:47:52 -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-284-Rk1A0Q6-M7Kcus_YudETZQ-1; Mon, 09 Feb 2026 08:47:51 -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 72E811955F27 for ; Mon, 9 Feb 2026 13:47:50 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.226.251]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B14D01956053 for ; Mon, 9 Feb 2026 13:47:49 +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=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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=1770644872; 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=OLAwKGbswdZHre4VYOlDLM0gLTFMREWVI/zslvqAm74=; b=F5odqeCKNv2O+W+6muHghjFk3bi1CKRw4Xy8qW+z9ua8UxpxjZmvP+wCHN+0T8KhScmObj 1Oi978WNtont+dQKsvyZH8CZRYt8DQcz+h+MkT8Gcc5vTJrEw3ELoF+amosDnxLCsPa2vb jx6Cy5bO2MjDweHv9iGnCE0WeW6H/mM= X-MC-Unique: Rk1A0Q6-M7Kcus_YudETZQ-1 X-Mimecast-MFC-AGG-ID: Rk1A0Q6-M7Kcus_YudETZQ_1770644870 To: devel@lists.libvirt.org Subject: [PATCH v2 28/38] qemu_firmware: Generate varstore path when necessary Date: Mon, 9 Feb 2026 14:47:02 +0100 Message-ID: <20260209134712.296670-29-abologna@redhat.com> In-Reply-To: <20260209134712.296670-1-abologna@redhat.com> References: <20260209134712.296670-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: KoftsU-7gikfCOJb6bTmzy9DrMiokWUTMTq8QJhpt6E_1770644870 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: E24RNFI6G75ZUFOGX56EREWB4D3ZMWHL X-Message-ID-Hash: E24RNFI6G75ZUFOGX56EREWB4D3ZMWHL 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: 1770647963730154101 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduce qemuFirmwareEnsureVarstore(), which performs the same task as the existing qemuFirmwareEnsureNVRAM() but for the varstore element. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_firmware.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index efa7477a05..0fb463a228 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1069,6 +1069,38 @@ qemuFirmwareEnsureNVRAM(virDomainDef *def, } =20 =20 +/** + * qemuFirmwareEnsureVarstore: + * @def: domain definition + * @driver: QEMU driver + * + * Make sure that information for the varstore is present. This might + * involve automatically generating the corresponding path. + */ +static void +qemuFirmwareEnsureVarstore(virDomainDef *def, + virQEMUDriver *driver) +{ + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + virDomainLoaderDef *loader =3D def->os.loader; + virDomainVarstoreDef *varstore =3D def->os.varstore; + + if (!loader) + return; + + if (loader->type !=3D VIR_DOMAIN_LOADER_TYPE_ROM) + return; + + if (!varstore) + return; + + if (varstore->path) + return; + + varstore->path =3D g_strdup_printf("%s/%s.json", + cfg->varstoreDir, def->name); +} + =20 /** * qemuFirmwareSetOsFeatures: @@ -2064,10 +2096,11 @@ qemuFirmwareFillDomain(virQEMUDriver *driver, } } =20 - /* Always ensure that the NVRAM path is present, even if we - * haven't found a match: the configuration might simply be - * referring to a custom firmware build */ + /* Always ensure that the NVRAM/varstore is configured where + * appropriate, even if we haven't found a match: the configuration + * might simply be referring to a custom firmware build */ qemuFirmwareEnsureNVRAM(def, driver, abiUpdate); + qemuFirmwareEnsureVarstore(def, driver); =20 return 0; } --=20 2.53.0