[libvirt] [PATCH 1/4] qemuDomainCreateNamespace: s/unlink/rmdir/

Michal Privoznik mprivozn at redhat.com
Fri Jan 6 10:30:40 UTC 2017


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 at 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




More information about the libvir-list mailing list