[libvirt] [PATCH 4/4] storage: Add checks for buildVol create file

Peter Krempa pkrempa at redhat.com
Wed Oct 7 06:57:24 UTC 2015

On Tue, Oct 06, 2015 at 18:34:56 -0400, John Ferlan wrote:
> The buildVol function can fail in numerous ways, but for cleaner or
> clearer error path handling we want to know whether the calls we made
> actually created the volume prior to blindly deleting the volume.
> It could very well be that in between refreshing the pool, checking
> whether the volume was already in the pool, and trying to create the
> volume that something 'external' created a volume of the same name.
> In this case, failure is likely and since we didn't create the volume
> we shouldn't delete it either.
> This patch may set the 'created' boolean for the following functions:
> virStorageBackendCreateQemuImg (in virStorageBackendCreateExecCommand)
> virStorageBackendCreateQcowCreate (in virStorageBackendCreateExecCommand)
> virStorageBackendCreateFileDir (in virDirCreate)
> virStorageBackendCreateRaw (in virFileOpenAs)
> virStorageBackendRBDBuildVol
> virStorageBackendSheepdogBuildVol

Well, as in previous functions. Is there a reason that would inhibit the
actual functions that create the volume to clean it up afterwards in the
same function so that passing up the state would not be necessary?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151007/16c10143/attachment-0001.sig>

More information about the libvir-list mailing list