[Libvir] PATCH: Fix virStoragePoolCreate() operation

The virStoragePoolCreate() was not checking for a potentially NULL field against startPool() backend driver. It was also failing to run the refresh operation after starting it. The former caused a crash, the latter caused no volumes to show up Dan. Index: src/storage_driver.c =================================================================== RCS file: /data/cvs/libvirt/src/storage_driver.c,v retrieving revision 1.2 diff -u -p -r1.2 storage_driver.c --- src/storage_driver.c 22 Feb 2008 16:26:13 -0000 1.2 +++ src/storage_driver.c 14 Mar 2008 21:34:04 -0000 @@ -416,8 +416,12 @@ storagePoolCreate(virConnectPtr conn, return NULL; } - if (backend->startPool(conn, pool) < 0) { - virStoragePoolObjRemove(driver, pool); + if (backend->startPool && + backend->startPool(conn, pool) < 0) + return NULL; + if (backend->refreshPool(conn, pool) < 0) { + if (backend->stopPool) + backend->stopPool(conn, pool); return NULL; } pool->active = 1; -- |: Red Hat, Engineering, Boston -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 :|

On Fri, Mar 14, 2008 at 09:39:24PM +0000, Daniel P. Berrange wrote:
The virStoragePoolCreate() was not checking for a potentially NULL field against startPool() backend driver. It was also failing to run the refresh operation after starting it. The former caused a crash, the latter caused no volumes to show up
No problem, +1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard