From nobody Sun May 19 01:26:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1563455565; cv=none; d=zoho.com; s=zohoarc; b=BS05qvWP3IsFlzUqx8Vmxh57A0sW8BAb7zD0nfbjtSslv8CnnQ3FWlTf/+Dv7RW5ONkyUfGxq3dEH+UkS+wOs/eOl+3OBZESt+vvzEfCWzvz/lrzXV6bOCYKym5UuPEsexJJUFRSX6/4iEnl9wgK1+EBCmBsuO3EDuYm10FEffY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563455565; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=YXOgnRkRbs8mXPVnKXVG9lXfAbHVeu/gVl2vxnRqd8U=; b=gKtsxmompV5DdbPRLOo4RKT7QOqN70tUU913BDTarUrzAcE5Mx04VazatPueJH1Tw3dj2G+aHzdcsXzIvdWaEOGSiD4WNdOvPx61Q3fjFcdT2OH+uYBofvDHMRr671mZWgzY9imYD+FncbKf2VszzvguW4QFYKDixrGR/IECtlY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563455565428859.6963293541089; Thu, 18 Jul 2019 06:12:45 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5C9FA335E5; Thu, 18 Jul 2019 13:12:43 +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 1255060CBB; Thu, 18 Jul 2019 13:12: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 197681800206; Thu, 18 Jul 2019 13:12:42 +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 x6IDCeSU000349 for ; Thu, 18 Jul 2019 09:12:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 390B060472; Thu, 18 Jul 2019 13:12:40 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9120E60470; Thu, 18 Jul 2019 13:12:37 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 15:12:35 +0200 Message-Id: <185d52f7ebad2ce808267d4356dec9643ac8ab64.1563455528.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] util: command: Ignore bitmap errors when enumerating file descriptors to close 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 18 Jul 2019 13:12:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virCommandMassCloseGetFDsLinux fails when running libvird on valgrind with the following message: libvirt: error : internal error: unable to set FD as open: 1024 This is because valgrind opens few file descriptors beyond the limit: 65701125 lr-x------. 1 root root 64 Jul 18 14:48 1024 -> /home/pipo/build/l= ibvirt/gcc/src/.libs/libvirtd 65701126 lrwx------. 1 root root 64 Jul 18 14:48 1025 -> '/tmp/valgrind_pro= c_3849_cmdline_186612e3 (deleted)' 65701127 lrwx------. 1 root root 64 Jul 18 14:48 1026 -> '/tmp/valgrind_pro= c_3849_auxv_186612e3 (deleted)' 65701128 lrwx------. 1 root root 64 Jul 18 14:48 1027 -> /dev/pts/11 65701129 lr-x------. 1 root root 64 Jul 18 14:48 1028 -> 'pipe:[65689522]' 65701130 l-wx------. 1 root root 64 Jul 18 14:48 1029 -> 'pipe:[65689522]' 65701131 lr-x------. 1 root root 64 Jul 18 14:48 1030 -> /tmp/vgdb-pipe-fro= m-vgdb-to-3849-by-root-on-angien Ignore bitmap errors in this case since we'd leak those FD's anyways in the previous scenario. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/util/vircommand.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 5141611ca4..4501c96bbf 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -446,12 +446,7 @@ virCommandMassCloseGetFDsLinux(virCommandPtr cmd ATTRI= BUTE_UNUSED, goto cleanup; } - if (virBitmapSetBit(fds, fd) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to set FD as open: %d"), - fd); - goto cleanup; - } + ignore_value(virBitmapSetBit(fds, fd)); } if (rc < 0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list