From nobody Mon Feb 9 17:05:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676457847; cv=none; d=zohomail.com; s=zohoarc; b=Wlc+840CAvowsvyAudWfA4TxGJPHJUObPyHWe1x1UsRzIq0szs6m5U1Ha9649r6GGUy+C/ruSaVZfAxiWqGZiyG4a3pNgxQ7/6EgzcshOEIMpnaZONfAgB++Ur02lBsLJmRQ03U9o7LSbMCmo+axmS4tJsHTY/sGBks0QrZhkIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676457847; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CAgBKyPy3EAS6MZtp7FRxaw6h131gseXshFO6MUUUTI=; b=VAFLTnA42LsUptJkQs1Ca4fPAnoJEi9zwlwEaO68/6lK/64KQ/RM+4g1p0opf6AL/Pq8ctYGRebjX9REyqgKak32Iu7kdMzcCEcyWbdz4Pav9POsq35sTqOwr0obHMEBR0+bySbxDFz8BdCFCwP+UC3O3l/gutIK5vioOun8gVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676457847827998.0471297992768; Wed, 15 Feb 2023 02:44:07 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-164-pSw0qZsOMKy18LTxNe9qvg-1; Wed, 15 Feb 2023 05:42:50 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D77588B7A8; Wed, 15 Feb 2023 10:42:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B395492B15; Wed, 15 Feb 2023 10:42:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3FD2B19465A3; Wed, 15 Feb 2023 10:42:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3F9B619465B2 for ; Wed, 15 Feb 2023 10:42:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2250A140EBF4; Wed, 15 Feb 2023 10:42:44 +0000 (UTC) Received: from harajuku.usersys.redhat.com (ovpn-194-29.brq.redhat.com [10.40.194.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A494F14171B6 for ; Wed, 15 Feb 2023 10:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676457846; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CAgBKyPy3EAS6MZtp7FRxaw6h131gseXshFO6MUUUTI=; b=QxokN6XE+UkKFMGgmBI1Kb+bwP+j3ZzauLFgN9SAk3dMJscpVdG7IaI11tmYd+76723Zbq p11NIWrjlwmYN1ZhSp7Y61guLgLJICI8mwKn5PGxu/USyWms7GVIvYf8RFAWEmCaolmNAH HGCf/l1xKzTLlbJn/lLACZAcROriNIo= X-MC-Unique: pSw0qZsOMKy18LTxNe9qvg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 14/33] qemu: Only fill nvramTemplate for local sources Date: Wed, 15 Feb 2023 11:42:11 +0100 Message-Id: <20230215104230.980815-15-abologna@redhat.com> In-Reply-To: <20230215104230.980815-1-abologna@redhat.com> References: <20230215104230.980815-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676457848136100008 Content-Type: text/plain; charset="utf-8"; x-default="true" It doesn't make sense for non-local sources, since we can't create or reset the corresponding NVRAM file. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_firmware.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 13bac9490a..175a4db21d 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1194,15 +1194,20 @@ qemuFirmwareEnableFeatures(virQEMUDriver *driver, return -1; } =20 - VIR_FREE(loader->nvramTemplate); - loader->nvramTemplate =3D g_strdup(flash->nvram_template.filen= ame); - if (!loader->nvram) { loader->nvram =3D virStorageSourceNew(); loader->nvram->type =3D VIR_STORAGE_TYPE_FILE; loader->nvram->format =3D VIR_STORAGE_FILE_RAW; qemuDomainNVRAMPathFormat(cfg, def, &loader->nvram->path); } + + /* If the NVRAM is not a local path then we can't create or + * reset it, so in that case filling in the nvramTemplate + * field would be misleading */ + VIR_FREE(loader->nvramTemplate); + if (loader->nvram && virStorageSourceIsLocalStorage(loader->nv= ram)) { + loader->nvramTemplate =3D g_strdup(flash->nvram_template.f= ilename); + } } =20 VIR_DEBUG("decided on firmware '%s' template '%s' NVRAM '%s'", --=20 2.39.1