]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Destroy whole memory tree
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Nov 2017 15:03:40 +0000 (16:03 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Nov 2017 09:17:11 +0000 (10:17 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_process.c

index e27cd0d407ebe3e2c6b5c02a5c8848fd8c4442a0..9fe8fdcb8e0e5afa8c4fdae223a1d227552a4646 100644 (file)
@@ -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;