From nobody Tue May 7 07:09:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605207121; cv=none; d=zohomail.com; s=zohoarc; b=BhEwH3PzbFm3wcmWLN9Uyrn7d6Ph6DcjBhJMokBkK3CZNhugwyjv11oC9vnOzMRgdxWTvCwd1UBqqXDvSgYRWWItVrMJTSpBFxG2O13uAjz1BmsXodbqLRpWoByk4itQkKfvwDXcUXuSgN+rZn8oqWH8KpA8w6pKPXECrKdIl2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605207121; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nWcv8B6EVCN4mfzwCQyXP3Cuy0crkd7fpICeEUI79i8=; b=NNQrtjoFc7RU/hTC3fyMV6ZJiGD6oyHk9ul925B7XqHfep4Ysxzst/fOzF8G38NlEelsoSn1xaGEfxY2M+Cilecwy/s1qCCJqptLlockgjSZna7S7uud4FffHbP+ppYqDIoj+7fsUwu7zW9awwBw13tcuXh7Zz5fkrtXSy1w8Sg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605207121309556.2328943854668; Thu, 12 Nov 2020 10:52:01 -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-585-zEOLeL1KPpO6FHen8JPrZA-1; Thu, 12 Nov 2020 13:51:58 -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 48FC81868424; Thu, 12 Nov 2020 18:51: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 0B1695D9CA; Thu, 12 Nov 2020 18:51: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 345A658103; Thu, 12 Nov 2020 18:51:50 +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 0ACIpmxu019068 for ; Thu, 12 Nov 2020 13:51:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5CCA919C66; Thu, 12 Nov 2020 18:51:48 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86BB219C59 for ; Thu, 12 Nov 2020 18:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605207120; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nWcv8B6EVCN4mfzwCQyXP3Cuy0crkd7fpICeEUI79i8=; b=cZcWNX2wBm3wu/5oA+itF2Jdb+uslD+BsI723hmthjN6CsL/4LD5MdsqKvSZr+eto0naF+ YELCZa8GTHSz4qIxny2gdrwuFC2WPgWCFobWHIG65jUB4Ex+cyMETLhzcma+GDqqv27s90 lU+1TAn7MJifmG32r/pl508xB8tL1QA= X-MC-Unique: zEOLeL1KPpO6FHen8JPrZA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] util: Make virFileClose() quiet on success Date: Thu, 12 Nov 2020 19:51:37 +0100 Message-Id: <20201112185137.559597-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.14 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" While it's certainly good to log events like "failed to close fd" and "tried to close invalid fd", which are likely to be the consequence of some bug in libvirt, logging a message every single time a file descriptor is closed successfully is perhaps excessive and can lead to useful information being missed among the noise. Log filters don't help in this situation, because filtering out all of util.file is too big a hammer and would cause important messages to be left out as well. To give an idea of just how much noise this single debug statement can cause, here's a real life example from a quite large libvirtd log I had to look at recently: $ grep virFile libvirt.log | wc -l 1307 $ grep virFile libvirt.log | grep -v 'Closed fd' | wc -l 343 Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/util/virfile.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 9a7dcfc9a6..f57272ca2f 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -131,8 +131,6 @@ int virFileClose(int *fdptr, virFileCloseFlags flags) VIR_DEBUG("Failed to close fd %d: %s", *fdptr, g_strerror(errno)); } - } else { - VIR_DEBUG("Closed fd %d", *fdptr); } } *fdptr =3D -1; --=20 2.26.2