]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Resolve issues in failure path
authorJohn Ferlan <jferlan@redhat.com>
Tue, 6 May 2014 18:16:48 +0000 (14:16 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 7 May 2014 14:21:18 +0000 (10:21 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1092882

Refactoring in commit id '0c2305b3' resulted in the wrong storage
volume object being passed to the new storageVolDeleteInternal().
It should have passed 'voldef' which is the address found in the
pool->volumes.objs[i] array.  By passing 'voldef', the DeleteInternal
code will find and remove the voldef from the volumes.objs[] list.

src/storage/storage_driver.c

index 542b3827a4f590b57f4d51b09acdc0f547f8e2de..67494a3aefabcd8e48873a33bb8c4b462b0b32f3 100644 (file)
@@ -1766,12 +1766,11 @@ storageVolCreateXML(virStoragePoolPtr obj,
         voldef->building = 0;
         pool->asyncjobs--;
 
-        voldef = NULL;
-
         if (buildret < 0) {
-            storageVolDeleteInternal(volobj, backend, pool, buildvoldef,
+            VIR_FREE(buildvoldef);
+            storageVolDeleteInternal(volobj, backend, pool, voldef,
                                      0, false);
-            buildvoldef = NULL;
+            voldef = NULL;
             goto cleanup;
         }