From nobody Mon Feb 9 18:18:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1576749962; cv=none; d=zohomail.com; s=zohoarc; b=QNjYiRsu7J8Y8du8A32oSdULX7FlxzSt7rYNdqkOExkTNeXAKhwH1AZegwxxMpcgmW8KCEryXoQHPgZAqrIaBH8bLKv2TfWYT0d/begI1w+JSqWidRxabd0grVMjqdmWP1dzXG/De2+NrDn4Lon2xmDEuhECtgtjB6zBJkamayg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749962; 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=LGKAe0DYm4hCJgXIFtP0/wMLlx+ykXmc+E0OvXOIv4c=; b=YNXbGvz5y6lSfAEZhtrdWyF04Km6XhLm7y6+x97seWinNPkqxK7HGYQX6UC8s8GFl9pXxnYZzjdSwWf5e6H6WuvdNAKleD/4WL9fwgtmJRR69CoxN4C8cYwq2XTUrXRkkaBK5zhn0BjF3haXvkScRy7e650C42uytv/d3IyNJ2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1576749962595263.03680233887474; Thu, 19 Dec 2019 02:06:02 -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-317-FACT7wGdMp64coGy1l9hkQ-1; Thu, 19 Dec 2019 05:05:59 -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 8D74D100551B; Thu, 19 Dec 2019 10:05:52 +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 6C56B5C54A; Thu, 19 Dec 2019 10:05:52 +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 26D8B104908; Thu, 19 Dec 2019 10:05:52 +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 xBJA5Mko011010 for ; Thu, 19 Dec 2019 05:05:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6500126E49; Thu, 19 Dec 2019 10:05:22 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B800426DF9; Thu, 19 Dec 2019 10:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749961; 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=LGKAe0DYm4hCJgXIFtP0/wMLlx+ykXmc+E0OvXOIv4c=; b=TE+eRXn0JTmqeHL8RL5OgT92Y57+DAQPSa5OgYk2g3x8tCmzvy+4+gS6pySPv0+kFUlh9r LSRAwJxsGu4GoNZD/xNeQU1vFIwNAiuCBKGEyxTKJrL1ALrxnyx2NF0oda3oIw8j10SSp5 MOuMDNCx/US7Xtsj1UCfe0xHSUPf7BA= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:29 +0100 Message-Id: <20191219100447.210836-25-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 24/42] util: 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.16 X-MC-Unique: FACT7wGdMp64coGy1l9hkQ-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/util/virhostdev.c | 3 +-- src/util/virpidfile.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 78e409732a..9b4ea30216 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -182,8 +182,7 @@ virHostdevManagerNew(void) g_autofree char *rundir =3D NULL; mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return NULL; + rundir =3D virGetUserRuntimeDirectory(); =20 hostdevMgr->stateDir =3D g_strdup_printf("%s/hostdevmgr", rundir); =20 diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 249515aff2..b08e0d8d52 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -488,8 +488,7 @@ virPidFileConstructPath(bool privileged, } *pidfile =3D g_strdup_printf("%s/%s.pid", runstatedir, progname); } else { - if (!(rundir =3D virGetUserRuntimeDirectory())) - return -1; + rundir =3D virGetUserRuntimeDirectory(); =20 if (virFileMakePathWithMode(rundir, 0700) < 0) { virReportSystemError(errno, --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list