On 04/08/2014 05:38 PM, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1024159
If adding a volume to a storage pool fails during the CreateXML or
CreateXMLFrom API's, we don't want to adjust the available and
allocation values for the storage pool during storageVolDelete
since we haven't adjusted the values for the create.
Refactor storageVolDelete() a bit to create a storageVolDeleteInternal()
which will handle the primary deletion activities. Add a parameter
updateMeta which will signify whether to update the values or not.
Adjust the calls from CreateXML and CreateXMLFrom to directly call the
DeleteInternal with the pool lock held. This does bypass the call
to virStorageVolDeleteEnsureACL().
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I did try to make storageVolDelete() just be a shim to
storageVolDeleteInternal(), but ran afoul of check-aclrules.pl
since the EnsureAcl wasn't in storageVolDelete().
Yeah, the EnsureAcl has to be in the function matching the public API,
but the bulk of the work can indeed be in the internal helper function.
@@ -1634,7 +1657,6 @@ storageVolDelete(virStorageVolPtr obj,
return ret;
}
-
static virStorageVolPtr
Spurious whitespace change.
ACK with that fix.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org