[libvirt] [PATCH] storage: Don't update pool available/allocation pool if vol-create-as fails
Eric Blake
eblake at redhat.com
Wed Apr 9 01:44:24 UTC 2014
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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140408/541e1105/attachment-0001.sig>
More information about the libvir-list
mailing list