From nobody Mon Feb 9 23:15:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603848996; cv=none; d=zohomail.com; s=zohoarc; b=dYVkQgn7WlqWIQM7jg/X0lvc+rB2xoD/7R+ctJonydUmpnHdSp7ttQ+n/7W1WZeoJG4G0AOz0rByaRiZmthdkf8v4mB1aSB9f1Pr09aUeE+G4OGiJa6Fpvm7zoARYsKu8VRSdWEm59v3EVVCVFQGhZxypOnRj0DAWcmkMIFiVk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603848996; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fqd3pPwCTfizE0ff0k7W8LdBlskuAJyizGvh5npcCao=; b=NYXt8UAvHx43rrKdzXcXYxHEGnvAbmf7nC8qcf2VhKSGlfPFKPY6xVdJczj3EEuy/hWb+CfKLWgYo4zZ2zOLzlR7gwqXkqNBbx2S3wYwB3NEmjRT5EwYdzYoX3MGDaW3CObb/YAM1FyxD+1qPfZF7rogkxi+++8jMi7u2xXRV1I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160384899696046.74304606181238; Tue, 27 Oct 2020 18:36:36 -0700 (PDT) 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-452-Da1NYeZPPfCXx1vSRwCOog-1; Tue, 27 Oct 2020 21:36:33 -0400 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 4E497802B61; Wed, 28 Oct 2020 01:36:28 +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 0810F6EF55; Wed, 28 Oct 2020 01:36: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 9D8F258127; Wed, 28 Oct 2020 01:36:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09S1a61D028225 for ; Tue, 27 Oct 2020 21:36:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id B494D5C22B; Wed, 28 Oct 2020 01:36:06 +0000 (UTC) Received: from vhost2.laine.org (ovpn-113-144.phx2.redhat.com [10.3.113.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76E985C22A for ; Wed, 28 Oct 2020 01:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603848995; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Fqd3pPwCTfizE0ff0k7W8LdBlskuAJyizGvh5npcCao=; b=OctTuSF8EoDIOjsWZU4EuZUhmf4Alwl9YdQgmBVspYloCMTXnurBQuX7JpS5HwXkrVPV0/ CLI//7DKO1Zj9GE6lWYcNLvRjYZ5w0bUpsish3an/D6HvsdgVJ1AP1LGZgy0YCGC316txi X2p5MXDgg+lbypkOOeUzHzTBrKoGDao= X-MC-Unique: Da1NYeZPPfCXx1vSRwCOog-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 01/12] consistently use VIR_DIR_CLOSE() instead of virDirClose() Date: Tue, 27 Oct 2020 21:35:47 -0400 Message-Id: <20201028013558.424925-2-laine@redhat.com> In-Reply-To: <20201028013558.424925-1-laine@redhat.com> References: <20201028013558.424925-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This will make it easier to review upcoming patches that use g_autoptr to auto-close all DIRs. Signed-off-by: Laine Stump --- src/qemu/qemu_interop_config.c | 2 +- src/security/security_selinux.c | 6 ++---- src/util/virdevmapper.c | 2 +- src/util/virfile.c | 3 +-- tests/testutilsqemu.c | 5 ++--- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_interop_config.c b/src/qemu/qemu_interop_config.c index 53b251f056..7edca7540a 100644 --- a/src/qemu/qemu_interop_config.c +++ b/src/qemu/qemu_interop_config.c @@ -79,7 +79,7 @@ qemuBuildFileList(virHashTablePtr files, const char *dir) =20 ret =3D 0; cleanup: - virDirClose(&dirp); + VIR_DIR_CLOSE(dirp); return ret; } =20 diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 733bcf23d9..7d9e62a239 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -3487,8 +3487,7 @@ virSecuritySELinuxSetFileLabels(virSecurityManagerPtr= mgr, virReportSystemError(errno, _("Unable to label files under %s"), path); =20 - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } =20 @@ -3532,8 +3531,7 @@ virSecuritySELinuxRestoreFileLabels(virSecurityManage= rPtr mgr, virReportSystemError(errno, _("Unable to restore file labels under= %s"), path); =20 - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } =20 diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index 4d27c9f104..f26d36832a 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c @@ -211,7 +211,7 @@ virDMSanitizepath(const char *path) } } =20 - virDirClose(&dh); + VIR_DIR_CLOSE(dh); return ret; } =20 diff --git a/src/util/virfile.c b/src/util/virfile.c index 7d0a40b0fb..970d4bd234 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2983,8 +2983,7 @@ int virFileChownFiles(const char *name, ret =3D 0; =20 cleanup: - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 4defba0b7b..278587767f 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -558,7 +558,7 @@ testQemuGetLatestCapsForArch(const char *arch, ret =3D g_strdup_printf("%s/%s", TEST_QEMU_CAPS_PATH, maxname); =20 cleanup: - virDirClose(&dir); + VIR_DIR_CLOSE(dir); return ret; } =20 @@ -667,8 +667,7 @@ testQemuCapsIterate(const char *suffix, ret =3D 0; =20 cleanup: - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } =20 --=20 2.26.2