[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1.2.8] storage: zfs: fix double listing of new volumes




On 08/27/2014 05:02 AM, Roman Bogorodskiy wrote:
> Currently, after calling commands to create a new volumes,
> virStorageBackendZFSCreateVol calls virStorageBackendZFSFindVols that
> calls virStorageBackendZFSParseVol.
> 
> virStorageBackendZFSParseVol checks if a volume already exists by
> trying to get it using virStorageVolDefFindByName.
> 
> For a just created volume it returns NULL, so volume is reported as
> new and appended to pool->volumes. This causes a volume to be listed
> twice as storageVolCreateXML appends this new volume to the list as
> well.
> 
> Fix that by passing a new volume definition to
> virStorageBackendZFSParseVol so it could determine if it needs to add
> this volume to the list.
> ---
>  src/storage/storage_backend_zfs.c | 45 ++++++++++++++++++++++-----------------
>  1 file changed, 26 insertions(+), 19 deletions(-)
> 

ACK

Although it seems the "main" reason the create backend called the
FindVols was to ascertain if the volume was successfully created via the
virCommandRun call.

I believe this is safe for 1.2.8

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]