From nobody Mon Feb 9 17:57:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1576749956; cv=none; d=zohomail.com; s=zohoarc; b=SkrodJGfbDTrQqC9+7i8ZZ5/a7K/NVi95Fqw0oU/oiQitGwJCKR74GXJ+aj0d5F971zvAvUj8ptOYwcGog/wlQF3vmzYHhfa+vyvfzslzcSHblIuc+KbNCKrCg/uWHTjMoPpnnsH9tGokkJJZ7I2PfArvFqKq5kE118yA4Chf78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749956; 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=nKChdu45lJxyiAh9j3R88zvoa8zAeJcs4vhrTR7Fd3U=; b=PlsNJ33kXGEMx4mbzH5TuvdDHqIuwWprXxr7QJJyg7dkemNnghKz91kbf2NFqgNLMMzklUGe9N4ATFjBZBTpeKIZp4nQvXRSiUMXVhq0DCAVuOvSZVoyT+AMUQ8mYltpbwaaeloTptr7YCMc49n9tuMKVhcgFOMIQ3TZ+NpgdYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1576749956759649.4012934138933; Thu, 19 Dec 2019 02:05:56 -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-56-huKPsstaMueKMK6NEUaeJQ-1; Thu, 19 Dec 2019 05:05:53 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06C57800595; Thu, 19 Dec 2019 10:05:48 +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 D5E067E46D; Thu, 19 Dec 2019 10:05:47 +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 913C118034EB; Thu, 19 Dec 2019 10:05:47 +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 xBJA5VqD011078 for ; Thu, 19 Dec 2019 05:05:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4D63926DF9; Thu, 19 Dec 2019 10:05:31 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21C5626E56; Thu, 19 Dec 2019 10:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749955; 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=nKChdu45lJxyiAh9j3R88zvoa8zAeJcs4vhrTR7Fd3U=; b=B4wkTiuk5rb6yQr+K/eprGGIDuuJEGdF68D1GrPa/j5P/aUKQsbWTA9O5ZoEBmUiunDFfH XK9ddEL0aZIGXjCwjwYnz1xLSpG+hqzN0XmkUE3nOiubsdXGAcAQbBOtyz33vSF34pGDeA 6eBDDsDfXxLhLWTZT6FGkGBaIxJLcOk= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:33 +0100 Message-Id: <20191219100447.210836-29-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 28/42] remote: Don't check the output of virGetUserRuntimeDirectory() 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.13 X-MC-Unique: huKPsstaMueKMK6NEUaeJQ-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) virGetUserRuntimeDirectory() *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/remote/remote_daemon.c | 8 +------- src/remote/remote_driver.c | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index b400b1dd10..5893492875 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -245,8 +245,7 @@ daemonUnixSocketPaths(struct daemonConfig *config, } else { mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto cleanup; + rundir =3D virGetUserRuntimeDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { @@ -1208,11 +1207,6 @@ int main(int argc, char **argv) { run_dir =3D g_strdup(RUNSTATEDIR "/libvirt"); } else { run_dir =3D virGetUserRuntimeDirectory(); - - if (!run_dir) { - VIR_ERROR(_("Can't determine user directory")); - goto cleanup; - } } if (privileged) old_umask =3D umask(022); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index e684fcba09..c11f73ab4d 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -779,8 +779,7 @@ remoteGetUNIXSocketHelper(remoteDriverTransport transpo= rt, remoteDriverTransportTypeToString(transport)); return NULL; } - if (!(userdir =3D virGetUserRuntimeDirectory())) - return NULL; + userdir =3D virGetUserRuntimeDirectory(); =20 sockname =3D g_strdup_printf("%s/%s-sock", userdir, sock_prefix); } else { --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list