Blob Blame History Raw
From a14bf252c554c026215a69851c8649f705edaa5d Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Wed, 7 Feb 2018 14:56:13 +0100
Subject: [PATCH 3/7] Add a function for identifying NVDIMM namespaces

---
 blivet/udev.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/blivet/udev.py b/blivet/udev.py
index 6936a230..69e12357 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -914,3 +914,12 @@ def device_get_fcoe_identifier(info):
     if device_is_fcoe(info) and len(path_components) >= 4 and \
        path_components[2] == 'fc':
         return path_components[3]
+
+
+def device_is_nvdimm_namespace(info):
+    if info.get("DEVTYPE") != "disk":
+        return False
+
+    devname = info.get("DEVNAME", "")
+    ninfo = blockdev.nvdimm_namespace_get_devname(devname)
+    return ninfo is not None
-- 
2.14.3