]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuProcessBuildDestroyHugepagesPath: Don't warn on destroying non-existent path
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Jun 2017 15:55:21 +0000 (17:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 21 Jun 2017 10:32:53 +0000 (12:32 +0200)
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>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_process.c

index fa9990e5d87c6754bbf0b3ef0ce0ffff33e52f5e..3b7f20be46185f1fc6ccb0fea8eadef66fd4a00c 100644 (file)
@@ -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);
             }