From: Michal Privoznik Date: Tue, 7 Nov 2017 15:03:40 +0000 (+0100) Subject: qemu: Destroy whole memory tree X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bb3de478a66edafd130ecca9a45a4d506ca727a0;p=libvirt.git qemu: Destroy whole memory tree When removing path where huge pages are call virFileDeleteTree instead of plain rmdir(). The reason is that in the near future there's going to be more in the path than just files - some subdirs. Therefore plain rmdir() is not going to be enough. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e27cd0d407..9fe8fdcb8e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3348,10 +3348,8 @@ qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver, return -1; } } else { - if (rmdir(path) < 0 && - errno != ENOENT) - VIR_WARN("Unable to remove hugepage path: %s (errno=%d)", - path, errno); + if (virFileDeleteTree(path) < 0) + return -1; } return 0;