diff mbox

[4/6] storage: delete: Don't unlink stateFile

Message ID 9684351cab4b67d194cdbdd893bc11a31fb24b51.1466640165.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson June 23, 2016, 12:12 a.m. UTC
PoolDelete only works on an inactive VM, which shouldn't have a
stateFile on disk, so this isn't the place to attempt to remove it.
---
 src/storage/storage_driver.c | 9 ---------
 1 file changed, 9 deletions(-)

-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 45f00e0..9e97f62 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1133,7 +1133,6 @@  storagePoolDelete(virStoragePoolPtr obj,
 {
     virStoragePoolObjPtr pool;
     virStorageBackendPtr backend;
-    char *stateFile = NULL;
     int ret = -1;
 
     if (!(pool = virStoragePoolObjFromStoragePool(obj)))
@@ -1161,14 +1160,6 @@  storagePoolDelete(virStoragePoolPtr obj,
         goto cleanup;
     }
 
-    if (!(stateFile = virFileBuildPath(driver->stateDir,
-                                       pool->def->name,
-                                       ".xml")))
-        goto cleanup;
-
-    unlink(stateFile);
-    VIR_FREE(stateFile);
-
     if (!backend->deletePool) {
         virReportError(VIR_ERR_NO_SUPPORT,
                        "%s", _("pool does not support pool deletion"));