]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainCreateNamespace: s/unlink/rmdir/
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Jan 2017 10:02:42 +0000 (11:02 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Jan 2017 12:04:57 +0000 (13:04 +0100)
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@redhat.com>
src/qemu/qemu_domain.c

index 495d86a011a6a835878be17c347eb4ebf4d4f75f..f7326c73e5871453ca39941c47dd585cd1c250d0 100644 (file)
@@ -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);