From nobody Mon Feb 9 18:18:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1576750025; cv=none; d=zohomail.com; s=zohoarc; b=jRYchFydupbM1bc4UDDRwAmNtr7Aoar9/ZGHmbubfxPh3c9hjMevX4Vo5meplWmlsuGtfpq8W3VQUS8/mNXG1qSoS+EFtq4PNLOGPNAH0PyRi+0dqtyR67/0uiEsfKly3IhemMtzTNN3I4uIT07SH8SI851mA9UdCtTbvEDN7+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750025; h=Content-Type:Content-Transfer-Encoding:Cc: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=5S31N4fB5OZphvb5hqfy4fnvqjFUeCJsREDUDfmIPa8=; b=hRQV3J6sQRf7ljQ321Or5q8eeNIaIN3KuJTfhCBMiyVDqaWUiZQyHZLVcytBXVHK2380y2uki5FYs96NZPeONnmSXmpKgTH4Y05p+4aQ2n90+N8HaId2yMMIF+4OgMgWD6GmP2y9wn5UcPvd1o67EobXjINs2fxy7WqKMnjUBSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576750025635761.3522929844484; Thu, 19 Dec 2019 02:07:05 -0800 (PST) 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-321-VdhPikUjMNWRLwOZ0B5Gdw-1; Thu, 19 Dec 2019 05:05:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D1D510071FF; Thu, 19 Dec 2019 10:05:36 +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 759445C54A; Thu, 19 Dec 2019 10:05:36 +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 36CB41800FCB; Thu, 19 Dec 2019 10:05:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBJA5ESX010924 for ; Thu, 19 Dec 2019 05:05:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 86BF926DF9; Thu, 19 Dec 2019 10:05:14 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9F2B26E4B; Thu, 19 Dec 2019 10:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750024; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=5S31N4fB5OZphvb5hqfy4fnvqjFUeCJsREDUDfmIPa8=; b=XQOIBVLnXgIde1UZDh9qGP863eo+ZS9yJjA6vPbOzHG2cYDLuHxiaSKypXY9CVbkQolgly WYsy4WQT/TBvIy0V9eIahK0CVK1BpOJ6rk5OCV5aqQ/L81zS0isFCqBfrs52dUnF4xAldq D3tPzs2mfL9xABypV329zRsV3gBHyjc= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:21 +0100 Message-Id: <20191219100447.210836-17-fidencio@redhat.com> In-Reply-To: <20191219100447.210836-1-fidencio@redhat.com> References: <20191219100447.210836-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH 16/42] rpc: Don't check the output of virGetUserConfigDirectory() 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.16 X-MC-Unique: VdhPikUjMNWRLwOZ0B5Gdw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) virGetUserConfigDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetclient.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 40e5fa35e2..eba8b865d1 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -455,11 +455,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *hos= t, knownhosts =3D g_strdup(knownHostsPath); } else { confdir =3D virGetUserConfigDirectory(); - if (confdir) { - virBufferAsprintf(&buf, "%s/known_hosts", confdir); - if (!(knownhosts =3D virBufferContentAndReset(&buf))) - goto no_memory; - } + virBufferAsprintf(&buf, "%s/known_hosts", confdir); + if (!(knownhosts =3D virBufferContentAndReset(&buf))) + goto no_memory; } =20 if (privkeyPath) { @@ -556,8 +554,7 @@ virNetClientPtr virNetClientNewLibssh(const char *host, knownhosts =3D g_strdup(knownHostsPath); } else { confdir =3D virGetUserConfigDirectory(); - if (confdir) - knownhosts =3D g_strdup_printf("%s/known_hosts", confdir); + knownhosts =3D g_strdup_printf("%s/known_hosts", confdir); } =20 if (privkeyPath) { --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list