[libvirt] PATCH: Fix crash after deleting storage vol fails

Daniel P. Berrange berrange at redhat.com
Fri Mar 6 12:58:07 UTC 2009


After a little debugging on IRC we discovered a problem in the deletion
of storage volumes. We were mistakenly calling virStorageVolFree(vol)
even if the delete call  failed. So the pool got left with a NULL storage
volume, and later use of that pool could crash on this.

Daniel

Index: src/storage_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/storage_driver.c,v
retrieving revision 1.32
diff -u -p -r1.32 storage_driver.c
--- src/storage_driver.c	5 Feb 2009 16:28:30 -0000	1.32
+++ src/storage_driver.c	6 Mar 2009 12:56:20 -0000
@@ -1296,7 +1296,6 @@ storageVolumeDelete(virStorageVolPtr obj
     ret = 0;
 
 cleanup:
-    virStorageVolDefFree(vol);
     if (pool)
         virStoragePoolObjUnlock(pool);
     return ret;


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list