If something goes wrong in this function we try a rollback. That
is unlink all the directories we created earlier. For some weird
reason unlink() was called instead of rmdir().
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 495d86a01..f7326c73e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7467,9 +7467,9 @@ qemuDomainCreateNamespace(virQEMUDriverPtr driver,
cleanup:
if (ret < 0) {
if (devPath)
- unlink(devPath);
+ rmdir(devPath);
for (i = 0; i < ndevMountsSavePath; i++)
- unlink(devMountsSavePath[i]);
+ rmdir(devMountsSavePath[i]);
}
virStringListFreeCount(devMountsSavePath, ndevMountsSavePath);
VIR_FREE(devPath);
--
2.11.0