]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: zfs: fix double listing of new volumes
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 27 Aug 2014 08:53:07 +0000 (12:53 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Fri, 29 Aug 2014 16:45:42 +0000 (20:45 +0400)
commitc4d2a10238d9534b8bd16eeba27126275339ddba
tree0b7b99c3cd6d1bd50dd6ee5021920983056c4132
parent5c0dad7b39c3e52a2336ae0e7c982bb0c6da250d
storage: zfs: fix double listing of new volumes

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