From nobody Mon May 6 13:38:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1626274852; cv=none; d=zohomail.com; s=zohoarc; b=Cofo0vFrcZ7Y9N72RqqbLOHs+Iu/OyRFIRjDYDwlTmDYCmTKsQfUK2sldc3p0+4mx9qahiK6lZOLjcI74wkkgEkCq+EstJDqQ21ykOnq+zCxe1+68sDRpnHXPVO4Unz5f54UarEwcwzsA4zQXV8RfpGHh761mJ5qxpz7k7uCO0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626274852; 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=OiDlkzTyntS6m1uYK1VHbnCjxTh9VEHfZtuHoeYyVhY=; b=nutDrjbZ48rNJ/N6ryRBYPKf8urLiOoEU/uC8DWLLPWC1c8Hs44qAtcpFfA89B/kzjQR6MxJurjOQLSOEq+ZF3BnCFj1XZynFzG9ycy6umT1HwiPexirA9/vQjUFtdoEWjf+nURSRRNs4swrrEP9Qbp86bHfwcQ/eZiPzQk+WRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1626274852180808.6057083827205; Wed, 14 Jul 2021 08:00:52 -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-562-IgbPKbC8OlKuiiQqpjtvoQ-1; Wed, 14 Jul 2021 11:00:49 -0400 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 23AF38015F5; Wed, 14 Jul 2021 15:00:44 +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 BB25719C59; Wed, 14 Jul 2021 15:00: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 059201809C99; Wed, 14 Jul 2021 15:00:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16EF0fnR008393 for ; Wed, 14 Jul 2021 11:00:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6AF941962F; Wed, 14 Jul 2021 15:00:41 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id E36BB189BB for ; Wed, 14 Jul 2021 15:00:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626274851; 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=OiDlkzTyntS6m1uYK1VHbnCjxTh9VEHfZtuHoeYyVhY=; b=an7HAlufrgsOrQoEC888NfW1pVArUfLM6JnnRL6rdIBk6Pc2fjK/xsBNLsJsIAKwdaMsxQ tnCbOga7oe/UDrp4djb5QP+pHnqpk5LRbA32tUZMxu6uPikV8d1zuiW8x3TnhtgTxR3sSy a1Yrm0BhvSwUn95mHGCJwt2x9/3+FjA= X-MC-Unique: IgbPKbC8OlKuiiQqpjtvoQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] syntax-check: s/VIR_DIR_CLOSE/g_autoptr(DIR)/ Date: Wed, 14 Jul 2021 17:00:34 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 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) X-ZM-MESSAGEID: 1626274855245100001 Content-Type: text/plain; charset="utf-8" We have a syntax-check rule that forbids explicit closedir(). However, the error message suggest using VIR_DIR_CLOSE() which was removed a few releases ago (v6.10.0-rc1~389). Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- build-aux/syntax-check.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index eda89f40ad..256f9f695a 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -472,7 +472,7 @@ sc_prohibit_gethostname: sc_prohibit_readdir: @prohibit=3D'\b(read|close|open)dir *\(' \ exclude=3D'exempt from syntax-check' \ - halt=3D'use virDirOpen, virDirRead and VIR_DIR_CLOSE' \ + halt=3D'use virDirOpen, virDirRead and g_autoptr(DIR)' \ $(_sc_search_regexp) =20 sc_prohibit_gettext_noop: --=20 2.31.1 From nobody Mon May 6 13:38:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1626274861; cv=none; d=zohomail.com; s=zohoarc; b=kZ7ZZJQ9509cUWfOjsOIizACWYNbD4EFJ68jdop6oSmLu5F1yvrD0EVO30EitMCxuS/u/6twSC6QysyM4fmlR4ewRZpVA+qlRs9InubWUPiwuT4a1M/JmERpunbBjZNjgRFowgId+Thl4Nkp5ahDiU0KKklzd0CR+7Rydvq2o30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626274861; 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=omMzbmP9a9Gl8oCAZqoSezoGWFkT/RlyyNKWUMpj0vg=; b=leO/6O6xWTWHqMQsP2i28oXZ1tqJxbNr+3GtkSHz6gLbx+EFQOkS9elRk5Cemh0xQJxJTXSGRFc9yfgT3Tzy/vF1lBODn/3UoZqWPDePM8ZZxutVZPU4mGesY5WjUZd7FcIECkmlI7ObyNGctcLJ+XCZnG8oKLtf8TeoiBImt0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1626274861760982.1829913355189; Wed, 14 Jul 2021 08:01:01 -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-186-ImX1m9UiMFWp7aX7q9pdTw-1; Wed, 14 Jul 2021 11:00:59 -0400 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 C3D92804309; Wed, 14 Jul 2021 15:00: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 97F85380; Wed, 14 Jul 2021 15:00:53 +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 58D761809C9A; Wed, 14 Jul 2021 15:00:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16EF0gvx008403 for ; Wed, 14 Jul 2021 11:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4069C189BB; Wed, 14 Jul 2021 15:00:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id B96A660583 for ; Wed, 14 Jul 2021 15:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626274860; 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=omMzbmP9a9Gl8oCAZqoSezoGWFkT/RlyyNKWUMpj0vg=; b=H9/03XIKqTx+DgWDczJfIDUdqGPYNR/JKBWel+UG5uFapXdXXmiVmmEMloJZb7M/85jGOo PgGfk7+usun28c5EvSyCa0DNmcfdO6XtT72BbCiDXen7EO1fS/KjYFu6XSn075JHNyqvbM eTVKiURqbqISZAMzyFvcRHL9vZXOs9I= X-MC-Unique: ImX1m9UiMFWp7aX7q9pdTw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virfile: Update example use of virDirRead() Date: Wed, 14 Jul 2021 17:00:35 +0200 Message-Id: <4cce3edc5a3bea0cb0c7389b19b5813adbc33a39.1626274811.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 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) X-ZM-MESSAGEID: 1626274863208100001 Content-Type: text/plain; charset="utf-8" We have an example in virDirRead() documentation on how to use the function. In there, the directory structure is plain DIR, but that won't work anymore. Switch over to g_autoptr(DIR) which is what we use now. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 4f98b011be..723e1ca6e5 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2889,9 +2889,9 @@ virDirOpenQuiet(DIR **dirp, const char *name) * @name: if non-NULL, the name related to @dirp for use in error reporting * * Wrapper around readdir. Typical usage: + * g_autoptr(DIR) dir =3D NULL; * struct dirent *ent; * int rc; - * DIR *dir; * if (virDirOpen(&dir, name) < 0) * goto error; * while ((rc =3D virDirRead(dir, &ent, name)) > 0) --=20 2.31.1