]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Eliminate failure to delete empty storage pools
authorLaine Stump <laine@laine.org>
Mon, 14 Dec 2009 15:15:28 +0000 (16:15 +0100)
committerDaniel Veillard <veillard@redhat.com>
Mon, 14 Dec 2009 15:15:28 +0000 (16:15 +0100)
* src/storage/storage_backend_fs.c: virStorageBackendFileSystemDelete
  was incorrectly calling unlink() in an attempt to remove a directory.
  It should be calling rmdir() instead.

src/storage/storage_backend_fs.c

index 16e4bd937df7ebf3bcf2612a9227b5d7896500ff..b7d4bd6d93a6e6d33794a021a88ebc78bc2ccbcd 100644 (file)
@@ -693,9 +693,9 @@ virStorageBackendFileSystemDelete(virConnectPtr conn,
 {
     /* XXX delete all vols first ? */
 
-    if (unlink(pool->def->target.path) < 0) {
+    if (rmdir(pool->def->target.path) < 0) {
         virReportSystemError(conn, errno,
-                             _("cannot unlink path '%s'"),
+                             _("failed to remove pool '%s'"),
                              pool->def->target.path);
         return -1;
     }