[libvirt] [PATCH v6 01/13] virstoragefile: Add virStorageSourceGetBackingStore

Peter Krempa pkrempa at redhat.com
Mon Nov 2 07:20:47 UTC 2015


On Thu, Oct 29, 2015 at 14:43:08 +0100, Matthias Gatto wrote:
> Create virStorageSourceGetBackingStore function in
> preparation for quorum:
> Actually, if we want to get a backing store inside a virStorageSource
> we have to do it manually(src->backingStore = backingStore).
> The problem is that with a quorum, a virStorageSource
> can contain multiple backing stores, and src->backingStore can
> be treated as a virStorageSourcePtr or a virStorageSourcePtrPtr.
> 
> Due to these reason, we need to simplify the manipulation of
> virStorageSource, and create a function to get the asked
> backingStore in a virStorageSource
> 
> For now, this function only return the backingStore field
> 
> Signed-off-by: Matthias Gatto <matthias.gatto at outscale.com>
> ---
>  src/libvirt_private.syms  | 1 +
>  src/util/virstoragefile.c | 8 ++++++++
>  src/util/virstoragefile.h | 3 +++
>  3 files changed, 12 insertions(+)
> 

...

> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 2aa1d90..3fad323 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -1809,6 +1809,14 @@ virStorageSourcePoolDefCopy(const virStorageSourcePoolDef *src)
>  }
>  
>  
> +virStorageSourcePtr
> +virStorageSourceGetBackingStore(const virStorageSource *src,
> +                                size_t pos ATTRIBUTE_UNUSED)
> +{

This should return NULL in cases when 'pos' is out of range.

> +    return src->backingStore;
> +}

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151102/cb28dbcc/attachment-0001.sig>


More information about the libvir-list mailing list