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>
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);