[libvirt] [PATCH 1/2] storage: Need to ensure removal of voldef from driver list

John Ferlan jferlan at redhat.com
Wed May 7 14:01:33 UTC 2014



On 05/07/2014 08:52 AM, Ján Tomko wrote:
> On 05/07/2014 02:08 AM, John Ferlan wrote:
>> If for some reason a volume cannot be built in the pool (eg, the
>> buildVol call fails), then the error code may or may not properly
>> remove the volume from the pool->volumes.objs[] list.
>>
>> Removal from the list is dependent on the 'deleteVol()' being present
>> in the backend *and* calling it returning success. If either failed,
>> then the volobj would never be removed from the list until a pool
>> refresh was done (or libvirtd restarted).
>>
>> Note: This is true prior to commit id '0c2305b3' as well where
>> the cleanup would have been called prior to removal, but removal
>> never occurred due to various goto statements.
>>
>> Since the volume would have been added to the list prior to the
>> attempt to build the volume, modify the storageVolDeleteInternal()
>> to perform removal during cleanup.
> 
> This makes sense when we're cleaning up after a failed buildVol, but we
> shouldn't be removing the volume from the list when the StorageVolumeDelete
> API was called and volume deletion is not supported by the backend or when
> the deletion failed.
> 
> Jan
> 


Hmm. ugh. I see your point. Guess I was looking at it only from the
point of view of buildVol failure... Still if buildVol fails and
deleteVol fails, then we still could have the volume listed in the pool
objs list - although that's existing and a different issue.

In any case, I'll remove this change and just push 2/2.

John




More information about the libvir-list mailing list