From nobody Mon Feb 9 10:32:31 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=1642171221; cv=none; d=zohomail.com; s=zohoarc; b=FB5fxtHMFgWdKzuSitLL/yaUlylHYsIIk8cQBMRqU8BAuFjSp1IUxhs5lk3wA1EcgoCuSZYvoav1kooIZKWt2jyz7YdgcIWmKOAN+a3Ut3ZfdctwHoE7Aofd0s4cJOOiK0k8RmzW0sN7khedradtlRqzSLxTKa1bWKkzV6nb19I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171221; 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=c2p031f8FPt0deN/0nf870mW4CQM6rRvizCrDPAPnks=; b=lhAGMrlN5DRr4AfVvkfeHMiv2c64G66UjIfuCTorYog36Z/IdQba4Pngx11SHi6+D9k43I6nbfrsHZc4K4Iwe+JrDK6BHlrFTE7wraJpUdySCZniVEqxI2OeFCoBss2fMibnPR8orMKyJKhOwXD3WatH4VhglEyVdkyblz6akjY= 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 1642171221085402.16533458346385; Fri, 14 Jan 2022 06:40:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-yu-eA1abOj2uHSr4Q9SBhQ-1; Fri, 14 Jan 2022 09:40:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7334B874981; Fri, 14 Jan 2022 14:40:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4AB6B77440; Fri, 14 Jan 2022 14:40:13 +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 12D514CA9B; Fri, 14 Jan 2022 14:40:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EEe92u029220 for ; Fri, 14 Jan 2022 09:40:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id BAA337B6ED; Fri, 14 Jan 2022 14:40:09 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39E027B6EB for ; Fri, 14 Jan 2022 14:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171219; 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=c2p031f8FPt0deN/0nf870mW4CQM6rRvizCrDPAPnks=; b=V4ZjHhnE68JnJudGlDKiDBm46rVwixBDMvRrmSIdyBX095T3E21tRRK/lH60L/9wVKZ6hJ CHcqQU9kW6DKYBvgaaBj3aHSlR6UOijsOwIwW+KUf/GBj0qz5DoNEis6AWSd2l12Vejdcy wrdTA2Y/WnvjEHJBKZ3POe5yJlXF3DE= X-MC-Unique: yu-eA1abOj2uHSr4Q9SBhQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 02/11] virconf: Report an error in when virConfSetValue() fails Date: Fri, 14 Jan 2022 15:39:46 +0100 Message-Id: <13ebdbe15a4ff30bcf75a12f0657e5e19fc6e0ce.1642171139.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.15 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: 1642171223125100003 Content-Type: text/plain; charset="utf-8" Callers of virConfSetValue() don't report any error, they just pass the error blindly. Therefore, report an error when virConfSetValue() is about to fail. Signed-off-by: Michal Privoznik --- src/util/virconf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virconf.c b/src/util/virconf.c index 07ecfc7b57..29b3622791 100644 --- a/src/util/virconf.c +++ b/src/util/virconf.c @@ -1329,6 +1329,9 @@ virConfSetValue(virConf *conf, virConfEntry *prev =3D NULL; =20 if (value && value->type =3D=3D VIR_CONF_STRING && value->str =3D=3D N= ULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("expecting a value for value of type %s"), + virConfTypeToString(VIR_CONF_STRING)); virConfFreeValue(value); return -1; } --=20 2.34.1