]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Introduce storage volume add, delete, count APIs
authorJohn Ferlan <jferlan@redhat.com>
Tue, 9 May 2017 12:05:16 +0000 (08:05 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 19 Sep 2017 12:28:50 +0000 (08:28 -0400)
commit40630a8e45db6858bfc2cd1ecda6a61d7c02ca1c
treecaf2256d6e0fad2b9bcc3ac3b22ef830f56d7fec
parentacd9a38069a39b1d9148a6be11a4b72ebacf25a1
storage: Introduce storage volume add, delete, count APIs

Create/use virStoragePoolObjAddVol in order to add volumes onto list.

Create/use virStoragePoolObjRemoveVol in order to remove volumes from list.

Create/use virStoragePoolObjGetVolumesCount to get count of volumes on list.

For the storage driver, the logic alters when the volumes.obj list grows
to after we've fetched the volobj. This is an optimization of sorts, but
also doesn't "needlessly" grow the volumes.objs list and then just decr
the count if the virGetStorageVol fails.

Signed-off-by: John Ferlan <jferlan@redhat.com>
13 files changed:
src/conf/virstorageobj.c
src/conf/virstorageobj.h
src/libvirt_private.syms
src/storage/storage_backend_disk.c
src/storage/storage_backend_gluster.c
src/storage/storage_backend_logical.c
src/storage/storage_backend_mpath.c
src/storage/storage_backend_rbd.c
src/storage/storage_backend_sheepdog.c
src/storage/storage_backend_zfs.c
src/storage/storage_driver.c
src/storage/storage_util.c
src/test/test_driver.c