On Thu, Jul 11, 2019 at 17:54:07 +0200, Michal Privoznik wrote:
> This function will return true if there's a storage source of
> type VIR_STORAGE_TYPE_NVME, or false otherwise.
> 
> Signed-off-by: Michal Privoznik <[email protected]>
> ---
>  src/libvirt_private.syms  |  1 +
>  src/util/virstoragefile.c | 14 ++++++++++++++
>  src/util/virstoragefile.h |  2 ++
>  3 files changed, 17 insertions(+)

[...]

> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 18aa33fe05..a9ceb697cf 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -2157,6 +2157,20 @@ virStorageSourceNVMeDefFree(virStorageSourceNVMeDefPtr 
> def)
>  }
>  
>  
> +bool
> +virStorageSourceChainHasNVMe(const virStorageSource *src)
> +{
> +    const virStorageSource *n;
> +
> +    for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
> +        if (n->type == VIR_STORAGE_TYPE_NVME)

It occurs to me that if you introduce this function earlier you will be
able to save some code in the previous patches.

ACK to this though.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to