From nobody Wed May 15 10:09:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1620652592; cv=none; d=zohomail.com; s=zohoarc; b=E+0JxHP6l5gnNAz8RP7+J1gpiCedpCm54YcJl6JQMs22VNTx/hVfM43nzBhGjN6dBUHRN1M3lstsPrn7RigbcGf/YjUHdHY+PUFvMzPTPx6USLhYL8OOYykwq4giHYjryOBTKVMQk2dYoKEjVCq7uEtC2tw0LsfWL6+ijTFTxt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620652592; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=n6TFMbZEjrlqFYx7niP7yPmiEF7yUQVaH4dyF4Ns+/c=; b=Zxg4glLOgW5WY/OhVq3AI+J16E8/8kyk5YTWqR9FTw7jYoPGOTkDz0/o7Iyq/hi7dB15F6F4yBJrGRsWUyNYh0TI6QpoisViTJLZJ8lsHb1R5KVeDU1Pfds8AXsfK6boiWA9yepCdHO6rElmJdfZytzmOnwCpSnLrF50A1xcEYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620652592446921.4518663087264; Mon, 10 May 2021 06:16:32 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-574-w48DWl4zMMqn_mygagDI4g-1; Mon, 10 May 2021 09:16:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E1481006C80; Mon, 10 May 2021 13:16:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20A8D2DAD6; Mon, 10 May 2021 13:16:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3A2F318095C2; Mon, 10 May 2021 13:16:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14ADGFkI007884 for ; Mon, 10 May 2021 09:16:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id C54606268E; Mon, 10 May 2021 13:16:15 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.196.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38B3662499 for ; Mon, 10 May 2021 13:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620652590; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=n6TFMbZEjrlqFYx7niP7yPmiEF7yUQVaH4dyF4Ns+/c=; b=X46AGIAIpbo6kvzvxy0s5W6+9vbWV+mLlWOv7MySK79/2k/b7rlRuF7SC7mqNOmWudbJIx cjP9PsBKe/SncmZqQKSJNqXK+cf2VIksH5dfF8uwDEl+MvHVOa4+rHLbuiIptzGhGo2fbM +hcnxykUmyR2ivuGNBUdbBVosky6ebk= X-MC-Unique: w48DWl4zMMqn_mygagDI4g-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu_firmware: don't error out for unknown firmware features Date: Mon, 10 May 2021 15:16:11 +0200 Message-Id: <0537120d36cec911d65d50392425af4f4387bcff.1620652543.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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) Content-Type: text/plain; charset="utf-8" When QEMU introduces new firmware features libvirt will fail until we list that feature in our code as well which doesn't sound right. We should simply ignore the new feature until we add a proper support for it. Reported-by: Laszlo Ersek Signed-off-by: Pavel Hrdina Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_firmware.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 94e88ebe4b..e37a7edefa 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -567,6 +567,7 @@ qemuFirmwareFeatureParse(const char *path, virJSONValue *featuresJSON; g_autoptr(qemuFirmwareFeature) features =3D NULL; size_t nfeatures; + size_t nparsed =3D 0; size_t i; =20 if (!(featuresJSON =3D virJSONValueObjectGetArray(doc, "features"))) { @@ -586,17 +587,16 @@ qemuFirmwareFeatureParse(const char *path, int tmp; =20 if ((tmp =3D qemuFirmwareFeatureTypeFromString(tmpStr)) <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown feature %s"), - tmpStr); - return -1; + VIR_DEBUG("unknown feature %s", tmpStr); + continue; } =20 - features[i] =3D tmp; + features[nparsed] =3D tmp; + nparsed++; } =20 fw->features =3D g_steal_pointer(&features); - fw->nfeatures =3D nfeatures; + fw->nfeatures =3D nparsed; return 0; } =20 --=20 2.30.2