On Wed, Dec 17, 2008 at 09:26:51PM +0100, Chris Lalancette wrote:
Cole Robinson wrote:
> Ahh, I didn't realize the AssignDef caveat. Thanks for pointing that
> out. Something like this should work then?
> diff --git a/src/storage_driver.c b/src/storage_driver.c
> index 2432a9a..330317c 100644
> --- a/src/storage_driver.c
> +++ b/src/storage_driver.c
> @@ -544,12 +544,13 @@ storagePoolDefine(virConnectPtr conn,
>
> if (!(pool = virStoragePoolObjAssignDef(conn, &driver->pools, def)))
> goto cleanup;
> - def = NULL;
>
> if (virStoragePoolObjSaveDef(conn, driver, pool, def) < 0) {
> virStoragePoolObjRemove(&driver->pools, pool);
> + def = NULL;
> goto cleanup;
> }
> + def = NULL;
>
> ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid);
>
Yeah, that looks better. Seems to be good to me, so ACK.
Functionally correct, so fine to commit, but I still think we should
change the virStoragePoolObjSaveDef method params, but not urgent unless
you want to change it now.
Daniel
--
|: 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 :|