[libvirt] [PATCH 15/19] storage: Introduce virStoragePoolObjForEachVolume

Peter Krempa pkrempa at redhat.com
Fri May 19 10:46:56 UTC 2017


On Tue, May 09, 2017 at 11:30:22 -0400, John Ferlan wrote:
> Create/Use API to "walk" the storage pool object volume list.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/virstorageobj.c           | 10 ++++++++++
>  src/conf/virstorageobj.h           |  4 ++++
>  src/libvirt_private.syms           |  1 +
>  src/storage/storage_backend_disk.c | 26 +++++++++++++++-----------
>  4 files changed, 30 insertions(+), 11 deletions(-)
> 
> diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
> index cc3464e..14feecb 100644
> --- a/src/conf/virstorageobj.c
> +++ b/src/conf/virstorageobj.c
> @@ -343,6 +343,16 @@ virStoragePoolObjGetVolumesCount(virStoragePoolObjPtr obj)
>  
>  
>  virStorageVolDefPtr
> +virStoragePoolObjForEachVolume(virStoragePoolObjPtr obj,
> +                               size_t curidx)

All 'foreach' functions in libvirt take a callback and iterate the
objects calling the callback. This is just a generic accessor. Naming it
foreach is very confusing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170519/03ba0493/attachment-0001.sig>


More information about the libvir-list mailing list