From nobody Wed Feb 11 06:32:24 2026 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=1648225630; cv=none; d=zohomail.com; s=zohoarc; b=HvLIk4BB8UAAfFVLuOzVsM6akVTO5bSIiQqAnjrYTMkTo/Q0aIvmTnuguElG406qy5vXrsZsQo+WoItGIjRr3EMv/+SpDVcv/XK+gv2bTGkPRpophOlBovR40pnJ0VA33jTUKBTQhCXJLYZQTVJp1uIsfggIo2i15xLOt9C/D80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648225630; 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=w898d4uqbnzVitaBOZa+2uDnILGwmaEHyZcJNdupNik=; b=d2Ik+DQjyjWB24yLBFdkmy2wHNEkcq+cD5/mHf/LNAZfrKiauWeR/QXsqDiWEAw0kNtEnTnqTVhNzbppuRzPLx7mcHqIMJTu1dz8IdfewX/7vDGXYfciw8lx01/KZGPJ9AursYBPtNdhJmg8GGJV9QrA77OCizvnCCxJ+Hai+0A= 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) 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 1648225630455323.7920483124159; Fri, 25 Mar 2022 09:27:10 -0700 (PDT) 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-606-iwUIpE21NAy_QPrHDwZDBg-1; Fri, 25 Mar 2022 12:27:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE7C3100BAB6; Fri, 25 Mar 2022 16:27:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 911E0C27E8A; Fri, 25 Mar 2022 16:27: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 A3AEA1940379; Fri, 25 Mar 2022 16:27:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E78BE193F515 for ; Fri, 25 Mar 2022 16:26:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CC3DF5E8A4C; Fri, 25 Mar 2022 16:26:59 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A5945E8A42 for ; Fri, 25 Mar 2022 16:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648225629; 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=w898d4uqbnzVitaBOZa+2uDnILGwmaEHyZcJNdupNik=; b=VFtDRVIpTp79VocFVeBgQo3+JMHrd6d6iE2QRgbKkB8l/7Veu+bwutW7HN4MxeneIB5qDA Hp1aUlW8YOheqCiUFZpIVAho1N5qveDO5YqG+dPt0Nh2sqcSiCNklF3HFef5E/YbCUiaZW z+8T3zVC5sWvRiO428Sz1YX8hc/NeFQ= X-MC-Unique: iwUIpE21NAy_QPrHDwZDBg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [PATCH 7/9] conf: Restore error checking in VideoAccelDefParseXML() Date: Fri, 25 Mar 2022 17:26:50 +0100 Message-Id: <20220325162652.328686-8-abologna@redhat.com> In-Reply-To: <20220325162652.328686-1-abologna@redhat.com> References: <20220325162652.328686-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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.8 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: 1648225631650100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The check that ensures that at least one property among accel3d, accel2d and rendernode has been provided by the user had been lost during the conversion to virXMLPropTristateBool(). Fixes: 0fe2d8dd335054fae38b46bbbac58a4662e1a1d0 Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 68191f42bd..bd98317f4d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14019,23 +14019,31 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) { g_autofree virDomainVideoAccelDef *def =3D NULL; g_autofree char *rendernode =3D NULL; + virTristateBool accel3d; + virTristateBool accel2d; =20 rendernode =3D virXMLPropString(node, "rendernode"); - - def =3D g_new0(virDomainVideoAccelDef, 1); - if (virXMLPropTristateBool(node, "accel3d", - VIR_XML_PROP_NONE, - &def->accel3d) < 0) + VIR_XML_PROP_NONE, &accel3d) < 0) return NULL; - if (virXMLPropTristateBool(node, "accel2d", - VIR_XML_PROP_NONE, - &def->accel2d) < 0) + VIR_XML_PROP_NONE, &accel2d) < 0) return NULL; =20 + if (!rendernode && + accel3d =3D=3D VIR_TRISTATE_BOOL_ABSENT && + accel2d =3D=3D VIR_TRISTATE_BOOL_ABSENT) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("missing values for acceleration")); + return NULL; + } + + def =3D g_new0(virDomainVideoAccelDef, 1); + if (rendernode) def->rendernode =3D virFileSanitizePath(rendernode); + def->accel3d =3D accel3d; + def->accel2d =3D accel2d; =20 return g_steal_pointer(&def); } --=20 2.35.1