|
|
404507 |
From 7207faf95b38811cbf0d19df02066cc06a138822 Mon Sep 17 00:00:00 2001
|
|
|
404507 |
Message-Id: <7207faf95b38811cbf0d19df02066cc06a138822@dist-git>
|
|
|
404507 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
404507 |
Date: Thu, 9 Nov 2017 16:06:46 +0100
|
|
|
404507 |
Subject: [PATCH] qemu: Destroy whole memory tree
|
|
|
404507 |
|
|
|
404507 |
https://bugzilla.redhat.com/show_bug.cgi?id=1461214
|
|
|
404507 |
|
|
|
404507 |
When removing path where huge pages are call virFileDeleteTree
|
|
|
404507 |
instead of plain rmdir(). The reason is that in the near future
|
|
|
404507 |
there's going to be more in the path than just files - some
|
|
|
404507 |
subdirs. Therefore plain rmdir() is not going to be enough.
|
|
|
404507 |
|
|
|
404507 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
404507 |
Reviewed-by: John Ferlan <jferlan@redhat.com>
|
|
|
404507 |
(cherry picked from commit bb3de478a66edafd130ecca9a45a4d506ca727a0)
|
|
|
404507 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
404507 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
404507 |
---
|
|
|
404507 |
src/qemu/qemu_process.c | 6 ++----
|
|
|
404507 |
1 file changed, 2 insertions(+), 4 deletions(-)
|
|
|
404507 |
|
|
|
404507 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
404507 |
index 605f280d0c..3324cc61f1 100644
|
|
|
404507 |
--- a/src/qemu/qemu_process.c
|
|
|
404507 |
+++ b/src/qemu/qemu_process.c
|
|
|
404507 |
@@ -3348,10 +3348,8 @@ qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver,
|
|
|
404507 |
return -1;
|
|
|
404507 |
}
|
|
|
404507 |
} else {
|
|
|
404507 |
- if (rmdir(path) < 0 &&
|
|
|
404507 |
- errno != ENOENT)
|
|
|
404507 |
- VIR_WARN("Unable to remove hugepage path: %s (errno=%d)",
|
|
|
404507 |
- path, errno);
|
|
|
404507 |
+ if (virFileDeleteTree(path) < 0)
|
|
|
404507 |
+ return -1;
|
|
|
404507 |
}
|
|
|
404507 |
|
|
|
404507 |
return 0;
|
|
|
404507 |
--
|
|
|
404507 |
2.15.0
|
|
|
404507 |
|