]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Don't remove the pool for buildPool failure in storagePoolCreate
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Aug 2016 19:24:48 +0000 (15:24 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 5 Aug 2016 13:30:54 +0000 (09:30 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1362349

When adding the ability to build the pool during the start pool processing
using the similar flags as buildPool processing would use, the code was
essentially cut-n-pasted from storagePoolCreateXML.  However, that included
a call to virStoragePoolObjRemove which shouldn't happen within the
storagePoolCreate path since that'll remove the pool from the list of
pools only to be rediscovered if libvirtd restarts.

So on failure, just fail and return as we should expect

src/storage/storage_driver.c

index dedc5c65ca648ce852d260f07e16152562bcff73..6f1e3727d6e880b5288163cee2b1575063f8db4c 100644 (file)
@@ -931,11 +931,8 @@ storagePoolCreate(virStoragePoolPtr obj,
 
         if (build_flags ||
             (flags & VIR_STORAGE_POOL_CREATE_WITH_BUILD)) {
-            if (backend->buildPool(obj->conn, pool, build_flags) < 0) {
-                virStoragePoolObjRemove(&driver->pools, pool);
-                pool = NULL;
+            if (backend->buildPool(obj->conn, pool, build_flags) < 0)
                 goto cleanup;
-            }
         }
     }