[libvirt] [PATCH] qemuProcessBuildDestroyHugepagesPath: Don't warn on destroying non-existent path

Michal Privoznik posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/9bb2a0219a964af1186ee456d3e4e2f821f7e1d7.1498038114.git.mprivozn@redhat.com
src/qemu/qemu_process.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[libvirt] [PATCH] qemuProcessBuildDestroyHugepagesPath: Don't warn on destroying non-existent path
Posted by Michal Privoznik 6 years, 10 months ago
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=2)

Fix this by not producing the warning on ENOENT.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 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 != ENOENT)
                     VIR_WARN("Unable to remove hugepage path: %s (errno=%d)",
                              hugepagePath, errno);
             }
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemuProcessBuildDestroyHugepagesPath: Don't warn on destroying non-existent path
Posted by Martin Kletzander 6 years, 10 months ago
On Wed, Jun 21, 2017 at 11:43:55AM +0200, Michal Privoznik wrote:
>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=2)
>
>Fix this by not producing the warning on ENOENT.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> src/qemu/qemu_process.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

trivial;

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>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 != ENOENT)
>                     VIR_WARN("Unable to remove hugepage path: %s (errno=%d)",
>                              hugepagePath, errno);
>             }
>--
>2.13.0
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list