From nobody Fri May 3 04:23:13 2024 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=1576749910; cv=none; d=zohomail.com; s=zohoarc; b=bihNFby0H8OXmm91VbFnqAtoadJUdVa9+QpFYWtqYd3ascn1C4ojEYCrx6OqzLT3Fvbef1e8Dpx0d2Ye0+ufIOoxLDfGMjH7j0xJy/wFSfCLn97rtFvPfmPtXmsqCK/CWzAuMQ8cGlNmKB5vj4TNkuINdd0oFYnrtLZYTMyvzIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749910; 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=iQ53azU7+gsCZ4DqX4VoGjCUwPG4rStOdvZvS19rfRc=; b=Rh8ssRvq64fCme9coNLO7a8oBpJtimCyCaBU4A2CeVYK8EEicFOt65WgtdV+Y2zwEoZge2YmZUCQjtDJ9Hr/nYd3DEsdDntrp+U7xfifT9UkgMLzzzYgzwVofA52wZxqX9EIqJCjS+vmun3zFWkovRcylk5VoMQq8uwWMbob3JM= 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 1576749910171741.2009273972589; Thu, 19 Dec 2019 02:05:10 -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-370-QXlEeOOIOKGiEtV5W5sNRw-1; Thu, 19 Dec 2019 05:05:06 -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 C1804800053; Thu, 19 Dec 2019 10:05:01 +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 489426888D; Thu, 19 Dec 2019 10:05:01 +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 60690827D7; Thu, 19 Dec 2019 10:04:57 +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 xBJA4tQV010777 for ; Thu, 19 Dec 2019 05:04:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0CAA526E48; Thu, 19 Dec 2019 10:04:55 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FE7526DF9; Thu, 19 Dec 2019 10:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749908; 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=iQ53azU7+gsCZ4DqX4VoGjCUwPG4rStOdvZvS19rfRc=; b=hktj0dDs3OPOQS7S+HkGQFV3NTwYGUNGn8dcN259bxIO0NwmzPzwngUoQX8e8Z47MU5wA+ ZIhk1wwDHk+P1f+mNR0LPSLAquVXKSc0LtpH0qZPslmzi41y8tZPU3wpQ4eCzQOJ/dNhkG Rl7w0odHpAqyplsqe8oarpN7H9PyTFA= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:06 +0100 Message-Id: <20191219100447.210836-2-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 01/42] tools: Use g_autofree on cmdCd() 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 X-MC-Unique: QXlEeOOIOKGiEtV5W5sNRw-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 5ccda5ab44..bbb6227130 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -3175,8 +3175,7 @@ bool cmdCd(vshControl *ctl, const vshCmd *cmd) { const char *dir =3D NULL; - char *dir_malloced =3D NULL; - bool ret =3D true; + g_autofree char *dir_malloced =3D NULL; char ebuf[1024]; =20 if (!ctl->imode) { @@ -3192,11 +3191,10 @@ cmdCd(vshControl *ctl, const vshCmd *cmd) if (chdir(dir) =3D=3D -1) { vshError(ctl, _("cd: %s: %s"), virStrerror(errno, ebuf, sizeof(ebuf)), dir); - ret =3D false; + return false; } =20 - VIR_FREE(dir_malloced); - return ret; + return true; } =20 const vshCmdOptDef opts_echo[] =3D { --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749929; cv=none; d=zohomail.com; s=zohoarc; b=m/udb3gSPATMbXaHYZgJsdiOcmHPTEFn9Sxx10izAGi0wsFFnc4n18lfPjQXmWi40tEaLSm6QDcEE9qegdvJPIMXKglVWHh4v9oPULHnodyBvbBPS+CpdgKQ0AXAGmT8s8uDDoz2wCYGWHLQCE84sVTGAamCkUgl1IPG8YnH8Cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749929; 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=MylKQP86af955gQhiYHNorG0QcW3Rgh2vEkMWSUAN5U=; b=GrUZTD0rvNhaxjkAu1nAK84ROa3fQ2RQuFpsr1s96F1hYffHqesmWeXqw24SNWrEs6Z3H+tFyenonHQU7Mu1/4xHtwyPZNT535htxa72gpdRGka45l/vTa+FhJYt3tW8k6yxV//0AtCAsVtb+QSJiK5vq3xto/Hnw6uJgveljQY= 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 1576749929439925.0919741844251; Thu, 19 Dec 2019 02:05:29 -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-320-_mAXyD4COniVT7lrSh3RFQ-1; Thu, 19 Dec 2019 05:05:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BC42801E6C; Thu, 19 Dec 2019 10:05:21 +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 ED9E260C87; Thu, 19 Dec 2019 10:05:20 +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 99FDA18089CD; Thu, 19 Dec 2019 10:05:20 +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 xBJA4uIL010785 for ; Thu, 19 Dec 2019 05:04:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0939E26DF9; Thu, 19 Dec 2019 10:04:56 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B6A326E4B; Thu, 19 Dec 2019 10:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749928; 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=MylKQP86af955gQhiYHNorG0QcW3Rgh2vEkMWSUAN5U=; b=CuKv+J8FH/jK6qHJdYh8nC0mOeasFiTKBMxL5ecU41zI5D0fM+bz4MZGINtCsb9Akzuhn+ 7zzpdABH246qPG61P24Ed3aHg7UDgglRoVbrqxBTA0w9OZqbQIeirIIgj8CUt7a8Liam79 rFTMx3Ou7ndJNJD6Jo+9m7oWQxRbTyc= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:07 +0100 Message-Id: <20191219100447.210836-3-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 02/42] vbox: Don't leak virGetUserDirectory()'s output 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.12 X-MC-Unique: _mAXyD4COniVT7lrSh3RFQ-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) On vboxStorageVolCreateXML(), virGetUserDirectory() was called without freeing its content later on. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/vbox/vbox_storage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c index 790b0e4997..7f240c5333 100644 --- a/src/vbox/vbox_storage.c +++ b/src/vbox/vbox_storage.c @@ -410,6 +410,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool, resultCodeUnion resultCode; virStorageVolPtr ret =3D NULL; g_autoptr(virStorageVolDef) def =3D NULL; + g_autofree char *homedir =3D NULL; =20 if (!data->vboxObj) return ret; @@ -442,8 +443,10 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool, } =20 /* If target.path isn't given, use default path ~/.VirtualBox/image_na= me */ - if (!def->target.path) - def->target.path =3D g_strdup_printf("%s/.VirtualBox/%s", virGetUs= erDirectory(), def->name); + if (!def->target.path) { + homedir =3D virGetUserDirectory(); + def->target.path =3D g_strdup_printf("%s/.VirtualBox/%s", homedir,= def->name); + } VBOX_UTF8_TO_UTF16(def->target.path, &hddNameUtf16); =20 if (!hddFormatUtf16 || !hddNameUtf16) --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576749929; cv=none; d=zohomail.com; s=zohoarc; b=iv5s7PSxfmo3cFj7JHrE6PNVZMh+Ce7Yz6KpYbDZulWVgslf4mf/vEfmTUmjf2FfbEqZQUnTaijhm3DpzIxcplT5ETQTVFysRWsO/HYs6Q4fhEEzPp1q3YIrKoFijdaJoOeYpww6jHlsoMYCvjWd7mWoKUZu9G4IowDUZyi9Yv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749929; 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=TaEDuwLoxmvuqdn9Wiij7ssOGZJc18Uc8PRzf79QLLQ=; b=FgUwHeRlUt7+7t2dD2hFvkqOMlFesFrswqi4iXWy7fMxwDthxP+/G+vBTpeYgijDE2FhyetbZAExHhgDeqP3F4d0f3t1EJgIwB81tglofZPh+iG3mw+h80Xfl0pvGzMvWDMdf5m0Uou9VDddwZhWJ4F+8xpuRHO9JDwXPqZUsjY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576749929727994.9651551724975; Thu, 19 Dec 2019 02:05:29 -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-429-rj1NEQCvNbO2qVmgTPeGtg-1; Thu, 19 Dec 2019 05:05:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BFC3DB60; Thu, 19 Dec 2019 10:05:21 +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 38B6826E48; Thu, 19 Dec 2019 10:05:21 +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 D7F8818089C8; Thu, 19 Dec 2019 10:05:20 +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 xBJA4vZI010792 for ; Thu, 19 Dec 2019 05:04:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0396926E48; Thu, 19 Dec 2019 10:04:57 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 577FC26DF9; Thu, 19 Dec 2019 10:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749928; 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=TaEDuwLoxmvuqdn9Wiij7ssOGZJc18Uc8PRzf79QLLQ=; b=Mpb06E8ANXJRsAMR+3GSgckT+Zi28vaP7xiRhlQ/0nkunni+xxNCnxWwr1Ibjb1pUwfmUC pAdz6udLxxR/BRfTbEE8xDQ4VBsuun6VWKYgz+ERr/gE6zyepjcpLx7CJXJvMZmYp0wcHj zCIvlDu+CPX64/xUv9mV3qa0+biDP3M= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:08 +0100 Message-Id: <20191219100447.210836-4-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 03/42] rpc: Use g_autofree on virNetClientNewLibSSH2() 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.84 on 10.5.11.23 X-MC-Unique: rj1NEQCvNbO2qVmgTPeGtg-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetclient.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 47a17d30f7..75e653fec8 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -442,13 +442,13 @@ virNetClientPtr virNetClientNewLibSSH2(const char *ho= st, virNetClientPtr ret =3D NULL; =20 virBuffer buf =3D VIR_BUFFER_INITIALIZER; - char *nc =3D NULL; - char *command =3D NULL; + g_autofree char *nc =3D NULL; + g_autofree char *command =3D NULL; =20 - char *homedir =3D NULL; - char *confdir =3D NULL; - char *knownhosts =3D NULL; - char *privkey =3D NULL; + g_autofree char *homedir =3D NULL; + g_autofree char *confdir =3D NULL; + g_autofree char *knownhosts =3D NULL; + g_autofree char *privkey =3D NULL; =20 /* Use default paths for known hosts an public keys if not provided */ if (knownHostsPath) { @@ -517,12 +517,6 @@ virNetClientPtr virNetClientNewLibSSH2(const char *hos= t, goto cleanup; =20 cleanup: - VIR_FREE(command); - VIR_FREE(privkey); - VIR_FREE(knownhosts); - VIR_FREE(homedir); - VIR_FREE(confdir); - VIR_FREE(nc); return ret; =20 no_memory: --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749911; cv=none; d=zohomail.com; s=zohoarc; b=E5ADEBkBcvTyPorHNb9eeHKhGB/+0rzPGbU28tZGorVK35/CspX0s1Mw+jyG/hLP+D3jnoZhje6GbUE+QHVjEiRSP8pvk8gZ7dWUVS0GCLHMLT61xAfW4EA/iChQLg+lgMmBoHqTmQQvUEDBlDxED3rLKFSa+R5edVUD8oQUqhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749911; 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=UZELUdqhTT+K0jOQq+8R4VSiXpQwxEgelVllk/d0YgI=; b=GuWAsujRzGi4zAVoHvKKQLuRZth4DI4vJsKcB4NtKKEb+ZY6rRUPsIh7XhBgtg5q0tDF95TYLDc8HnQqilzhKMc7vhWUppQbbjxXl2IWAt5zGnHhP07ULG0yvX5rY7YM/ObCykL3pYIdK8IvOyqGL/xw/T6J4Nar7AXoSMajIkM= 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 1576749911422710.6373317476489; Thu, 19 Dec 2019 02:05:11 -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-327-3gCAKYl7NFGy6JRXvp0RLQ-1; Thu, 19 Dec 2019 05:05:07 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CEE01107ACC7; Thu, 19 Dec 2019 10:05:01 +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 623D85DA32; Thu, 19 Dec 2019 10:05:01 +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 9B132827C4; Thu, 19 Dec 2019 10:04:59 +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 xBJA4wXp010800 for ; Thu, 19 Dec 2019 05:04:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id F410A26E48; Thu, 19 Dec 2019 10:04:57 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 524F226DF9; Thu, 19 Dec 2019 10:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749910; 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=UZELUdqhTT+K0jOQq+8R4VSiXpQwxEgelVllk/d0YgI=; b=DxS0FV3ORg+OQ76P7XfJRJHKeeDz5HrKmvPyVZwXtqjOTdgpD1Udu+UNahvM2qsMh6k4x9 OAXbMhRW5q+/vljZ2EyIhiNTgwkD2pAC+9cBPKLYe+TfP59jLJ4IlR7xR76YI4Ruuk0SJT yqGik8/7upFCQe1cbTKqeZ/awcRoDyg= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:09 +0100 Message-Id: <20191219100447.210836-5-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 04/42] rpc: Use g_autofree on virNetClientNewLibssh() 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.14 X-MC-Unique: 3gCAKYl7NFGy6JRXvp0RLQ-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetclient.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 75e653fec8..1b882a261a 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -545,13 +545,13 @@ virNetClientPtr virNetClientNewLibssh(const char *hos= t, virNetClientPtr ret =3D NULL; =20 virBuffer buf =3D VIR_BUFFER_INITIALIZER; - char *nc =3D NULL; - char *command =3D NULL; + g_autofree char *nc =3D NULL; + g_autofree char *command =3D NULL; =20 - char *homedir =3D NULL; - char *confdir =3D NULL; - char *knownhosts =3D NULL; - char *privkey =3D NULL; + g_autofree char *homedir =3D NULL; + g_autofree char *confdir =3D NULL; + g_autofree char *knownhosts =3D NULL; + g_autofree char *privkey =3D NULL; =20 /* Use default paths for known hosts an public keys if not provided */ if (knownHostsPath) { @@ -609,12 +609,6 @@ virNetClientPtr virNetClientNewLibssh(const char *host, goto cleanup; =20 cleanup: - VIR_FREE(command); - VIR_FREE(privkey); - VIR_FREE(knownhosts); - VIR_FREE(homedir); - VIR_FREE(confdir); - VIR_FREE(nc); return ret; =20 no_memory: --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750146; cv=none; d=zohomail.com; s=zohoarc; b=jLyYNlGfefGcwWrHQORnvVx8/OyscCdGUhmzF52ij3gxH1YfcT2eYAPQemDcbb+631FlQQKTMPJqQ7M6bpJcXzqPMKbfjBnPQccFdiqVMvMT+S20LoMJnRDKD9vpzB1uCwCu4mgXEGdy0iUUUK5HifaNltFp9S4IvnoOVIajEOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750146; 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=OJYC2kLcjtr47HaqaOCFXFY/wErQv0n8cVh+vXuALMk=; b=Zdk5wFXFXN1YW7mS9fII4viMzUELq9ZRVa0D59j2z0AykdpALaFjvFMWC4BowBBt7O1O1vnVWZ9SvIGi2XobOuR4jP+ru6EUR4dFg+xAfUq2Ow0ad6qG2tYrbmQxkke7qTvCmB5oWRvP0MecB4ySUxtNj/pAZfM2ZHO0lS6Fzq0= 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 1576750146038928.8572796472321; Thu, 19 Dec 2019 02:09:06 -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-210-3CRXTDlUOgqIdu5rJIJkDg-1; Thu, 19 Dec 2019 05:05:34 -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 8BB3ADB6B; Thu, 19 Dec 2019 10:05:25 +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 5C2026889A; Thu, 19 Dec 2019 10:05:25 +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 10FAC18089D5; Thu, 19 Dec 2019 10:05:25 +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 xBJA4whj010810 for ; Thu, 19 Dec 2019 05:04:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id F014426E48; Thu, 19 Dec 2019 10:04:58 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EC4426DF9; Thu, 19 Dec 2019 10:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750144; 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=OJYC2kLcjtr47HaqaOCFXFY/wErQv0n8cVh+vXuALMk=; b=CHWAS0X8d4ewEuv4EXHyihUEeXvPSVVhOh/Cm3LD2y69KHsJcnGRfHa7uK6UB0sbXfasnK 1AXYS4XGi2u7boWj3wg44NvJ4xb4B0nylkQixwP2xky/SJIntfeYFYbQMEZvcXJDr/7CuL EkoujymaxppFIy/N/4bZ5UXzeDmjiQo= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:10 +0100 Message-Id: <20191219100447.210836-6-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 05/42] rpc: Don't check the output of virGetUserDirectory() 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 X-MC-Unique: 3CRXTDlUOgqIdu5rJIJkDg-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) virGetUserDirectory() *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 | 12 ++++-------- src/rpc/virnettlscontext.c | 12 ------------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 1b882a261a..40e5fa35e2 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -466,10 +466,8 @@ virNetClientPtr virNetClientNewLibSSH2(const char *hos= t, privkey =3D g_strdup(privkeyPath); } else { homedir =3D virGetUserDirectory(); - if (homedir) { - if (virNetClientFindDefaultSshKey(homedir, &privkey) < 0) - goto no_memory; - } + if (virNetClientFindDefaultSshKey(homedir, &privkey) < 0) + goto no_memory; } =20 if (!authMethods) { @@ -566,10 +564,8 @@ virNetClientPtr virNetClientNewLibssh(const char *host, privkey =3D g_strdup(privkeyPath); } else { homedir =3D virGetUserDirectory(); - if (homedir) { - if (virNetClientFindDefaultSshKey(homedir, &privkey) < 0) - goto no_memory; - } + if (virNetClientFindDefaultSshKey(homedir, &privkey) < 0) + goto no_memory; } =20 if (!authMethods) { diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index ec9dd35c46..08944f6771 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -805,9 +805,6 @@ static int virNetTLSContextLocateCredentials(const char= *pkipath, */ userdir =3D virGetUserDirectory(); =20 - if (!userdir) - goto error; - user_pki_path =3D g_strdup_printf("%s/.pki/libvirt", userdir); =20 VIR_DEBUG("Trying to find TLS user credentials in %s", user_pki_pa= th); @@ -864,15 +861,6 @@ static int virNetTLSContextLocateCredentials(const cha= r *pkipath, VIR_FREE(userdir); =20 return 0; - - error: - VIR_FREE(*cacert); - VIR_FREE(*cacrl); - VIR_FREE(*key); - VIR_FREE(*cert); - VIR_FREE(user_pki_path); - VIR_FREE(userdir); - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749940; cv=none; d=zohomail.com; s=zohoarc; b=VuE25JlPST7pgYA3NfuvHT2N7qJrXXrofaSOgw+U0tbfbr9FQPMcZlpov744sUAennDaAhgOTZ1LavXbfULKt0lKKYxFc3cSJzMUm0fOvCsgromy/gfnGv8Q8Xx+FhZhtQir3niOoCpE+/N6B17IoPnTubBvW0HqBBQqIbgYrBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749940; 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=lMmHR4vdum/VRFjtDjqYuscwP/UOqFOtRhhtF+VTTS4=; b=if/Y9x6j+JVzD2MSKJtlQv35j+9mSYgQdGzmUZacjezCBuk94JskG5vtt/qhzpKU2HXO8ViGaRARs2fvh9qPWuK7KlxLV+Y7w0aYSXLoomGDibUqT0cG0kP1tX7uVGoaymiwPhXdFQRd8mhwhj+NZ/tBcI7yfty3MJmz+hvHozQ= 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 1576749940270691.9735433505448; Thu, 19 Dec 2019 02:05:40 -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-34--2Fm-agjNyumQm6U_mwTIg-1; Thu, 19 Dec 2019 05:05:36 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22A6C18FE870; Thu, 19 Dec 2019 10:05:29 +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 EA8CC26E5E; Thu, 19 Dec 2019 10:05:28 +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 8C095827ED; Thu, 19 Dec 2019 10:05:28 +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 xBJA4xs9010818 for ; Thu, 19 Dec 2019 05:05:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id EC58C26DF9; Thu, 19 Dec 2019 10:04:59 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BD3F26E4B; Thu, 19 Dec 2019 10:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749939; 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=lMmHR4vdum/VRFjtDjqYuscwP/UOqFOtRhhtF+VTTS4=; b=V8tHD+ngUENnN9azSQXMrduNnTFpJxqeDq2zyX3wCbaNtuZsDEpjKfHMNqv8A3EnwmiEug zY8FJhEdmDzhaZratMI62kkvGoZJgCAfhbSerUNWaOVI0P3elUodguKyZ4LH3gToXtMDYl Q9IinDe8CuMch7//P6WrgcnejS9MBjo= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:11 +0100 Message-Id: <20191219100447.210836-7-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 06/42] qemu: Don't check the output of virGetUserDirectory() 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.84 on 10.5.11.23 X-MC-Unique: -2Fm-agjNyumQm6U_mwTIg-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) virGetUserDirectory() *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/qemu/qemu_interop_config.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_interop_config.c b/src/qemu/qemu_interop_config.c index cbabde45df..f5f419e630 100644 --- a/src/qemu/qemu_interop_config.c +++ b/src/qemu/qemu_interop_config.c @@ -118,9 +118,6 @@ qemuInteropFetchConfigs(const char *name, if (!xdgConfig) { g_autofree char *home =3D virGetUserDirectory(); =20 - if (!home) - return -1; - xdgConfig =3D g_strdup_printf("%s/.config", home); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749942; cv=none; d=zohomail.com; s=zohoarc; b=kjd2/hr7rjohTlof4tq+/03wh5F2UloH/+SbueYJqaUR2bsx3G0rEadT6/0h4PzRNUgHo4CnHfkZ5pj0HetEQpNCdiObdVmyipcgoK/5c0Vyv5/UzNPy7AUnEATK1UexAKeVU0OP8JLvInfPO2cEJ3wCaaG4roEPZUafvbiJ+N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749942; 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=SOc2VsrAsJHsyBZhE8EdUfSCpoZkApk/RBVr1txVwsw=; b=h3F08KxGBgD3RCZQFI+g/glx15sbRa8nga43W6EHRhIXKWtmps8wCZCK4X+3nAuK3zfU57zyGc53YfxYHxd7ja5+QlZpBdgJLcp7J0WyBTy5dZd2gVBFmC1BLIONIYhrcXzB0fhvJ9goaIOdm6nrBNSx36WJQGbeNN6I2gaf+I0= 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 1576749942762373.20607923120554; Thu, 19 Dec 2019 02:05:42 -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-360-ecNjBKfpPM20_aOnbJnO6A-1; Thu, 19 Dec 2019 05:05:39 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25E3A18FE876; Thu, 19 Dec 2019 10:05:33 +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 F132E26E48; Thu, 19 Dec 2019 10:05:32 +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 A8FA9827F3; Thu, 19 Dec 2019 10:05:32 +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 xBJA50rd010826 for ; Thu, 19 Dec 2019 05:05:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id EA1B626E48; Thu, 19 Dec 2019 10:05:00 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4616B26DF9; Thu, 19 Dec 2019 10:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749941; 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=SOc2VsrAsJHsyBZhE8EdUfSCpoZkApk/RBVr1txVwsw=; b=PS6vzkdR7z1y9zA7jAtYnErvpXYqMZHuBeufHwRILTi5I15G8irldahCVfaMFYBrPkrfBt DowFnIDBB40TfxVc94tzz3UkWLhZLpU/Nh2/U6LFOc4VqjMuC65qLQPTraK9oWQZUDLjo2 eGtBcbYYAAsK5vSOsW7KCq7YgnMMZLM= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:12 +0100 Message-Id: <20191219100447.210836-8-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 07/42] util: 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.84 on 10.5.11.23 X-MC-Unique: ecNjBKfpPM20_aOnbJnO6A-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/util/virauth.c | 3 +-- src/util/virconf.c | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/virauth.c b/src/util/virauth.c index 55208c01ef..f75e674586 100644 --- a/src/util/virauth.c +++ b/src/util/virauth.c @@ -66,8 +66,7 @@ virAuthGetConfigFilePathURI(virURIPtr uri, } } =20 - if (!(userdir =3D virGetUserConfigDirectory())) - return -1; + userdir =3D virGetUserConfigDirectory(); =20 *path =3D g_strdup_printf("%s/auth.conf", userdir); =20 diff --git a/src/util/virconf.c b/src/util/virconf.c index dce84cabb7..cd18ea61e6 100644 --- a/src/util/virconf.c +++ b/src/util/virconf.c @@ -1507,8 +1507,6 @@ virConfLoadConfigPath(const char *name) path =3D g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name); } else { char *userdir =3D virGetUserConfigDirectory(); - if (!userdir) - return NULL; =20 path =3D g_strdup_printf("%s/%s", userdir, name); VIR_FREE(userdir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749950; cv=none; d=zohomail.com; s=zohoarc; b=PCpr1tKHAvh5pWs0HTWjZzYi4jxwBibYkkC0XVmtZSMfH/k+M61wtqya8Bd9v/85VjugxHV/mOHK/rnW72csPQD20W839czpL+ixPT3ebpSaU37dTG4XHgSr9YC2Z1YrfQwn+/OrcRl7+EizRXlfiU9CV4VRskDYwZVQNz93o0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749950; 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=4hNGtkDsQvZauzTCagXDJnaUUSe0Nj+1t2F7ZZ5iBQk=; b=X7HGtpxDHRZiRkuwW3YPkKCyXMr0yCaq68lSvKp9TY7JX430ZcO9E4uzhS6pIxMIiza9tlomU9mxHB7p343YxWZGdTq6YFcSq7V0sqE1LQVH9hnxphioLp/62syHvqRNDZT+V/cZQD/vTyqf7y0XsebPWqe/awtx6GsogEv0z3k= 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 1576749950314186.0749124972732; Thu, 19 Dec 2019 02:05:50 -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-47-skK_spFZOcKBi7em08Gdzg-1; Thu, 19 Dec 2019 05:05:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DF15DDB65; Thu, 19 Dec 2019 10:05:37 +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 BD029620D8; Thu, 19 Dec 2019 10:05:37 +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 78AF9827F9; Thu, 19 Dec 2019 10:05:37 +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 xBJA51Mo010840 for ; Thu, 19 Dec 2019 05:05:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id E850A26E4E; Thu, 19 Dec 2019 10:05:01 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45D1026DF9; Thu, 19 Dec 2019 10:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749949; 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=4hNGtkDsQvZauzTCagXDJnaUUSe0Nj+1t2F7ZZ5iBQk=; b=Li0tapPfD6mSTpubIqUhLExUdEKZnOqCZqCZSeUTTv0Z9pWe+A8uUoN/w5fsjj2y8Jv+KO Ha5/Hjoa/UxBjBb/pdE0x3gjIWd0sns3oVBTTxWCxStg3XHi85JmLFLb6pMDv0XpznLsz9 MQNxznRqQdVpxWEj/Yhll005AJCK6iU= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:13 +0100 Message-Id: <20191219100447.210836-9-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 08/42] storage: 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.11 X-MC-Unique: skK_spFZOcKBi7em08Gdzg-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/storage/storage_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 580a5e6f15..71078dfbd6 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -278,7 +278,7 @@ storageStateInitialize(bool privileged, } else { configdir =3D virGetUserConfigDirectory(); rundir =3D virGetUserRuntimeDirectory(); - if (!(configdir && rundir)) + if (!rundir) goto error; =20 driver->configDir =3D g_strdup_printf("%s/storage", configdir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749967; cv=none; d=zohomail.com; s=zohoarc; b=ckk9vYesrx02v3K5qsGaGqAXQrplAD07UHKDb8zOPaXikPxZQjKdbNfG8wKaQXwdOqVKnhemtbWgj9+nLwnY9wqEjRINz6x/kRo6EzfsokccSQdEf+RVh0+9yCNEUoBZm4AHWqniEAnH4BbU4c3cQK30EqDX+al6Ajge8pl9spA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749967; 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=gwro7WZG/7B7UC28F6ljOSkWE7FufuaJ1CPnZ3QjnFs=; b=C3vPnZ2QQhNNqR4XsDLWpb2T8spYsd7EZyv12BQmx7pr6q5w6nVxOBHlYNI+sFXLf4Em3MAB5QPDoYrGdXUPPPLn5HspL0xnoqmPKpR6mQFOVG10+0kq0gTMBRMPJKVHQuEdaUCtC4OCts/cLmqQ06HNScBW5L+2ovt7rLjud5o= 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 1576749967115518.9147018960558; Thu, 19 Dec 2019 02:06:07 -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-177-7jloAW5vObeSZx7sizLrPQ-1; Thu, 19 Dec 2019 05:05:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B737518FE871; Thu, 19 Dec 2019 10:05:41 +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 8CF0426E48; Thu, 19 Dec 2019 10:05:41 +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 4BE32827FD; Thu, 19 Dec 2019 10:05:41 +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 xBJA5296010850 for ; Thu, 19 Dec 2019 05:05:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id E583126DF9; Thu, 19 Dec 2019 10:05:02 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4280126E55; Thu, 19 Dec 2019 10:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749965; 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=gwro7WZG/7B7UC28F6ljOSkWE7FufuaJ1CPnZ3QjnFs=; b=IxbNcN7TEjE2C5OTHoNvas79r3Hy/n536dVk2z5GAU7g2ochCz5EaK+I9bpyH6SKb5kawz 6JinQlmkFq9iGWuiak/NpcVYoPGm9a1+oBW+COqEeCn3uOiLmNO4YtjaXVWIG201xlMzUI yB7VQ7JdF4ush+a0ButqX861C2jsr9E= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:14 +0100 Message-Id: <20191219100447.210836-10-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 09/42] secret: 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.84 on 10.5.11.23 X-MC-Unique: 7jloAW5vObeSZx7sizLrPQ-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/secret/secret_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 93b4256450..cdc4b7dcf9 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -475,8 +475,7 @@ secretStateInitialize(bool privileged, g_autofree char *rundir =3D NULL; g_autofree char *cfgdir =3D NULL; =20 - if (!(cfgdir =3D virGetUserConfigDirectory())) - goto error; + cfgdir =3D virGetUserConfigDirectory(); driver->configDir =3D g_strdup_printf("%s/secrets/", cfgdir); =20 if (!(rundir =3D virGetUserRuntimeDirectory())) --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749933; cv=none; d=zohomail.com; s=zohoarc; b=QqbwmGG1HXMKgkCH8tAls/tIR7bUCReM/EeEAGfoOQRjoLtwXezOis21xrkYUtAWjECjQMCuSY01S/M1jBjtsFnguq2VvuH19T+/hXEkS8V6tErplAgeRPzalMRXpqThPuIsh95heBZ2IoveHJhw770OyYdYoBEJ5VPaNOXIrAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749933; 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=fYGrFU3xJyAK2fF8tB0VXWav9OttPE33IAO9CZbzF8s=; b=VVr51Qo4luOwbq3PwnIXw1BjicKSuISo3E2ZU8/sHfR4a77MpzRQOUkC5Rdi4XzQJMbHm73HVjvvRMMEHfABDLwJmmWqWTMaPFTUgZFlvwEzhtR392MHu0Z4vwk9alKB6p8VDrmQ67HvydmMd6xF4iJ+yqqgPQ2Si9Pd/dy52lc= 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 1576749933995257.3106195159636; Thu, 19 Dec 2019 02:05:33 -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-324--u_Zw8kVM32mUuW5EvUHzA-1; Thu, 19 Dec 2019 05:05:30 -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 7586FDB6A; Thu, 19 Dec 2019 10:05:25 +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 4D42568890; Thu, 19 Dec 2019 10:05:25 +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 F22B0827E6; Thu, 19 Dec 2019 10:05:24 +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 xBJA537K010855 for ; Thu, 19 Dec 2019 05:05:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id E108326E61; Thu, 19 Dec 2019 10:05:03 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F6F026DF9; Thu, 19 Dec 2019 10:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749932; 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=fYGrFU3xJyAK2fF8tB0VXWav9OttPE33IAO9CZbzF8s=; b=Hy7K6pLYeTVBUIpnxiKOqhWnn9OguKM19jNKzHCI3gQlcV5o92PygSXqtAjiDZSK1laGwV a6frSkwEEDj3NcxtqzugvOd8cpg8Jb1ICOO6GIP1+a6fxU38UpxgrkgdMTr+Fi8hJjoWSm ELoiBW97yZ964g52coeBBZFGg0EF1bE= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:15 +0100 Message-Id: <20191219100447.210836-11-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 10/42] tools: Don't check the output of virGetUserCacheDirectory() 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 X-MC-Unique: -u_Zw8kVM32mUuW5EvUHzA-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) virGetUserCacheDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index bbb6227130..b982aeb359 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2913,11 +2913,6 @@ vshReadlineInit(vshControl *ctl) */ userdir =3D virGetUserCacheDirectory(); =20 - if (userdir =3D=3D NULL) { - vshError(ctl, "%s", _("Could not determine home directory")); - goto cleanup; - } - ctl->historydir =3D g_strdup_printf("%s/%s", userdir, ctl->name); =20 ctl->historyfile =3D g_strdup_printf("%s/history", ctl->historydir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750146; cv=none; d=zohomail.com; s=zohoarc; b=ZEmnw93UB3Nfslf7Rei5ppEfY66BGc5EAn8VRCLAABRgsPUBfOU7xrQTvWOGQ/clwxESzu5u60KdlmWjT73uLpXchhVbWVwO218FjL0EpXXRo/hs4LcmIgKfc92I//XobyS7P+rKHWwEdgFmzp80nTlqDhTqgZX1d1jDDTzygsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750146; 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=whGVKs+b0cuvqA89PQ5W0pzEteoZwLgxMUiWD8dGWNc=; b=PXnFbAeAkM+zC33yqoSjqcjg8MdUguxD8ymG2jqYFNw7TKDH5bzKCYZ5bBm9H1U34boIDfl8A3n8dUDT42TNKnQz06RoXI83/aXdso53X6hI8nnvf8QHNLt3HarxqXDakXWYFXnwAg46/FtqjMeYKtSrATEzgreKAebB0GWBMoI= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576750146059914.1998464671253; Thu, 19 Dec 2019 02:09:06 -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-314-nPQmE62gO4eviEpVPS-OqQ-1; Thu, 19 Dec 2019 05:05:38 -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 41385DB64; Thu, 19 Dec 2019 10:05:29 +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 0454768890; Thu, 19 Dec 2019 10:05:29 +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 A68631808878; Thu, 19 Dec 2019 10:05:28 +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 xBJA5488010860 for ; Thu, 19 Dec 2019 05:05:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id E320026E48; Thu, 19 Dec 2019 10:05:04 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40DCA26DF9; Thu, 19 Dec 2019 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750144; 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=whGVKs+b0cuvqA89PQ5W0pzEteoZwLgxMUiWD8dGWNc=; b=GTyO7L+8YRAp9bNgaNvjilYm/Zw48dfZZv036AhERzP+tyde7NRHwNwaBSO1zhAkn01zWg hNq4NEhVESDqDzOAgZa5QzL6WhC8nzk8zqvBt0VAyWT9XCYBFNq5ppaEoZp1yXMIo3szlw v7Rl5PwmbxNNwY5n8inpu4cCh/ncYRY= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:16 +0100 Message-Id: <20191219100447.210836-12-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 11/42] vbox: Use g_autofree on vboxDomainScreenshot() 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 X-MC-Unique: nPQmE62gO4eviEpVPS-OqQ-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) This also fixes a cacheDir's leak when g_mkstep_full() fails. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/vbox/vbox_common.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 5957ae52c4..586937fa19 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -7341,8 +7341,8 @@ vboxDomainScreenshot(virDomainPtr dom, vboxIID iid; IMachine *machine =3D NULL; nsresult rc; - char *tmp; - char *cacheDir; + g_autofree char *tmp =3D NULL; + g_autofree char *cacheDir =3D NULL; int tmp_fd =3D -1; unsigned int max_screen; bool privileged =3D geteuid() =3D=3D 0; @@ -7383,7 +7383,6 @@ vboxDomainScreenshot(virDomainPtr dom, =20 if ((tmp_fd =3D g_mkstemp_full(tmp, O_RDWR | O_CLOEXEC, S_IRUSR | S_IW= USR)) =3D=3D -1) { virReportSystemError(errno, _("g_mkstemp(\"%s\") failed"), tmp); - VIR_FREE(tmp); VBOX_RELEASE(machine); return NULL; } @@ -7454,8 +7453,6 @@ vboxDomainScreenshot(virDomainPtr dom, =20 VIR_FORCE_CLOSE(tmp_fd); unlink(tmp); - VIR_FREE(tmp); - VIR_FREE(cacheDir); VBOX_RELEASE(machine); vboxIIDUnalloc(&iid); return ret; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749931; cv=none; d=zohomail.com; s=zohoarc; b=AtUgZtoe5U6IQb7mRb3qZh9IImkCW5kWKSRQTtcXNwfz5R/RWrW/aoHwtWpHSxNhW+a//0GQeet2Jtzb7GD9lx5dTjO6/wKImaAHyQgrZbvZVm6+WhwejUIK8pzF3ZhCLCGUsL5qJU2BxDWR6oOqFU2ySHM0L6UfgNA60GSFRLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749931; 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=s2dFEjImIcVHN3PaIQhN2aKk8Mrbtz3cKsWdKRcJAsM=; b=eFMgrHAnXrO+XjGfx/HtP97f53N2QnewRmTBTgHWZptV+SrykFBt3grBNVGaEPYEg9jBT0tiCf5d/bGSlg/jSfO+Km07aSbzh75QswXXt7e2t1dkLaoyJ2XbxQ1NpNbPhgQs/zXMxy8aevEWN0d9R2PkMoeHhGwwZLPvz2xNZXs= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576749931727298.1577367376816; Thu, 19 Dec 2019 02:05:31 -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-340-SvHJqploPmuC_a1GqiIdcQ-1; Thu, 19 Dec 2019 05:05:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74349800D4C; Thu, 19 Dec 2019 10:05:23 +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 472B460C87; Thu, 19 Dec 2019 10:05:23 +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 E863A827E4; Thu, 19 Dec 2019 10:05:22 +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 xBJA55s6010865 for ; Thu, 19 Dec 2019 05:05:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id DECDA26E48; Thu, 19 Dec 2019 10:05:05 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E1BD26DF9; Thu, 19 Dec 2019 10:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749930; 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=s2dFEjImIcVHN3PaIQhN2aKk8Mrbtz3cKsWdKRcJAsM=; b=WhnYwkw+hWhCKrTxj8jvOCKAa4esshUhsOA0Chx8h4XX6K8LxvG+Oog08kcbJTvJuUCrxj UVLK5kgOUUp3R0efQEfxP3amLB1elUVE5qRctfIdEMwngNhmBv0ewZAS62RH+Nzu4QH2ap fQ7hpo6AZuFp4WZQbpWGrzebshBHvMY= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:17 +0100 Message-Id: <20191219100447.210836-13-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 12/42] vbox: Don't check the output of virGetUserCacheDirectory() 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.12 X-MC-Unique: SvHJqploPmuC_a1GqiIdcQ-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) virGetUserCacheDirectory() *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/vbox/vbox_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 586937fa19..4493fe8582 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -7374,9 +7374,8 @@ vboxDomainScreenshot(virDomainPtr dom, =20 if (privileged) { cacheDir =3D g_strdup_printf("%s/cache/libvirt", LOCALSTATEDIR); - } else if (!(cacheDir =3D virGetUserCacheDirectory())) { - VBOX_RELEASE(machine); - return NULL; + } else { + cacheDir =3D virGetUserCacheDirectory(); } =20 tmp =3D g_strdup_printf("%s/vbox.screendump.XXXXXX", cacheDir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749943; cv=none; d=zohomail.com; s=zohoarc; b=C+NYp+YuJnXc4OMHwtLX7i6xkUi77DetAmvr0NTSU1T54nS+vPKeNAyfcU2vQv9QxwUeiCWRaAxxw61VPo/uHPA1st/khc1rNiwIWUXONwqhadLZRtSnN0LtpyBzqhLH5XVZzE6g7jgOU/vnbhDDucr9sSJwyANpbzYRXLfE7Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749943; 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=1pDV95jcnpWRslr/wleQZvXR77TLBHXF7kn5XfFgMS8=; b=mNdrK6kDO9dOAx7bKtO7m7yo7nwdT9iDIv4+NLv1qNriOp8BXSxFtOrULEXMv2sJoMbIZAthnwIIBCgQkaknetZJgeEkyJJYaiovYmwXfKckhQh8gQ1J89IeAhCTTXr/8c7OVOdftSOMwvf+5afXdyCpBKVwUOrOvoEl/KmOfFQ= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157674994380518.818388173422136; Thu, 19 Dec 2019 02:05:43 -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-156-lSSWKzFWNYuJjGNAUZFXtg-1; Thu, 19 Dec 2019 05:05:39 -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 17E38801E78; Thu, 19 Dec 2019 10:05:33 +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 E4B425C3FD; Thu, 19 Dec 2019 10:05:32 +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 A34E9180880C; Thu, 19 Dec 2019 10:05:32 +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 xBJA56HN010871 for ; Thu, 19 Dec 2019 05:05:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA4D926E48; Thu, 19 Dec 2019 10:05:06 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39CE326DF9; Thu, 19 Dec 2019 10:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749942; 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=1pDV95jcnpWRslr/wleQZvXR77TLBHXF7kn5XfFgMS8=; b=VY4xsiYFTp6vzdkuh+p5IMc3Thcr5xy8D/UfSC1xCkMkJdVEuZTsOYgErmhChAyaxegAOn bxj/hHTA3XrYuWH1tiEA1QoZ+9cSQCK8in8cQzUUT4PbfdIu+t8V/TFR1Bm8prXAhCXJcN eLSdCDX+lhuyoC/iFv9T26jQYBA+Emc= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:18 +0100 Message-Id: <20191219100447.210836-14-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 13/42] util: Use g_autofree on virLogSetDefaultOutputToFile() 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: lSSWKzFWNYuJjGNAUZFXtg-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/util/virlog.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index d45e2dd316..10639d7328 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -173,8 +173,7 @@ virLogSetDefaultOutputToJournald(void) static int virLogSetDefaultOutputToFile(const char *binary, bool privileged) { - int ret =3D -1; - char *logdir =3D NULL; + g_autofree char *logdir =3D NULL; mode_t old_umask; =20 if (privileged) { @@ -182,12 +181,12 @@ virLogSetDefaultOutputToFile(const char *binary, bool= privileged) virLogDefaultPriority, LOCAL= STATEDIR, binary); } else { if (!(logdir =3D virGetUserCacheDirectory())) - goto cleanup; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(logdir) < 0) { umask(old_umask); - goto cleanup; + return -1; } umask(old_umask); =20 @@ -195,10 +194,7 @@ virLogSetDefaultOutputToFile(const char *binary, bool = privileged) virLogDefaultPriority, logdi= r, binary); } =20 - ret =3D 0; - cleanup: - VIR_FREE(logdir); - return ret; + return 0; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749964; cv=none; d=zohomail.com; s=zohoarc; b=D/0wjUBwBLZ0vEe/IJHSiUJ0u/7nBfl0ajm5/CULaJZJmL2x/TI3f6ZnM2mgb7SCDywl+NSnQ4wXOAwEGLGJ5jA/d4C7HLMkZzNLaUDZEI3yCiTBRvotBv8sXBpT+/gEyZzB+7LOsgiaqZmrtknD+PTicjoIXrEcFD9giPmD7CA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749964; 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=PAmD6QcQ+xgZT03uCE33nN8zPH2f5VLceqKiw8oZ3S4=; b=lJTnObZXR0vHoL+ktmQm7sH0owdn0+pR9H4m1IFXN5d9Y8peTlL3zmUaMW2tYb9Y84fNdVQpOHBZquDb33EesStXYxOrM1pHeyclbNFbiTKA0yxBVS/UuWg7Gm4un6ooqUrMkxJPxQYplV58Gc7MASqew8ozIi4sbMgzG9NMTTg= 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 1576749964423948.1860571463606; Thu, 19 Dec 2019 02:06:04 -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-75-Fk9M6qMyOuqzoUWpfKLbNA-1; Thu, 19 Dec 2019 05:05:34 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42A1F800D5C; Thu, 19 Dec 2019 10:05:27 +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 215AF63B8A; Thu, 19 Dec 2019 10:05:27 +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 D196118089D6; Thu, 19 Dec 2019 10:05:26 +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 xBJA5CbR010909 for ; Thu, 19 Dec 2019 05:05:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 90A6126E48; Thu, 19 Dec 2019 10:05:12 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90E4F26DF9; Thu, 19 Dec 2019 10:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749963; 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=PAmD6QcQ+xgZT03uCE33nN8zPH2f5VLceqKiw8oZ3S4=; b=LhtZn9biHts8XTOtsuoix6tjFDdY8CfAYOaxDLcWr9ac/Kc2ZONLv3yz0Y772mDpQvUS6b a7jOdMsq1FYjiqvfBSdXNLL1aQwveesM32jK6hKUON61DMwQxEseHedFNE3s/inaEgukl7 GetmSDmTAUCuUfKSaEK7yO+fFBe9ivc= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:19 +0100 Message-Id: <20191219100447.210836-15-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 14/42] util: Don't check the output of virGetUserCacheDirectory() 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.11 X-MC-Unique: Fk9M6qMyOuqzoUWpfKLbNA-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) virGetUserCacheDirectory() *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/virlog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 10639d7328..6bae56e2e3 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -180,8 +180,7 @@ virLogSetDefaultOutputToFile(const char *binary, bool p= rivileged) virLogDefaultOutput =3D g_strdup_printf("%d:file:%s/log/libvirt/%s= .log", virLogDefaultPriority, LOCAL= STATEDIR, binary); } else { - if (!(logdir =3D virGetUserCacheDirectory())) - return -1; + logdir =3D virGetUserCacheDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(logdir) < 0) { --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749956; cv=none; d=zohomail.com; s=zohoarc; b=AheiDNGSBk8fM2I5vrRM3J2oUGfxQjjyY57VodeySfHc5fHNlgq9HISiehT091tDf/h/bs57tAs57dCA6gywwJkHMVOtcUkobztWOdbX0vUim5jwsWDdOlQJr9TuSZXGSgvZ4iRgUNW+eZDNoXbFRcQTpWWYSH6RjjqFAGr0w4k= 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=Dt99UyZ0N0o6lHIwS7onfGWMgbE7kk06F4UnF62gueg=; b=M/REOHCtZzMfVCxvpoDqswMSkizlar6Z8gvGX8yEMxd/eB/Ve6KW3TDw5ZzuYClfFMFU6kwdE7sHVzrm2VfFZYynPkurW6S4UQsxSczCUgjMnHZLqKuWegZMxt8C/lXeGMByjXkLTlx1vph7HHrVB9kRgj+hKuz2/DUxP2auzXc= 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 1576749956557701.6174663091433; 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-257-1rhiBKYdOEe4vJHUrTXA6Q-1; Thu, 19 Dec 2019 05:05:53 -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 BC243800584; Thu, 19 Dec 2019 10:05:45 +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 4E8F05C54A; Thu, 19 Dec 2019 10:05:45 +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 07C0910483F; Thu, 19 Dec 2019 10:05:45 +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 xBJA5DRf010916 for ; Thu, 19 Dec 2019 05:05:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8B3FB26E48; Thu, 19 Dec 2019 10:05:13 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD8C126DF9; Thu, 19 Dec 2019 10:05:12 +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=Dt99UyZ0N0o6lHIwS7onfGWMgbE7kk06F4UnF62gueg=; b=DdWuKmUvDrLcfWn7h39NLc/SQyXRdRXsZnQxEqOAytzNy9plCeH74eLYZLwIoXHmh6Mcbv xchihLysUHtbx4HKg/JdYD49Sr4n6UMZLtjGOJ96gpiFGp57iauD8mt7cU+otGEKo1DraW Xu9qbSsKQDNBTdWKXGB0K9QyCEfFazQ= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:20 +0100 Message-Id: <20191219100447.210836-16-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 15/42] qemu: Don't check the output of virGetUserCacheDirectory() 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: 1rhiBKYdOEe4vJHUrTXA6Q-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) virGetUserCacheDirectory() *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/qemu/qemu_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 389ac55bee..634c65095e 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -165,8 +165,6 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) g_autofree char *cachedir =3D NULL; =20 cachedir =3D virGetUserCacheDirectory(); - if (!cachedir) - return NULL; =20 cfg->logDir =3D g_strdup_printf("%s/qemu/log", cachedir); cfg->swtpmLogDir =3D g_strdup_printf("%s/qemu/log", cachedir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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 From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750149; cv=none; d=zohomail.com; s=zohoarc; b=VkQFWnwXEeeOAsES1AIzdDXmbpq/aie9jZxdRChTCNzGL07ZLpx7gDZkebdarOKHfO+7ES7oC/VRhAT7Uk3v6nR3ccvkLTCINUfosQgnlcqwe+lmw7JurUJC6jC2mcTUr5Djh5CH4pGOLfDpSri2mMb7zlKTAcgti2wBSbxV6zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750149; 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=BpD0VIBFZd1o+pDErGkZaUupYee0+sXWpSgsYEejLgE=; b=IS/SvbBvMQKijC2uUPo96lSAAyTB78mABAvdsA5jAhNSCJdiQHb39xUmA3Rx8SO7UN6dEp0NyWmj2+++8rKJgrfBarNqUeiWO/5iVYOUxZHjwts6KPwuafkDd3fJ/CLlCsRdJRODiuf2p4vMAQWNjuX5vrpbFTR5JwfNK0urELk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576750149318955.6953691371472; Thu, 19 Dec 2019 02:09:09 -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-124-l7HwALLwPVGCOskFed4U6g-1; Thu, 19 Dec 2019 05:05:47 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CE32DB66; Thu, 19 Dec 2019 10:05:40 +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 290FF6046B; Thu, 19 Dec 2019 10:05:40 +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 D77061803C33; Thu, 19 Dec 2019 10:05:39 +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 xBJA5FVJ010934 for ; Thu, 19 Dec 2019 05:05:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8313E26E4E; Thu, 19 Dec 2019 10:05:15 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id D539526DF9; Thu, 19 Dec 2019 10:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750148; 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=BpD0VIBFZd1o+pDErGkZaUupYee0+sXWpSgsYEejLgE=; b=Ds1uIpWFbek/RAs2ZLDBUbA7SU2YtRWDg+wOPN+Ntna4vynccrvq7/aBt3hbvzaSp2JS9S QLRcCSIuU3oP0R9iSZFws4DwbRSnbLYceHfL/6Psk/4XwhUc4H1WBkMpHbtqCM/mP9apyW ZlfAg+o7lzgItmvSsm1rFunNejYfgPE= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:22 +0100 Message-Id: <20191219100447.210836-18-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 17/42] remote: 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.11 X-MC-Unique: l7HwALLwPVGCOskFed4U6g-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/remote/remote_daemon_config.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_c= onfig.c index ae6b491686..84e331474b 100644 --- a/src/remote/remote_daemon_config.c +++ b/src/remote/remote_daemon_config.c @@ -81,17 +81,13 @@ daemonConfigFilePath(bool privileged, char **configfile) } else { char *configdir =3D NULL; =20 - if (!(configdir =3D virGetUserConfigDirectory())) - goto error; + configdir =3D virGetUserConfigDirectory(); =20 *configfile =3D g_strdup_printf("%s/%s.conf", configdir, DAEMON_NA= ME); VIR_FREE(configdir); } =20 return 0; - - error: - return -1; } =20 struct daemonConfig* --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749967; cv=none; d=zohomail.com; s=zohoarc; b=QdQsO0o4GWXRdsLA9HJlkU+yHN8ecB7bbnZDGjavkI5ddRExtm+gB0LgPcqhmvs6FfbQQ10tEXBnfsKP/GZUTV0/sGJon5a2RCayUsreqbNP8Es7nQYey5GyHjTi9f03ib6sQ9nhwWesekKXKWi9x8K1Iqkzqdrz469EEtJ6pdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749967; 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=RqBF11sxtr38VArrIDir44Xuw53/8oLTYYoZmbOvw+8=; b=Wn+cm5zGnNtCszlBa61NFvDNS5/gcPrMHbVx6IbmtRDwesUAr1XFsHAmL6HpjzkSB6e5tpMtepVPa1HeztJyNO0yVNldu1elvDeONpJ01d8EZRl4VegFJPR7Ulchq0aIkTZJ7+VjVxsWFm8GCLNS6J0QFhJISMPdz7ylxQrdk1s= 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 1576749967526695.5812012042337; Thu, 19 Dec 2019 02:06:07 -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-401-4swLhZ6bOD2G1uSKg0TZhw-1; Thu, 19 Dec 2019 05:05:41 -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 4AFE0800584; Thu, 19 Dec 2019 10:05:31 +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 20D995C54A; Thu, 19 Dec 2019 10:05:31 +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 CDE4F827EF; Thu, 19 Dec 2019 10:05:30 +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 xBJA5GOx010941 for ; Thu, 19 Dec 2019 05:05:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7E74826E4E; Thu, 19 Dec 2019 10:05:16 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0DD026DF9; Thu, 19 Dec 2019 10:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749966; 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=RqBF11sxtr38VArrIDir44Xuw53/8oLTYYoZmbOvw+8=; b=Vq4u5dZfVCAogUihZAbNIK+OMHo+UVeKa2RcI7RuhrnacFs2xRKLA8J1G0osIlwMUNraj8 +SgV2bcEyI92vgU6MmCrl/HOYfKLxf6KU3JLuydxiBwSfQLSPtpG37xfIZmyPyeWAApXML +iXuWYH8oq6IjKNRrNqg5+fhCxRjiRY= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:23 +0100 Message-Id: <20191219100447.210836-19-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 18/42] qemu: 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: 4swLhZ6bOD2G1uSKg0TZhw-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/qemu/qemu_conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 634c65095e..aa96d50e41 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -177,8 +177,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) =20 cfg->swtpmStateDir =3D g_strdup_printf("%s/swtpm", cfg->stateDir); =20 - if (!(cfg->configBaseDir =3D virGetUserConfigDirectory())) - return NULL; + cfg->configBaseDir =3D virGetUserConfigDirectory(); =20 cfg->libDir =3D g_strdup_printf("%s/qemu/lib", cfg->configBaseDir); cfg->saveDir =3D g_strdup_printf("%s/qemu/save", cfg->configBaseDi= r); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750107; cv=none; d=zohomail.com; s=zohoarc; b=oAbW0sRWiAlkLpA9XiNl8pCRJDcCY/rJkQCO8cd/FGGMhI9q5YyyMdUAhpnGDSgAyQ2yRFP2PQ+AZra8SY3fil/WAAfBiN+AadaMERmSOtt9CWiGHjpCF3cZ01EdL7tzomFBvWxDYPN0XpSmbxMJf9qFKtSV4AsmgY4ScQE5eTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750107; 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=sPp7nNWNBayZFYu9FAKXBpZqCJ+64xcdoppv98g6/zs=; b=gjfC5sHRVGrK/3wuAZINMMhdqqYrBxc3O5HnpCstRNiLIEQL1dMgb1ulXKrTiRIPFvxgGScHPiZZNcGy1rfB8YjTAID+UxdCK7DykWcW//a3tm0APsR+7ldoJtlPNA0CNrgWjLZ34CSoDSTvX1soyF6I+aIToCuIxl+fsfksFks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576750107570228.39827593008386; Thu, 19 Dec 2019 02:08:27 -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-421-KLju_YY0PXOr16pcgP5Cvw-1; Thu, 19 Dec 2019 05:05:41 -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 33CAEDB68; Thu, 19 Dec 2019 10:05:36 +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 0E09B7D9A8; 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 C2C3A827F6; Thu, 19 Dec 2019 10:05:35 +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 xBJA5HCc010956 for ; Thu, 19 Dec 2019 05:05:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7A14E26DF9; Thu, 19 Dec 2019 10:05:17 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCA6626E55; Thu, 19 Dec 2019 10:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750106; 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=sPp7nNWNBayZFYu9FAKXBpZqCJ+64xcdoppv98g6/zs=; b=LjdzGDwFW4jNV0Wkgkaw8SZD+9+az2uIhOpgSl63l7G/z2pDSEK/9ET8UGDccker21K1vb BtYo29tzwUA1JLpQIpcom1MNsYWgbkU2YQ0raZFbGFtUDKUQTyXaUTaNk19t+HGpQsf/zY nEu6xdfpgmczuFXyjpWjhU8BwVTza50= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:24 +0100 Message-Id: <20191219100447.210836-20-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 19/42] network: 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.13 X-MC-Unique: KLju_YY0PXOr16pcgP5Cvw-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/network/bridge_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index e360645969..98aa530715 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -741,7 +741,7 @@ networkStateInitialize(bool privileged, } else { configdir =3D virGetUserConfigDirectory(); rundir =3D virGetUserRuntimeDirectory(); - if (!(configdir && rundir)) + if (!rundir) goto error; =20 network_driver->networkConfigDir =3D g_strdup_printf("%s/qemu/netw= orks", configdir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750032; cv=none; d=zohomail.com; s=zohoarc; b=k1sGxlleIAaFjQsKx8LjDsYaJA6OWVpbUM/5AYMUECjEiv47yUzum8syDe3VBzO6av2nPawN/+iWtUagt9J1v4onjnlEqBGq2dVteZlqsYItFg2/aSEklYSDgBtid9tYqI4/feXulqu5ct4FhTaUB5qWFnOx7r68JU7OWvne7go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750032; 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=hga7+I9MSEA5+5aWqE3BIv/mJHQvw5bDARaMXEZiNCc=; b=HfioDbxXLYq79hT4da1BYxfbfZ9i6tXpYcfD3n5FlIwsjNVxd/vvTfPHR7JKGV/SDxnQOxkqnASLqzJPoAZJaE3pzATU6yWXVkpuNT6F1wqLFYHXqxIy7pP5D2YQtLKDTxThaaVNZfcOtevPToa6R3AA3KwwkzLzU4M1XPaIMyw= 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 1576750032238121.62140933993771; Thu, 19 Dec 2019 02:07:12 -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-13-Rp0X7hYvNvOl4u01H1Odqw-1; Thu, 19 Dec 2019 05:05:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8FE380058C; Thu, 19 Dec 2019 10:05:43 +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 9C56E60F89; Thu, 19 Dec 2019 10:05:43 +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 4BA85827FF; Thu, 19 Dec 2019 10:05:43 +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 xBJA5Iv5010968 for ; Thu, 19 Dec 2019 05:05:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7558926E48; Thu, 19 Dec 2019 10:05:18 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C904F26DF9; Thu, 19 Dec 2019 10:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750030; 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=hga7+I9MSEA5+5aWqE3BIv/mJHQvw5bDARaMXEZiNCc=; b=KQEEusLYrrefUEzvDspOZTVhR8T9TsuiWUpSwkM51Px8ElF257m11HCH4JBQdXa+yHraJB ogzUOSMt7ecIVlF8TFM/YQM7gHU3Ab+sDOCl2lrMh46GxOAo4ANw4VyKu7FDeOT0O0fY8q M/DTGhPpN91PQNKIsPs5WjKLQ/+dKJI= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:25 +0100 Message-Id: <20191219100447.210836-21-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 20/42] logging: Use g_autofree on virLogDaemonConfigFilePath() 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.12 X-MC-Unique: Rp0X7hYvNvOl4u01H1Odqw-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/logging/log_daemon_config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_confi= g.c index 0cf9729e7f..ab42921140 100644 --- a/src/logging/log_daemon_config.c +++ b/src/logging/log_daemon_config.c @@ -42,13 +42,12 @@ virLogDaemonConfigFilePath(bool privileged, char **conf= igfile) if (privileged) { *configfile =3D g_strdup(SYSCONFDIR "/libvirt/virtlogd.conf"); } else { - char *configdir =3D NULL; + g_autofree char *configdir =3D NULL; =20 if (!(configdir =3D virGetUserConfigDirectory())) goto error; =20 *configfile =3D g_strdup_printf("%s/virtlogd.conf", configdir); - VIR_FREE(configdir); } =20 return 0; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576749960; cv=none; d=zohomail.com; s=zohoarc; b=cp3/0NJ0f0mx2FELUmdZ1/2M6ErcyW0WYNyl9nm3qXUnJh/xIKir82XKy2yTB3QsRZqOqJU73XvgqUORkHkZNdYf4D54SnlBwUCM4eCzGBN/XqtW0oEkPCYigb0QE1FzCC4mj182yLGvw412XYv/oG0G2GZ/lLv1kxOHYOwxF54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749960; 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=a0NkwxFQjnNXDXnqGZSOPYFF2ws59SCFrpSLreEkwMw=; b=Ocb6FVNA+ZK0fFWE1xrIPlb/doNYsEFzX02Rh/2ns3vCud0Eh65bifwz84sp13N7W4/FjClFqSK1e2tiMlEeS9M4Z1DED40Shff1HDGdgejnbJVga1/4RTwNSwo/mplp1lp6uLiwh79taiuh4Lqnlde4/b0DmDHxe5bIFZvwUTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 15767499608941016.903190397638; Thu, 19 Dec 2019 02:06:00 -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-283-omJfayHXPrWH5XzUnxTOIQ-1; Thu, 19 Dec 2019 05:05:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63D80800587; Thu, 19 Dec 2019 10:05:49 +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 2F35E26E51; Thu, 19 Dec 2019 10:05:49 +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 CBCD518034EF; Thu, 19 Dec 2019 10:05:48 +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 xBJA5JL7010978 for ; Thu, 19 Dec 2019 05:05:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 715C626DF9; Thu, 19 Dec 2019 10:05:19 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C45D926E4B; Thu, 19 Dec 2019 10:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749959; 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=a0NkwxFQjnNXDXnqGZSOPYFF2ws59SCFrpSLreEkwMw=; b=J2HHrL19FCIhOBlGFPYLWAi7dx7EUWCO2CVUZUYKyS0p4EDK7B1LV/6m6ZQdgkQ++Q1oLF 2NsJeC4rD5AJuyL6VI5bTTgBmfooKx9X+RyxRHgLgqZ+vnBOS9ctxqh2xOSz3mea2LvLHK 5wbXdcKtotqe0Z+h+zsknXr198QGW2g= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:26 +0100 Message-Id: <20191219100447.210836-22-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 21/42] logging: 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.84 on 10.5.11.23 X-MC-Unique: omJfayHXPrWH5XzUnxTOIQ-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/logging/log_daemon_config.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_confi= g.c index ab42921140..97f2de90a6 100644 --- a/src/logging/log_daemon_config.c +++ b/src/logging/log_daemon_config.c @@ -44,16 +44,12 @@ virLogDaemonConfigFilePath(bool privileged, char **conf= igfile) } else { g_autofree char *configdir =3D NULL; =20 - if (!(configdir =3D virGetUserConfigDirectory())) - goto error; + configdir =3D virGetUserConfigDirectory(); =20 *configfile =3D g_strdup_printf("%s/virtlogd.conf", configdir); } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750090; cv=none; d=zohomail.com; s=zohoarc; b=n5DdfP9J2yYR1ITomI7G+bdIUejxXwLuPbc4L2uAKKSEJDrsY4D859s8Jb+oJU/vD+yEQYdpMij6Fc0DQ+9DQ7wlvhQ2tyEslEij2nw/BXMhdHVAY97IOfKsiDvKmjC28jsB7ByBtIY1YxU3CQxXf/zz9lIj1ehYF4e/uUT8Ljc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750090; 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=Rh15ZNDW1fDtLztigQjkdd5cYJbf6J8NNKP6+IibKKQ=; b=Xnx7fc/1sbdcoSINET7iwj3rYprd/jwztHXytXydLVEOSCRX8nWo/Sp6SM25EWpFWpzJyV15J8+Gi4dXqzr82HeEYy8YsoquOMM8akH2DXaDrCUwlZvrnTtU9UZagBdJfGzZJdY9tchC/+THb+PQqVZeSHIb9/XGqcX7D0d9r6w= 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 157675009088294.58082536573659; Thu, 19 Dec 2019 02:08:10 -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-297-37VtGpiAP3WFc4R5SXluZA-1; Thu, 19 Dec 2019 05:05:53 -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 8D373100726D; Thu, 19 Dec 2019 10:05:47 +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 660945C54A; 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 1EF0B18037CD; 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 xBJA5K19010986 for ; Thu, 19 Dec 2019 05:05:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D11526E48; Thu, 19 Dec 2019 10:05:20 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF8D326DF9; Thu, 19 Dec 2019 10:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750089; 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=Rh15ZNDW1fDtLztigQjkdd5cYJbf6J8NNKP6+IibKKQ=; b=FTvXF8X+y3AXAbAPGNPh2PZz6tzKNesoKt3pKjgsieeqYzvrjDt0s7AmO0tXhLSG/3UZA2 eRQW4OMeB8fF7OPJIs5YH0QyHoPbc7mh1w080CBpSBPeAouoP5+2T1BKZ0RztopgO4TxVE rGF31XALCr0q66XTebdqsRpe4wa37NU= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:27 +0100 Message-Id: <20191219100447.210836-23-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 22/42] locking: Use g_autofree on virLockDaemonConfigFilePath() 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: 37VtGpiAP3WFc4R5SXluZA-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/locking/lock_daemon_config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_con= fig.c index d7e13013d7..62df30d9f4 100644 --- a/src/locking/lock_daemon_config.c +++ b/src/locking/lock_daemon_config.c @@ -41,13 +41,12 @@ virLockDaemonConfigFilePath(bool privileged, char **con= figfile) if (privileged) { *configfile =3D g_strdup(SYSCONFDIR "/libvirt/virtlockd.conf"); } else { - char *configdir =3D NULL; + g_autofree char *configdir =3D NULL; =20 if (!(configdir =3D virGetUserConfigDirectory())) goto error; =20 *configfile =3D g_strdup_printf("%s/virtlockd.conf", configdir); - VIR_FREE(configdir); } =20 return 0; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576749950; cv=none; d=zohomail.com; s=zohoarc; b=G5lb9MklV2+s24rqncFKu3+gvXQoDXOcXmVqEDXD9dkt+A8Z6Ibc8pfmZy7/Og2/ARcXKKHpwCo+R7pEzecWnT0y/heJpqa/ScwaFTxlNMofbQydctqzp999yDVGo/iWbyHADoIUd+dWuKoRZ3eayg0w8Wyv1xrl9vo6ueTHrFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749950; 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=h1HKFu/KcIgvzWjRpYSrjodeS0cGqYFi8exHg4zngYU=; b=QK8bRp/Sy0ix3VJkHvQ8GTutuQzFp9rm+fF4Gv+MYEBdd72Pq+vtNtL6SXDJ35riE5kLBNgzxneUsJ15fioYMy2ZSokhDSlAjB6njYVJX4KtdahrVwkqrfpI6H+4Pc2Z7PyYz3+FB+C5ltVHppXVBaVKw/utx8Cho+8EV2ve8uo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157674995014531.784083524920447; Thu, 19 Dec 2019 02:05:50 -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-407-taVdh9U9OnmX3nyoZsgJGQ-1; Thu, 19 Dec 2019 05:05:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0C42DB6B; Thu, 19 Dec 2019 10:05:40 +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 ACFFA63B8A; Thu, 19 Dec 2019 10:05:40 +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 653BA1803C42; Thu, 19 Dec 2019 10:05:40 +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 xBJA5LJC010997 for ; Thu, 19 Dec 2019 05:05:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6A5B326E49; Thu, 19 Dec 2019 10:05:21 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD03D26DF9; Thu, 19 Dec 2019 10:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749948; 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=h1HKFu/KcIgvzWjRpYSrjodeS0cGqYFi8exHg4zngYU=; b=cB0UQq7DngZlC7zkHqSVHuKg2A3UzcL2MkyWrrn/gxh6uEZv4A3XZc78vWk/bI0GRAjqdG BdOVZurTAZvYQqZXBBRRQe8smoyjBxO5apnFzvFYcFG0DrNe4OOJTlQBw9fxu4U0O+SgnQ YCqRmwvL6GSdDDSLJZkfSji19UkWk44= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:28 +0100 Message-Id: <20191219100447.210836-24-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 23/42] locking: 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.11 X-MC-Unique: taVdh9U9OnmX3nyoZsgJGQ-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/locking/lock_daemon_config.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_con= fig.c index 62df30d9f4..c67b0a75e1 100644 --- a/src/locking/lock_daemon_config.c +++ b/src/locking/lock_daemon_config.c @@ -43,16 +43,12 @@ virLockDaemonConfigFilePath(bool privileged, char **con= figfile) } else { g_autofree char *configdir =3D NULL; =20 - if (!(configdir =3D virGetUserConfigDirectory())) - goto error; + configdir =3D virGetUserConfigDirectory(); =20 *configfile =3D g_strdup_printf("%s/virtlockd.conf", configdir); } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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 From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750047; cv=none; d=zohomail.com; s=zohoarc; b=ZVexkTmneKtFBZuPP+TK1OqSoY6FGSKNZbj8htjtqQLmnCBAH85daWVc9OXaedwpFXxSYsAxZBDOiLsx6pUm3KWGRc3G/kP2Rd3r57dyW/HPvKGd4YPpU/1cBnUOERuS06flC0tEb0yOzYGE6wzhGDZoyf25U/Hazy+O+Rl6UP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750047; 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=XaFvgT2LPsBTbonqXD7i5JGAFxGi2McilxTsw1V0C+I=; b=dujxKQhwZYkqVwJUc5HkDpfp2JDX9UtZMsIW7eEbdUP4XQ620f0rdRstMeCA78tJJtoDQH07cHEXp055UXo4Eq5SGlAtBuVKZOU6eky15Cmev2SxDB13q2/nCyV12LeOPVNas6J4ZU5SF7pUH0NeGfsJwjXcYsUTS4pzCP0OTAM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 15767500473135.38961886634047; Thu, 19 Dec 2019 02:07:27 -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-391-vkX6gmX2MqyGf_C3HcrzSw-1; Thu, 19 Dec 2019 05:06:00 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 205FA800D50; Thu, 19 Dec 2019 10:05:53 +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 ED56063B83; 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 ABD2918034FB; 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 xBJA5N5x011023 for ; Thu, 19 Dec 2019 05:05:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 61FF726E48; Thu, 19 Dec 2019 10:05:23 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B553C26DF9; Thu, 19 Dec 2019 10:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750046; 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=XaFvgT2LPsBTbonqXD7i5JGAFxGi2McilxTsw1V0C+I=; b=gK0YodCJQ1Rhkh6AhFT/H35rBAbYYqMb2RAGoCXy9TOqrsYPBfQ95VVGXgEvPVuY0MZil8 rpgzuRhEB9bmNR9SnSCrS+w6Bd/oGn/HUS5dZsVlNd6o3jurKUz6oSSY7jN8koBsf+tHIL mq6PwJp1wlgWh+5SRXDzuXPvJcAk0WU= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:30 +0100 Message-Id: <20191219100447.210836-26-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 25/42] storage: 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.11 X-MC-Unique: vkX6gmX2MqyGf_C3HcrzSw-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/storage/storage_driver.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 71078dfbd6..a33328db37 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -278,8 +278,6 @@ storageStateInitialize(bool privileged, } else { configdir =3D virGetUserConfigDirectory(); rundir =3D virGetUserRuntimeDirectory(); - if (!rundir) - goto error; =20 driver->configDir =3D g_strdup_printf("%s/storage", configdir); driver->autostartDir =3D g_strdup_printf("%s/storage/autostart", c= onfigdir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749953; cv=none; d=zohomail.com; s=zohoarc; b=Uk1TUmGhla+tWQcZuQ9XPw35XnpM2LiuemrNpN+qn624b5W2Zj7vbhcYtpvAhc2xQRMHrXL3wGtZJs0FEsdczo4C3VtqC/sLsAdRiXWebdj/+vErKNCkYET+C64WZQj3eh72UkwEBt/3poYFjqVXeVp0IRDeLkbKAkQOUsDKMgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749953; 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=E1299o7zSRh2lYH8sOpf4azP3/NEi2vMoIErNaj6w/s=; b=I0Xwp4GwqikbZU5fR8dDgfoySf/nL5Xopil8P89h7/thJPsFy5BSqKmXySVcIAOt0puHB9zbFsvaHZZHlayroacIuiq6Nl1DzHHbvIO8wncwpjs9pg8ft/nzRZ4nf1mtt1K2YoCHBprLrDysmT9i6s55cVESgcLwg0KUa8S5FhY= 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 1576749953078606.1147889475653; Thu, 19 Dec 2019 02:05:53 -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-436-2DAp7XMmPtaq5O0BzdGolQ-1; Thu, 19 Dec 2019 05:05:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 622FF800053; Thu, 19 Dec 2019 10:05:44 +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 356761001902; Thu, 19 Dec 2019 10:05:44 +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 E12F38356E; Thu, 19 Dec 2019 10:05:43 +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 xBJA5OUG011030 for ; Thu, 19 Dec 2019 05:05:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5EBA526DF9; Thu, 19 Dec 2019 10:05:24 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05C826E48; Thu, 19 Dec 2019 10:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749951; 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=E1299o7zSRh2lYH8sOpf4azP3/NEi2vMoIErNaj6w/s=; b=eSOB1tro21TU8MB8czsWAvECibkbWJQYhH6QpBb/NE4adR0ACA1qoyTektlhQegS+e8Tu6 HZi65wQ3mhfGc2myBDm+SS8FUnx+Lpp/qvgPGhnlxsfdW3shUqmALVk10/bC4MGJokRjOi tTnNO6zx5/+8el3D4WnVCOBeh4cdlqI= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:31 +0100 Message-Id: <20191219100447.210836-27-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 26/42] secret: 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.84 on 10.5.11.22 X-MC-Unique: 2DAp7XMmPtaq5O0BzdGolQ-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/secret/secret_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index cdc4b7dcf9..096672f114 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -478,8 +478,7 @@ secretStateInitialize(bool privileged, cfgdir =3D virGetUserConfigDirectory(); driver->configDir =3D g_strdup_printf("%s/secrets/", cfgdir); =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + rundir =3D virGetUserRuntimeDirectory(); driver->stateDir =3D g_strdup_printf("%s/secrets/run", rundir); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749966; cv=none; d=zohomail.com; s=zohoarc; b=bqvTU7mIL/2HJGtkFllj52oQfq9f+9JVqiLPf/UZeJR6p9kSIAg3V369cBLyNW6SWTH6CmD9/TNTl14TUsiMRDQol1Xf003Uepl2/ZZBTbeSt3cLX3Vr7b+Lx65EdBdsxtrFbRJP3JgFgqr5BDKT3TOMMk3Sa+Vl8o5muUA1VfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749966; 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=6LXQtGB4R+05XycrurBmbPt3TtdZwZq/e9TW969/MzM=; b=C+aJ2CX0ycdh6BG3fkKJjHS5CPoukWDXrGlbtlCcj8mG+i9Tco4DbJYBZE0C97NCeBuPqoM04YgpPsAAzhnjYqMK8GnEdS26ezJW9t2QkbQPebk0ru/X1pzcy3OSTNJwRN3BDVK7LeCQusi7KbBHe02J7e3qnpTDUo31oOdPFsU= 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 1576749966781333.93706864083026; Thu, 19 Dec 2019 02:06:06 -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-422-bpccJ4XEPrSescbY6TrsEQ-1; Thu, 19 Dec 2019 05:06:02 -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 A6976100551C; Thu, 19 Dec 2019 10:05:56 +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 7D6197D8B5; Thu, 19 Dec 2019 10:05:56 +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 3B3F4827E2; Thu, 19 Dec 2019 10:05:56 +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 xBJA5PWU011041 for ; Thu, 19 Dec 2019 05:05:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5B6E626E48; Thu, 19 Dec 2019 10:05:25 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADD5826E51; Thu, 19 Dec 2019 10:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749965; 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=6LXQtGB4R+05XycrurBmbPt3TtdZwZq/e9TW969/MzM=; b=eXY9fMV5XkbI5NiUOW6O0YU2HBrcxXo4MhRdyP2wTV/K2LQpT0lNYDjedk+6JPxAF5w71c InWSlJj8JBNk4bq+qJkCD76kRZQ0Ux0tD4xpdMMLubKKKMig2ckZE7Hokia9LMlEBFmZ2b dQhlFbBXLM7nBznTXlkQAZDqPYgGzSY= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:32 +0100 Message-Id: <20191219100447.210836-28-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 27/42] rpc: 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: bpccJ4XEPrSescbY6TrsEQ-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/rpc/virnetsocket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index b98287e6d7..f072afe857 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -684,8 +684,7 @@ int virNetSocketNewConnectUNIX(const char *path, goto cleanup; } =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto cleanup; + 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 From nobody Fri May 3 04:23:13 2024 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 From nobody Fri May 3 04:23:13 2024 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=1576750091; cv=none; d=zohomail.com; s=zohoarc; b=dgzDwBYPq9qurFTTKTg8sEp3cAbi872q7KY+sb0e9RoPElVss7zpLqHgJGvTTWgmOSHiIjad2S6D5WdhldX5PbJTfTn9fK1euksq1FGsluRLTYSHIGZCgduGhrMgqCJdjY1WL1MWf0v0lyeWoay1NcwDvpOn9S8VSBceISVmLRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750091; 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=RnSp4Ii0OmfMFdF7GrtZ8w2Wugp9P7Utp/yBDyop9BU=; b=HfayAubQzkAbreGsth//gxgA2tYyCtdMBfMbI+4tzWAOrNHAR43XPCQ5sF7kRk4ijchrnFK6Nn5Gu5o41Viybs9iX2i7WjUPqYx6EXtFIDq3jgzAsLw+qI4Te/bznxd1DYQfiGxQiiZhEMMIlrGVT1CBTTsX94W0P4IlPUttUvE= 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 1576750091210189.9238769579963; Thu, 19 Dec 2019 02:08:11 -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-291-AkBsPP6HNMaut4IcpQUnVw-1; Thu, 19 Dec 2019 05:06:07 -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 884B4DB67; Thu, 19 Dec 2019 10:06:00 +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 635EE6888D; Thu, 19 Dec 2019 10:06:00 +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 157AE18033C0; Thu, 19 Dec 2019 10:06:00 +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 xBJA5WWM011086 for ; Thu, 19 Dec 2019 05:05:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4743F26E48; Thu, 19 Dec 2019 10:05:32 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AD4726DF9; Thu, 19 Dec 2019 10:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750089; 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=RnSp4Ii0OmfMFdF7GrtZ8w2Wugp9P7Utp/yBDyop9BU=; b=Fzl/la34tLptQgcH9482RAw7TGDQm91/y232yL4N8vBldialU5EZHosN4oyIx7m7/mne+o hJPQWSKd3yToPZjUi4gUMVmXBTIwsElyzOXeWSynYxbiAi0ypxVDvQUkrrdJhc/Lc83Np4 pAvu9zoEDZHRlgYzMvplyEgQez6QYp0= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:34 +0100 Message-Id: <20191219100447.210836-30-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 29/42] qemu: 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.15 X-MC-Unique: AkBsPP6HNMaut4IcpQUnVw-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/qemu/qemu_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index aa96d50e41..c07a844dfc 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -171,8 +171,6 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) cfg->cacheDir =3D g_strdup_printf("%s/qemu/cache", cachedir); =20 rundir =3D virGetUserRuntimeDirectory(); - if (!rundir) - return NULL; cfg->stateDir =3D g_strdup_printf("%s/qemu/run", rundir); =20 cfg->swtpmStateDir =3D g_strdup_printf("%s/swtpm", cfg->stateDir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576749960; cv=none; d=zohomail.com; s=zohoarc; b=iIsWUV/Mn0mGiVMNF2MnA56gQRbvdP3jq4W1tek1QHqORu3ayH7vXC9y71N9upcUgTkAF1HxL3kQtaqSncfXqsIADEo/lGPs3vE3enpj04GASmhfBAd7jg39KaJBka8Jxr4VJdiCpcLTAYtI/kHZdODsDh+IGv+oVTzhLHAnY/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749960; 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=sgBxznqyloo1qUwAxwmGsl8rlc48O2K6SvzAovjqWAU=; b=k3XqrPTc4/Z073nAqfo6+qHzzGpqe9mVXLlxERBfOUL9DBaKlNgxhM5Til8c9Y7SGJiBpjT7Khmg+R9xy4etaqsU/uHcpzhAStrRJN/TB6w4BKGdE59F/Gm2Fqmh1vWmR648s+ADrboCMAcm77azL7V4CuOlZAzaQ7Z9z94qO9E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576749960957546.495559522974; Thu, 19 Dec 2019 02:06:00 -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-197-6wAlX91sO6qajzWeo-pY3A-1; Thu, 19 Dec 2019 05:05:57 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21B6D1007269; 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 E7B656046B; Thu, 19 Dec 2019 10:05:51 +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 94784104873; Thu, 19 Dec 2019 10:05:51 +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 xBJA5X5k011093 for ; Thu, 19 Dec 2019 05:05:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4444C26E48; Thu, 19 Dec 2019 10:05:33 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95D0B26DF9; Thu, 19 Dec 2019 10:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749959; 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=sgBxznqyloo1qUwAxwmGsl8rlc48O2K6SvzAovjqWAU=; b=OqjU4Kcj3j8rwQM4R05WYUC5904ggsX+VBN2CwZ0rpte33Ux8UjgUvAsIZroimTRu3Zxbl Z8ZhaK/GflxWiRwPDLcHsAqTNQYzep+tk8ORtiR5F5oCekFqQHcwdlPPgdj7oWtHcx/lo0 cgYYMtntsLlYgnpcVwecZPNF+6mrGsQ= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:35 +0100 Message-Id: <20191219100447.210836-31-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 30/42] node_device: 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.11 X-MC-Unique: 6wAlX91sO6qajzWeo-pY3A-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/node_device/node_device_hal.c | 3 +-- src/node_device/node_device_udev.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index b40f93df46..cf12854fe9 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -618,8 +618,7 @@ nodeStateInitialize(bool privileged G_GNUC_UNUSED, } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto failure; + rundir =3D virGetUserRuntimeDirectory(); driver->stateDir =3D g_strdup_printf("%s/nodedev/run", rundir); } =20 diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index cae00dc9dc..eedcd123a3 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1806,8 +1806,7 @@ nodeStateInitialize(bool privileged, } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto cleanup; + rundir =3D virGetUserRuntimeDirectory(); driver->stateDir =3D g_strdup_printf("%s/nodedev/run", rundir); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750026; cv=none; d=zohomail.com; s=zohoarc; b=K7wg/oCzB0WTJkZjAfg9adlP0xoK+3LCNaI3VrL8Lcy+GOrDrGqk9MBfP2b0oiGFULvo8u0XGtVtVgErxr+jTlFfJ1pmrsMmlWRyRi1FUnTxLPUCvoLsLso3jds9bJWFkL36eUC86AdnS04RalFU47unW3motG7uwiHvgpeearE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750026; 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=G8HFRvtpyQlXPY6NF6jQFsIx50n3riKYsEdL/uf82NU=; b=QdO9dBxMIeFZOm6AuZ0LK7+mGdNl1dMhI2gB0mjTyLwBPzg2+BHsael8VsPAFDF8l0SCJyMpIKyu5OxHhXW68yeFeWH3qhEARV6MLgIGnXurSTMKtwqJQuijhOBt0SyCLSoHvD/X703FtPAWM0ShOdrLI4OsjPyMI3UaQtjcrG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576750026668799.3593812593173; Thu, 19 Dec 2019 02:07:06 -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-61-kUf5L7WjNtG6eh9ORuiNZg-1; Thu, 19 Dec 2019 05:06:03 -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 B25F218FE870; Thu, 19 Dec 2019 10:05:55 +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 88DB75C1B0; Thu, 19 Dec 2019 10:05:55 +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 4327A18034FD; Thu, 19 Dec 2019 10:05:55 +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 xBJA5YVj011098 for ; Thu, 19 Dec 2019 05:05:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 405B026DF9; Thu, 19 Dec 2019 10:05:34 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9299126E4E; Thu, 19 Dec 2019 10:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750025; 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=G8HFRvtpyQlXPY6NF6jQFsIx50n3riKYsEdL/uf82NU=; b=czP+mvjKXHBgAl6xuBc0xulNkFxPT8ElWm8ytnPChLaSzox8duoe7MKPPqpHqdbfphrXDK bjHH7tdpgwzZlyBYw2fquFIswAZrrKDX8umsebnjUfBV/bKKnP2OhQIewKoc4iOVsTYvXB 69+Q3FCyiZQYFaPKWM8DUQMzkU6MCBY= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:36 +0100 Message-Id: <20191219100447.210836-32-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 31/42] network: 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: kUf5L7WjNtG6eh9ORuiNZg-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/network/bridge_driver.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 98aa530715..c9c45df758 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -741,8 +741,6 @@ networkStateInitialize(bool privileged, } else { configdir =3D virGetUserConfigDirectory(); rundir =3D virGetUserRuntimeDirectory(); - if (!rundir) - goto error; =20 network_driver->networkConfigDir =3D g_strdup_printf("%s/qemu/netw= orks", configdir); network_driver->networkAutostartDir =3D g_strdup_printf("%s/qemu/n= etworks/autostart", configdir); --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750039; cv=none; d=zohomail.com; s=zohoarc; b=L76IQhlwDZ/Nvqiu4+CRZAktFk7x0xMwmvC7crWeGqNDzj1ya4VqA7+3vuwWgOZ/10RA/xoZmwynVUqNXPgFrfbjMIFWKGy8UHfn4v5o9gUwM0h8kLwgy2HqnXA/iKs9j2yTC3KkLWNkFcPqadox+IOwct6/9qZYU4scX/qAzvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750039; 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=1A/HONuOK0dzykCEK5maHX3hSxG+uvwUKx0Uoc3Bvzw=; b=nt4YWzphx3KP1YTzpu6UUcUxzwsB55P86QD1VN953SRfLp/OxuSUzaW829cf4sc45bfD5xIcTj8qudygkBaAS83VEV8iLWn2fLauFTx4E4RkR+/emkurSnw/ncP5rDn2pPCX/nmhLMW02GZ9nOh/6wkc/qXyTsqPRYgMg0MyFWs= 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 1576750039969124.47076200295521; Thu, 19 Dec 2019 02:07:19 -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-253-NGN8wp4cN52vd2qtogqOZQ-1; Thu, 19 Dec 2019 05:06:07 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76CE1801E78; Thu, 19 Dec 2019 10:05:59 +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 452A91001281; Thu, 19 Dec 2019 10:05:59 +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 D1F6B827E6; Thu, 19 Dec 2019 10:05:58 +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 xBJA5Zf5011106 for ; Thu, 19 Dec 2019 05:05:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3A8E926DF9; Thu, 19 Dec 2019 10:05:35 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E90D26E4E; Thu, 19 Dec 2019 10:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750038; 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=1A/HONuOK0dzykCEK5maHX3hSxG+uvwUKx0Uoc3Bvzw=; b=eP6Lx9hYQifWJC8LuKhku6ZBFhGYYsnWqsW5wfwt3ota5Gmm8k7JXQ01cddkNFobVYdPp2 ji2gO24OFcGwNOLAo4Sm+6DyKh5HHrV1/1NQ4r7CF1NXV2Ay4VUzdh9kVZocHmd4pbHoYs ImRb+g597wY9Xm4KnbKWMUkG5yaCxjw= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:37 +0100 Message-Id: <20191219100447.210836-33-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 32/42] logging: Use g_autofree on virLogManagerDaemonPath() 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.84 on 10.5.11.22 X-MC-Unique: NGN8wp4cN52vd2qtogqOZQ-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/logging/log_manager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index e191093272..7a4f036240 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -47,14 +47,12 @@ virLogManagerDaemonPath(bool privileged) if (privileged) { path =3D g_strdup(RUNSTATEDIR "/libvirt/virtlogd-sock"); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) return NULL; =20 path =3D g_strdup_printf("%s/virtlogd-sock", rundir); - - VIR_FREE(rundir); } return path; } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750029; cv=none; d=zohomail.com; s=zohoarc; b=Yo7je20qZWc6bVMQTmsY5iV07h73BINxk1dPmFug+chazehR8Zw0iziVQ3y8qW2bUmj4I9I0WJV96BaLXck21Mhfd1AmT5RhvRrqYwU9W7Uohs8ADpzpRXvAFMNDvkqUOCv1hJ2jNaxhhpOo2soo+ZTQlqxkhuZ3pdeBHK2P4nk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750029; 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=Q9jaDP8oaUKz7W5mg8vHd3vRH0VBpuiGN/EwTXdSzu8=; b=diyBjVx9kFRQtuiw/OmmV/LgugZ87Qb6WW+trMX3bUjixNCfn5nbv7yokKOrZrbAzjZw94Ef0dBxGh6uxKFuP22gD913DshgOUKNbHXMkjdb4LtKGTM3H1uKRW8wlgD5MIzQHqIlPEtJuUGzOUALaydtwvA1fJn7qakleN11aHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576750029222333.7826435584328; Thu, 19 Dec 2019 02:07:09 -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-364-ngcmib-BNpejg6tTGj5ewg-1; Thu, 19 Dec 2019 05:06:10 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AFF5801E72; Thu, 19 Dec 2019 10:06:05 +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 E4B2E26E56; Thu, 19 Dec 2019 10:06:04 +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 88CDC827EB; Thu, 19 Dec 2019 10:06:04 +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 xBJA5asp011126 for ; Thu, 19 Dec 2019 05:05:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3568926E49; Thu, 19 Dec 2019 10:05:36 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88FE926DF9; Thu, 19 Dec 2019 10:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750027; 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=Q9jaDP8oaUKz7W5mg8vHd3vRH0VBpuiGN/EwTXdSzu8=; b=XBe+A2ZRSyLWFhd2/dzkCc4qim1fRNSum8VDJaBzr7eLRmroHdvzHH64opq8rq9n5kH2Oh BqHUXa23klxZjZo3WEgX/yos5JBu+uNMLLcrvVjxKm2FM9HSPrnyerg42DW1KCkyHhBjOd eMKNL3VSrtUXrF9Bbi1uGKnPdmzQiAk= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:38 +0100 Message-Id: <20191219100447.210836-34-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 33/42] logging: Use g_autofree on virLogDaemonUnixSocketPaths() 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.84 on 10.5.11.23 X-MC-Unique: ngcmib-BNpejg6tTGj5ewg-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) Together with the change, let's also simplify the function and get rid of the goto. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/logging/log_daemon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 268d3c62b9..d41d9caba9 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -391,29 +391,23 @@ virLogDaemonUnixSocketPaths(bool privileged, *sockfile =3D g_strdup(RUNSTATEDIR "/libvirt/virtlogd-sock"); *adminSockfile =3D g_strdup(RUNSTATEDIR "/libvirt/virtlogd-admin-s= ock"); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; mode_t old_umask; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { umask(old_umask); - VIR_FREE(rundir); - goto error; + return -1; } umask(old_umask); =20 *sockfile =3D g_strdup_printf("%s/virtlogd-sock", rundir); *adminSockfile =3D g_strdup_printf("%s/virtlogd-admin-sock", rundi= r); - - VIR_FREE(rundir); } return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749968; cv=none; d=zohomail.com; s=zohoarc; b=aeVQ1k9V4+7LMEgkZa8c+GMdDxnYQ6ogP2BMLKU61k2J7/TvzBfguSMnWpmXyPnsBiJkvtYFRLJiTCwxZtqwrNaXQ3cPs/tDRj8ZqHdgyUdqzFW0aC6UKKndMOHN3yXLopZbJRJoKK8jQwl5uhXyPT/IGw9uWtnLUSNdsqcpFBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749968; 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=94Im+BCfVWgwkRWKh5MKK+TnIRS0CM485vY6RZimT+M=; b=Mm+HgFwbgxcQXecGrb7AKaclFtS4aQ8xARk+VEh/FmX5flUJy4zBn+7E7wUoAQtCMUJonWcD0LOJWlzdDgywtV3cTyjwSBTZgInD7EFjuBvUncPk7SGsrImpiArPwvX23R+vBEuBkxSkj97xnLxDQsHiDlOyQ483Sg9DFalSDes= 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 1576749968569198.48197323490865; Thu, 19 Dec 2019 02:06:08 -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-f7VVXvuePy-NnWwIziFBUQ-1; Thu, 19 Dec 2019 05:06:05 -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 34271DB66; Thu, 19 Dec 2019 10:05:56 +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 127055C1B0; Thu, 19 Dec 2019 10:05:56 +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 C076818034FF; Thu, 19 Dec 2019 10:05:55 +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 xBJA5bCW011139 for ; Thu, 19 Dec 2019 05:05:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3369126E55; Thu, 19 Dec 2019 10:05:37 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86E3D26DF9; Thu, 19 Dec 2019 10:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749967; 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=94Im+BCfVWgwkRWKh5MKK+TnIRS0CM485vY6RZimT+M=; b=DCV706lwUshneAVr8oRYjrNyPsY6n0Bxl7knvq4JFUvy77VLo5Eesg62LrecZP+xCk2Kea Yq93YJJaGoQQJB3APwCz8yy/xA9mumq//gJbF1RvB/8JRdExfPTaCf9tJ03UQrRae/7ayh 25dG6lAI87k4Rbk0r9tHr/xb3YtnKj0= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:39 +0100 Message-Id: <20191219100447.210836-35-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 34/42] logging: Use g_autofree on virLogDaemonExecRestartStatePath() 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: f7VVXvuePy-NnWwIziFBUQ-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) Together with the change, let's also simplify the function and get rid of the goto. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/logging/log_daemon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index d41d9caba9..3fee2b3b57 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -612,29 +612,23 @@ virLogDaemonExecRestartStatePath(bool privileged, if (privileged) { *state_file =3D g_strdup(RUNSTATEDIR "/virtlogd-restart-exec.json"= ); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; mode_t old_umask; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { umask(old_umask); - VIR_FREE(rundir); - goto error; + return -1; } umask(old_umask); =20 *state_file =3D g_strdup_printf("%s/virtlogd-restart-exec.json", r= undir); - - VIR_FREE(rundir); } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750036; cv=none; d=zohomail.com; s=zohoarc; b=hV2VnwEKgZFBtAZ5C4a5fTUzcuhGAdxVWStnjFpspf/LXPIFxDlAPNJA71yYpy2FM8bevTOpndrEcwEkY63A8wWTA3dwDogUr/7gvjtHFamygF/1XaOT26xTtEdblOyR1NtdQ580opA4BVCBghqZA+3gHMFq+ARrqKZudjQ/pcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750036; 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=U4QcHXfG1Oq1rdXlUAqGCErjE2w3l6uounK2cBmf5B8=; b=Vyfg4DPlLByvxX2SCP7ufLF6zTavBpRsOjnUuG3pkemxm+mxvvBiDArd5gEmp9hJZ49njSXKDWU+vCShwa+A/a0bAxTW0DPfLXAmNRRYMdZlZUsFsGQolflxhC7iqwLVh4Fm9JnJsuYBXKpcofhI0yinp/FjnekjdnhpsW03+4Y= 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 1576750036503934.7613100132229; Thu, 19 Dec 2019 02:07:16 -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-272-OykGzs5NOwa34gwGnglmPA-1; Thu, 19 Dec 2019 05:06:06 -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 EB70C8024D6; Thu, 19 Dec 2019 10:05:59 +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 C069A7D8B5; Thu, 19 Dec 2019 10:05:59 +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 74681180350C; Thu, 19 Dec 2019 10:05:59 +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 xBJA5clq011162 for ; Thu, 19 Dec 2019 05:05:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F5E426E48; Thu, 19 Dec 2019 10:05:38 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82A2426DF9; Thu, 19 Dec 2019 10:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750035; 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=U4QcHXfG1Oq1rdXlUAqGCErjE2w3l6uounK2cBmf5B8=; b=YTjaCjBut1PY14tFtDKv0N7KcFtZrWfSZeO2pGnLJE4+lHx6vjUfmAcoDMVcjC0MGdY4FI a15GHwxCRUfCu+VmzzIchUlBVLbyKFDSxTQq2Qp/9oPP+BDx4zZtLwFlT6eazJaIUgE8jl wRvIjaZfj8MJ8a7DvDUAdKTInKzcRQQ= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:40 +0100 Message-Id: <20191219100447.210836-36-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 35/42] logging: 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: OykGzs5NOwa34gwGnglmPA-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/logging/log_daemon.c | 11 +++-------- src/logging/log_manager.c | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 3fee2b3b57..488f3b459d 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -394,8 +394,7 @@ virLogDaemonUnixSocketPaths(bool privileged, g_autofree char *rundir =3D NULL; mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return -1; + rundir =3D virGetUserRuntimeDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { @@ -615,8 +614,7 @@ virLogDaemonExecRestartStatePath(bool privileged, g_autofree char *rundir =3D NULL; mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return -1; + rundir =3D virGetUserRuntimeDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { @@ -992,10 +990,7 @@ int main(int argc, char **argv) { if (privileged) { run_dir =3D g_strdup(RUNSTATEDIR "/libvirt"); } else { - if (!(run_dir =3D virGetUserRuntimeDirectory())) { - VIR_ERROR(_("Can't determine user directory")); - goto cleanup; - } + run_dir =3D virGetUserRuntimeDirectory(); } =20 if (privileged) diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index 7a4f036240..6b66218116 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -49,8 +49,7 @@ virLogManagerDaemonPath(bool privileged) } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return NULL; + rundir =3D virGetUserRuntimeDirectory(); =20 path =3D g_strdup_printf("%s/virtlogd-sock", rundir); } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1576750149; cv=none; d=zohomail.com; s=zohoarc; b=NIrLjRX0WVM/khkOZJlUwkur/sX/2KLq4tSz1aczsnV6NQ1hpF4EzQA2s0WlBrYX+xy6a0SbQzspiHqbkvrxJ3RVQBeC4nQymyq+Qn5snMfDD0+dtN3kz/Ffw9janxt2PfnLCkPeuy9pP2PxPvImYp37caGLdb/I1L0d6IPFLyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750149; 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=yuFnGiFTsBVAwgcdp/vsQTOOy6UENkcbI5lV7BAvVwg=; b=CezgzQ1/4NS9EM0kmk+2BIGx9tzCaUkmkwIOirXKFjmUKNnlV8UF6LOyNHz++JvyS5PfTqza+KozEampNnLgtjHU0UE4X6yFuB677AB1/+h5r7GcbspA2WXmq36FNA1Es5+B6MGPwq+Sl/RGH6eygdSt8AgSXKOpHvAUdtO1s7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576750149182207.81065193209304; Thu, 19 Dec 2019 02:09:09 -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-23-DL_h_4-5N3mTqkVrGm7UCg-1; Thu, 19 Dec 2019 05:06:11 -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 EC6EF107ACC9; Thu, 19 Dec 2019 10:06:04 +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 C39455C1B0; Thu, 19 Dec 2019 10:06:04 +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 79E57180338E; Thu, 19 Dec 2019 10:06:04 +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 xBJA5ddh011172 for ; Thu, 19 Dec 2019 05:05:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2AFD926E4E; Thu, 19 Dec 2019 10:05:39 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DB8D26E48; Thu, 19 Dec 2019 10:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750147; 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=yuFnGiFTsBVAwgcdp/vsQTOOy6UENkcbI5lV7BAvVwg=; b=fDpdtfpKZkVEt/fNH1VLn8IHQ0X1oiIZulnx+y+/2Q9PC8eCFvR13Ne4iY7RBAdDHZpTEM Tx7hwcgZeFhbUZUCl7wizldGusxjQrEPTy0am32vDhk07WNwW+GEQpkllFKV7G0Hl9r0V9 8r80+vH6uHkeySv8lSIwNLznuBFFf0s= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:41 +0100 Message-Id: <20191219100447.210836-37-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 36/42] locking: Use g_autofree on virLockManagerLockDaemonPath() 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: DL_h_4-5N3mTqkVrGm7UCg-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) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/locking/lock_driver_lockd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index e8f0329b05..8ca77e525d 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -122,14 +122,12 @@ static char *virLockManagerLockDaemonPath(bool privil= eged) if (privileged) { path =3D g_strdup(RUNSTATEDIR "/libvirt/virtlockd-sock"); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) return NULL; =20 path =3D g_strdup_printf("%s/virtlockd-sock", rundir); - - VIR_FREE(rundir); } return path; } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750086; cv=none; d=zohomail.com; s=zohoarc; b=ILJmtcek9JJwLObf/oVwKbs7wkN0kh1IKOL3ITjoK3+3pegvBVc8Oe7wHjPR0uTubcZPOp92/SKNvZq5q95j7MvC1+SDRsCfXFXKvL+FyA2AYiZkSuyjYQdzJfiLJ1t4wKRH0AAJ17d1NlUVc9i/Y7KMvBqPYYp06LYCYEVDBCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750086; 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=dfO1BsZVVItoVfZ83BtFdIeoK1WPo1rJYqxWbDIxPvw=; b=nR+tdoeKL1lTLb/W+A65tf+2dBnYDNNmxWkJW99srHRiBT4A6e+oQ+NhmI5PdZjNRzXfOeU631aDyl1xlOW/+mqPhvKQtvq1Uz+YRah/xqUFAyg5Ivg8WOJ6CBxGpdBirCzW2hGVtRE4OSNOsxDbH4GJYoXZLvEL/uDV31Bv4+g= 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 1576750086110442.81769022286574; Thu, 19 Dec 2019 02:08:06 -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-304-m_fqds7eNmuM1M6tnXU9Gw-1; Thu, 19 Dec 2019 05:06:13 -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 B4A58107ACCC; Thu, 19 Dec 2019 10:06:08 +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 7DEA95C3FD; Thu, 19 Dec 2019 10:06:08 +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 2DC4D827F1; Thu, 19 Dec 2019 10:06:08 +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 xBJA5esa011194 for ; Thu, 19 Dec 2019 05:05:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 248E926E48; Thu, 19 Dec 2019 10:05:40 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7841726DF9; Thu, 19 Dec 2019 10:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750084; 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=dfO1BsZVVItoVfZ83BtFdIeoK1WPo1rJYqxWbDIxPvw=; b=FtckEovfHPnNeemkZNR2A2UmyXAH6wcVf2e/Cc5MS3y3SywljrsFsvjkXxb3vv67cq9JRi FF6v92EazvyGoKCM5LWRgkBanZ8qpy3UfhJCDHbLXhKSxl/71IAC0vABRfe2ApU2cF+OOS vgnY/VDglI5fmX7BBh/a6ExDBWJ51gs= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:42 +0100 Message-Id: <20191219100447.210836-38-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 37/42] locking: Use g_autofree on virLockDaemonUnixSocketPaths() 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: m_fqds7eNmuM1M6tnXU9Gw-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) Together with the change, let's also simplify the function and get rid of the goto. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/locking/lock_daemon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 0d12a97231..9bcd36a869 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -449,29 +449,23 @@ virLockDaemonUnixSocketPaths(bool privileged, *sockfile =3D g_strdup(RUNSTATEDIR "/libvirt/virtlockd-sock"); *adminSockfile =3D g_strdup(RUNSTATEDIR "/libvirt/virtlockd-admin-= sock"); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; mode_t old_umask; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { - VIR_FREE(rundir); umask(old_umask); - goto error; + return -1; } umask(old_umask); =20 *sockfile =3D g_strdup_printf("%s/virtlockd-sock", rundir); *adminSockfile =3D g_strdup_printf("%s/virtlockd-admin-sock", rund= ir); - - VIR_FREE(rundir); } return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750050; cv=none; d=zohomail.com; s=zohoarc; b=fFuR1zjHxPpWxxoO+lOnlM4L16LEuwrjrtj+x7mDwS1NVqIX5dbAJe0tiqolMySqYLt+yQLbRrzWvEQzwMWV1tjC2IA5cO0zQMnWJR5XacvGKElVjOh86qG5gCnNoGrx+Byne6bHoXk2z7uiOVdKUVTu4TT1nEVyRN+uQTxBg4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750050; 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=Ys2v0HidBXo3Opqz5mlhaMk3FzMHOqIyQ1ecV7GrYi8=; b=NB+Jn3A/6R////iVJB7fXWyB8VylGUi1DzP2RfY54L60Wwtp7r401+BPel+weGQ78/DhYoEcLNkqrgkcrBWm4GIFQ/2gKbIFQhJxhfokWpsNB98eclV+wH1Wk5e56wr5J3GT652zvNP6wNyJYIprG6u7harPyQR8Yb5wv+RtEII= 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 1576750050756659.6748839732244; Thu, 19 Dec 2019 02:07:30 -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-106-l1QXJOMxOxSVmuNzodEUBQ-1; Thu, 19 Dec 2019 05:06:14 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20D831005502; Thu, 19 Dec 2019 10:06:09 +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 E3E285D9E2; Thu, 19 Dec 2019 10:06:08 +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 7597C18033AE; Thu, 19 Dec 2019 10:06:08 +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 xBJA5fUo011207 for ; Thu, 19 Dec 2019 05:05:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2039626DF9; Thu, 19 Dec 2019 10:05:41 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 727DA26E4E; Thu, 19 Dec 2019 10:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750049; 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=Ys2v0HidBXo3Opqz5mlhaMk3FzMHOqIyQ1ecV7GrYi8=; b=Xaq0rEzUdlHJjrXxJTS6uYSBYgS92QGj2Y3GSwW24Jh/GoMzqIJymsebdQ/8COEGKmZ+EO 0/YJ0U4jLbheEwgX6Zq89UXHK2I0fxuwRPUlgW03ITNPzDPBEToYSnmnHIPzgRVZJyz+dJ kIyvrFSsE8yw58AWKcRPfrE0cnrhdZs= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:43 +0100 Message-Id: <20191219100447.210836-39-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 38/42] locking: Use g_autofree on virLockDaemonExecRestartStatePath() 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.14 X-MC-Unique: l1QXJOMxOxSVmuNzodEUBQ-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) Together with the change, let's also simplify the function and get rid of the goto. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/locking/lock_daemon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 9bcd36a869..7c89adf077 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -820,29 +820,23 @@ virLockDaemonExecRestartStatePath(bool privileged, if (privileged) { *state_file =3D g_strdup(RUNSTATEDIR "/virtlockd-restart-exec.json= "); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; mode_t old_umask; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { umask(old_umask); - VIR_FREE(rundir); - goto error; + return -1; } umask(old_umask); =20 *state_file =3D g_strdup_printf("%s/virtlockd-restart-exec.json", = rundir); - - VIR_FREE(rundir); } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576749981; cv=none; d=zohomail.com; s=zohoarc; b=AdVkRbIMY35hENewFWCJiVymQj/7brw7wHEvVJqreNvBsjpiX7RE979FhCeZWmmPWZo2QVWYjwXuATNonKXOJvEnavVHomFK6pGgqowthdkAsIIU/SmGA+UmZVUgYQNca7oEDOcX9i9ookh94DmpdQp7vp9qyCsz7p9+ZLkKO/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749981; 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=R+dOb6MyysLZDgPGKAc/LS3v7i88q5eQsk1pA0zIMfM=; b=MSKsY6NQGxT5RtqaDggrtW1yd7LHDycywqYePjB/T+jnK6GfFYRylE98vZl4OpM7Ck9vi8nkJtkYP8LNNIuBvrjdN6vEpKvTWZaYRUUxq5Uh7Nz8pgERX3dNQEFRKiRrkC5SA4nN4bn5tqYYwyT3MKIX3wUP6PlA76fuh5IYEuw= 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 1576749981934516.3937948884121; Thu, 19 Dec 2019 02:06:21 -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-226-WQmWu_ohO9GC5pgzmia5Zw-1; Thu, 19 Dec 2019 05:06: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 0328D800D41; Thu, 19 Dec 2019 10:06:13 +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 CD9DF6940B; Thu, 19 Dec 2019 10:06:12 +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 8B95F1802219; Thu, 19 Dec 2019 10:06:12 +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 xBJA5gRI011217 for ; Thu, 19 Dec 2019 05:05:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1CB6E26E48; Thu, 19 Dec 2019 10:05:42 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EC0026DF9; Thu, 19 Dec 2019 10:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749980; 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=R+dOb6MyysLZDgPGKAc/LS3v7i88q5eQsk1pA0zIMfM=; b=WxnB8c3xKIhUvwXtsyO9A5Wik6EXfn7WlF/ytHoQqkLdLQX/f1Ko1F25EsjR3TjhGwOUyT 5x7e/0m2RZ20nVQGzCrmii7JD5sPwzBbiTyQmiRxi/37jb7w9SN+z/PN5m44XM+yDtxplD dTi7PbKX9RCbA+c6OysIPizrqM9NP4U= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:44 +0100 Message-Id: <20191219100447.210836-40-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 39/42] locking: 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.15 X-MC-Unique: WQmWu_ohO9GC5pgzmia5Zw-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/locking/lock_daemon.c | 11 +++-------- src/locking/lock_driver_lockd.c | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 7c89adf077..65c38139c4 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -452,8 +452,7 @@ virLockDaemonUnixSocketPaths(bool privileged, g_autofree char *rundir =3D NULL; mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return -1; + rundir =3D virGetUserRuntimeDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { @@ -823,8 +822,7 @@ virLockDaemonExecRestartStatePath(bool privileged, g_autofree char *rundir =3D NULL; mode_t old_umask; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return -1; + rundir =3D virGetUserRuntimeDirectory(); =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { @@ -1224,10 +1222,7 @@ int main(int argc, char **argv) { if (privileged) { run_dir =3D g_strdup(RUNSTATEDIR "/libvirt"); } else { - if (!(run_dir =3D virGetUserRuntimeDirectory())) { - VIR_ERROR(_("Can't determine user directory")); - goto cleanup; - } + run_dir =3D virGetUserRuntimeDirectory(); } =20 if (privileged) diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index 8ca77e525d..339e2f6949 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -124,8 +124,7 @@ static char *virLockManagerLockDaemonPath(bool privileg= ed) } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - return NULL; + rundir =3D virGetUserRuntimeDirectory(); =20 path =3D g_strdup_printf("%s/virtlockd-sock", rundir); } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750041; cv=none; d=zohomail.com; s=zohoarc; b=hbr/9weSKCYwtW1DnE+tNpxu/jkF80bwC+dw3v8R/0qkol0LgmEBx85QifG/JKnrfntVzZ6lD1kbNXZOaX8cD9Pmj9NoUfTNPp9Gd3oi3hhp9tMdtUX3K9D2//DBT5Ug4NKr+7bGZ0C40mO1uwO2tWWNTyNWHKeDjs04/BfgP2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750041; 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=ktuXWANBbW1BLSWeBgpsgH3/VjQpzCXJySV0LzhR9Eg=; b=VqJ97V8PqdSS/1AWRdcc3/0MuiWXM+9QlHHKRF0EjZ74hkiu0vmHrSjxmdNtDqOrQvLHoYyEF8Yn6xzZ7Pp0VOr2a/KY+akxT4ol8vDKdtSAXu50p1BKH3VV6HHxnLR3N1QTNBoPcGCZe1pfDu7g7iwva5Hd7KQKTBEXdbnxL/8= 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 157675004173825.90528639821423; Thu, 19 Dec 2019 02:07:21 -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-236-TQs94wJsN7m_pQ7bJA7EPA-1; Thu, 19 Dec 2019 05:06:19 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D33F5800D4E; Thu, 19 Dec 2019 10:06:13 +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 A665E26E56; Thu, 19 Dec 2019 10:06: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 5836F180221B; Thu, 19 Dec 2019 10:06:13 +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 xBJA5jkw011240 for ; Thu, 19 Dec 2019 05:05:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 884FD26E4E; Thu, 19 Dec 2019 10:05:45 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6ABF626DF9; Thu, 19 Dec 2019 10:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750040; 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=ktuXWANBbW1BLSWeBgpsgH3/VjQpzCXJySV0LzhR9Eg=; b=f0rbVEVD9LtwpBUa/NMcf7v7bz6qaZ38TI4qKk6aBAlYbrRi2ijY1fEp8D/FmxVKDJTZ4A 0WS5qRk7b8I6AFg+/eCy/VzoemiaA7VPx/n5fsvHNLEpTuaT4wrciwS4/AHZv70UcN1EPX KDQYrlt0Qcer2d8aM5BnnywHfjmkqOw= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:45 +0100 Message-Id: <20191219100447.210836-41-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 40/42] interface: 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.84 on 10.5.11.23 X-MC-Unique: TQs94wJsN7m_pQ7bJA7EPA-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/interface/interface_backend_netcf.c | 3 +-- src/interface/interface_backend_udev.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 4f46717cf3..65cb7eae62 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -105,8 +105,7 @@ netcfStateInitialize(bool privileged, } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + rundir =3D virGetUserRuntimeDirectory(); driver->stateDir =3D g_strdup_printf("%s/interface/run", rundir); } =20 diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index 26b1045f8a..7cc098eb33 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1160,8 +1160,7 @@ udevStateInitialize(bool privileged, } else { g_autofree char *rundir =3D NULL; =20 - if (!(rundir =3D virGetUserRuntimeDirectory())) - goto cleanup; + rundir =3D virGetUserRuntimeDirectory(); driver->stateDir =3D g_strdup_printf("%s/interface/run", rundir); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750146; cv=none; d=zohomail.com; s=zohoarc; b=ZloBYY+OMcfGfBNOaPZE033hkjpeW5cZc15Nd5lJH+MFC0eFgYqlnQ2V7GNn7Qao3Ol7/5GC5bLzvkLVb8Hf5vqdXsQ5PD/qtQwsb4Jb4+JrEXbazZlDU2BlGPQyQF4XP5AIApAXMqCt2hIPYQOUfbhOXlh1a1u0TKJR1y0HqXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750146; 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=YNR52rAmqRWrG1J7ExtUZCRbi4/0YcNHv5gaH0AFY+Y=; b=nuzNEI0r+IJHtOWEmpHTNzrBxhDpAXsDKgx/8bCHly5xdtXCJt557zDUFojK6DkZm/kcan/HlbGbcjmWKqshctR/jAuk5KNWoLYszcbD1jPtgAqKpwEPu6iYQepJO7dypCOq8rkrWPskr21nrRgC1IYS+dl+EMoTu2dEbfgZlO8= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576750146269902.1185360639446; Thu, 19 Dec 2019 02:09:06 -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-41-zqn-qJUDPoi_3CC0OUO5Lw-1; Thu, 19 Dec 2019 05:06:22 -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 0872EDB8D; Thu, 19 Dec 2019 10:06:17 +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 808F16B570; Thu, 19 Dec 2019 10:06:16 +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 31BDF827F3; Thu, 19 Dec 2019 10:06:16 +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 xBJA5xCs011340 for ; Thu, 19 Dec 2019 05:05:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0080026E5F; Thu, 19 Dec 2019 10:05:59 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id F077026E5E; Thu, 19 Dec 2019 10:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750145; 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=YNR52rAmqRWrG1J7ExtUZCRbi4/0YcNHv5gaH0AFY+Y=; b=VEFhra10lAABsPzqnllV0deaMXghMsa8Dkkz+KK8B8dUh8AgNMB60QuoM4828164vhwbQe 157wSvKtpKKrO9w2RTS0GEcUrElfYtVz+53iFXZXK/YeMH4DmAkU3LUfUfxOn4blnX7vXY GQFZJHkqxgKcTALHiweKKyMIeRDEHQc= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:46 +0100 Message-Id: <20191219100447.210836-42-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 41/42] admin: Use g_autofree on getSocketPath() 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 X-MC-Unique: zqn-qJUDPoi_3CC0OUO5Lw-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) Signed-off-by: Fabiano Fid=C3=AAncio --- src/admin/libvirt-admin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/admin/libvirt-admin.c b/src/admin/libvirt-admin.c index f156736d9f..d0c191a56a 100644 --- a/src/admin/libvirt-admin.c +++ b/src/admin/libvirt-admin.c @@ -99,7 +99,7 @@ virAdmInitialize(void) static char * getSocketPath(virURIPtr uri) { - char *rundir =3D virGetUserRuntimeDirectory(); + g_autofree char *rundir =3D virGetUserRuntimeDirectory(); char *sock_path =3D NULL; size_t i =3D 0; =20 @@ -160,7 +160,6 @@ getSocketPath(virURIPtr uri) } =20 cleanup: - VIR_FREE(rundir); return sock_path; =20 error: --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 04:23:13 2024 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=1576750006; cv=none; d=zohomail.com; s=zohoarc; b=OEg2uPywU7jG8iZYR4VHDD/TM5bOblR+mczSPPjW1qnB9kqi1IKkwHfdmmlLkJbLWmebZsrPIzK2H46cshQn9e5FPZQeV0zcw5YcDnug9UpP3gm3EQOEGzyoTYHEr/JCdR+xEe3pqCAUqbhOZpoYL9cdvM9Mce3BdfbGX6HX8Ao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576750006; 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=eAFSQhogjf9YNg/gkEusTsQ7sEAOT/JxqhT5vdHZ5QA=; b=cQLdAEcm4Wy0Yo+0lOqzhBnXoTObxhPbR/fhQps1QYXF9avA/Uy6QpjztYhhvb0iUcQRkH4KoRl7jeE8E969F6g7GDisifP6fcJbtIbQrfmPzsIlmpMNpC7jMQ18mzJWBUQ9i8k9HnPWrWRFnbSzSiCWLrLYM2jHkRIn/jb+8ts= 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 1576750006484668.4327688557769; Thu, 19 Dec 2019 02:06:46 -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-397-ZhDaqPj1N5qQq-19N6xE2Q-1; Thu, 19 Dec 2019 05:06:29 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE59C800D48; Thu, 19 Dec 2019 10:06:20 +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 B1B2063B97; Thu, 19 Dec 2019 10:06:20 +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 5DF91827F9; Thu, 19 Dec 2019 10:06:20 +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 xBJA68uQ011420 for ; Thu, 19 Dec 2019 05:06:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7D3B326E56; Thu, 19 Dec 2019 10:06:08 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87A4F26E5E; Thu, 19 Dec 2019 10:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576750005; 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=eAFSQhogjf9YNg/gkEusTsQ7sEAOT/JxqhT5vdHZ5QA=; b=jSMA1mGGyLko4BNivT4Dj9RQ9q79nnLq24HblvLKWuS5USgYEwmsX4uLX/7X7ksI7Nlydq nfc3QWSEhp4PaxnzaQF2YFX2Bqd7TTYtjDqBXOzYarVwPJL4v7B5H40ZrhMilO+rybnLYR u67dikqYzbfYQR0NhygZEciYtnjjaQM= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:47 +0100 Message-Id: <20191219100447.210836-43-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 42/42] admin: 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.11 X-MC-Unique: ZhDaqPj1N5qQq-19N6xE2Q-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/admin/libvirt-admin.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/admin/libvirt-admin.c b/src/admin/libvirt-admin.c index d0c191a56a..dcbb8ca84d 100644 --- a/src/admin/libvirt-admin.c +++ b/src/admin/libvirt-admin.c @@ -147,9 +147,6 @@ getSocketPath(virURIPtr uri) if (STREQ_NULLABLE(uri->path, "/system")) { sock_path =3D g_strdup_printf(RUNSTATEDIR "/libvirt/%s", sockb= ase); } else if (STREQ_NULLABLE(uri->path, "/session")) { - if (!rundir) - goto error; - sock_path =3D g_strdup_printf("%s/%s", rundir, sockbase); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list