From nobody Sat May 4 22:14:27 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.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; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498038246130561.1028724229742; Wed, 21 Jun 2017 02:44:06 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0306680F97; Wed, 21 Jun 2017 09:44:04 +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 798EB6C50A; Wed, 21 Jun 2017 09:44:03 +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 254534A492; Wed, 21 Jun 2017 09:44:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5L9i1jt005343 for ; Wed, 21 Jun 2017 05:44:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3945060BEC; Wed, 21 Jun 2017 09:44:01 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id B47447E5A4 for ; Wed, 21 Jun 2017 09:43:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0306680F97 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0306680F97 From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 21 Jun 2017 11:43:55 +0200 Message-Id: <9bb2a0219a964af1186ee456d3e4e2f821f7e1d7.1498038114.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemuProcessBuildDestroyHugepagesPath: Don't warn on destroying non-existent path 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: , MIME-Version: 1.0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 21 Jun 2017 09:44:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This function is called unconditionally from qemuProcessStop to make sure we leave no dangling dirs behind. However, whenever the directory we want to rmdir() is not there (e.g. because it hasn't been created in the first place because domain doesn't use hugepages at all), we produce a warning like this: 2017-06-20 15:58:23.615+0000: 32638: warning : qemuProcessBuildDestroyHugepagesPath:3363 : Unable to remove hugepage path: /dev/hugepages/libvirt/qemu/1-instance-00000001 (errno=3D2) Fix this by not producing the warning on ENOENT. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index fa9990e5d..3b7f20be4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3358,7 +3358,8 @@ qemuProcessBuildDestroyHugepagesPath(virQEMUDriverPtr= driver, goto cleanup; } } else { - if (rmdir(hugepagePath) < 0) + if (rmdir(hugepagePath) < 0 && + errno !=3D ENOENT) VIR_WARN("Unable to remove hugepage path: %s (errno=3D= %d)", hugepagePath, errno); } --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list