]> xenbits.xensource.com Git - libvirt.git/commitdiff
virstoragefile: Introduce virStorageSourceChainHasNVMe
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 21 Jun 2019 15:59:29 +0000 (17:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 17 Dec 2019 09:04:43 +0000 (10:04 +0100)
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 <mprivozn@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/libvirt_private.syms
src/util/virstoragefile.c
src/util/virstoragefile.h

index 19d2c67689d0a74144f4c55623f0656f8a2d39f2..f2592a078223b04df6eaa33a6762c3d18e2f9113 100644 (file)
@@ -3074,6 +3074,7 @@ virStoragePRDefIsManaged;
 virStoragePRDefParseXML;
 virStorageSourceBackingStoreClear;
 virStorageSourceChainHasManagedPR;
+virStorageSourceChainHasNVMe;
 virStorageSourceClear;
 virStorageSourceCopy;
 virStorageSourceFindByNodeName;
index 480f0d7db400d9cb62831703e25c503b818af88d..3a3de314b8471be0a0dd3fb1be73a38444757663 100644 (file)
@@ -2136,6 +2136,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)
+            return true;
+    }
+
+    return false;
+}
+
+
 virSecurityDeviceLabelDefPtr
 virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src,
                                     const char *model)
index 42ca49bc6400a87bb1e695ffb979c07208eb44f0..39e50a989d9d25a0ccbe443ee43829e474c42ee0 100644 (file)
@@ -433,6 +433,8 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src);
 void virStorageSourceNVMeDefFree(virStorageSourceNVMeDefPtr def);
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSourceNVMeDef, virStorageSourceNVMeDefFree);
 
+bool virStorageSourceChainHasNVMe(const virStorageSource *src);
+
 virSecurityDeviceLabelDefPtr
 virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src,
                                     const char *model);