From nobody Mon Feb 9 12:15:26 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=1656000976; cv=none; d=zohomail.com; s=zohoarc; b=CYKBl4ZHYwARRoTKNydyOrZ07nS/fan2KepuWpQ/c8G2YmrhNmdhGpN7Vd4Gzt6wekxSnkUfKq55PnjFwTgg1Xy8Ymx7nmGEMMDzccNGrmsXu5m96GDf3L448J8RUAbZQPUHeq8xSicf/0xouGZdHpU/hxuSU6/69FkDFrBHdG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656000976; 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=cHvBRN5PNp3a51QbaGPnIuR7jG715OrMqqiAQCLPZOg=; b=mn6GgS/ymgzKsBSzVf0mpOzzX2eSbBSdkfl5pmB68yAq4b5vHflF7sCU238pB9VZEfrQXo0nDq6T6mbaonigz1Czj1IAtrTuvFb6pSBrOhtxLWtu8G0PB2c9JOp3pN4fEHkyhVNpvMFDX1VBjBlWfLT4Fmoi0RLAW1ZV8uDc54M= 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 1656000976559213.9844785539459; Thu, 23 Jun 2022 09:16:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-194-qkhxEzIBOiGBYZhvCAPW4g-1; Thu, 23 Jun 2022 12:15:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 341FE398CA8B; Thu, 23 Jun 2022 16:15:04 +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 1C9CC1415111; Thu, 23 Jun 2022 16:15:04 +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 D9721194B969; Thu, 23 Jun 2022 16:15:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C3B7E194B950 for ; Thu, 23 Jun 2022 16:15:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B330E1121315; Thu, 23 Jun 2022 16:15:00 +0000 (UTC) Received: from harajuku.homenet.telecomitalia.it (unknown [10.40.194.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41DF31121314 for ; Thu, 23 Jun 2022 16:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656000975; 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=cHvBRN5PNp3a51QbaGPnIuR7jG715OrMqqiAQCLPZOg=; b=RB5H1MrbQ/155eV6/aVMGmqq/f5fujP+yDT4gZ1TZMo+UtFerdtcFaRG+xCUSym1oRwZw9 yQMKptX9g8Q0OvA78+4/pPPsUeE8FoXbMyB0BX+4eKoaUJsbK/2aUCq8kvnOXA0CpbDyxN +PD36vha6VcRv96EJLHJY/oiQmq2P4s= X-MC-Unique: qkhxEzIBOiGBYZhvCAPW4g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 23/28] conf: Always parse firmware features Date: Thu, 23 Jun 2022 18:14:35 +0200 Message-Id: <20220623161440.61653-24-abologna@redhat.com> In-Reply-To: <20220623161440.61653-1-abologna@redhat.com> References: <20220623161440.61653-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1656000977970100003 Content-Type: text/plain; charset="utf-8" Regardless of whether firmware autoselection is in use, we still want to parse the list of requested features. Doing this will allow us to produce better error messages. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7947b1f5e6..fb8bf4cfec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18439,20 +18439,6 @@ virDomainDefParseBootFirmwareOptions(virDomainDef = *def, int n =3D 0; size_t i; =20 - if (!firmware) - return 0; - - fw =3D virDomainOsDefFirmwareTypeFromString(firmware); - - if (fw <=3D 0) { - virReportError(VIR_ERR_XML_ERROR, - _("unknown firmware value %s"), - firmware); - return -1; - } - - def->os.firmware =3D fw; - if ((n =3D virXPathNodeSet("./os/firmware/feature", ctxt, &nodes)) < 0) return -1; =20 @@ -18479,6 +18465,20 @@ virDomainDefParseBootFirmwareOptions(virDomainDef = *def, =20 def->os.firmwareFeatures =3D g_steal_pointer(&features); =20 + if (!firmware) + return 0; + + fw =3D virDomainOsDefFirmwareTypeFromString(firmware); + + if (fw <=3D 0) { + virReportError(VIR_ERR_XML_ERROR, + _("unknown firmware value %s"), + firmware); + return -1; + } + + def->os.firmware =3D fw; + return 0; } =20 --=20 2.35.3