4aa5c4
From c04c7a986bd3514730e4169bf1a70bbec1fda006 Mon Sep 17 00:00:00 2001
4aa5c4
Message-Id: <c04c7a986bd3514730e4169bf1a70bbec1fda006@dist-git>
4aa5c4
From: Michal Privoznik <mprivozn@redhat.com>
4aa5c4
Date: Wed, 26 Jan 2022 13:47:33 +0100
4aa5c4
Subject: [PATCH] node_device: Treat NVMe disks as regular disks
4aa5c4
4aa5c4
Unfortunately, udev doesn't set ID_TYPE attribute for NVMe disks,
4aa5c4
therefore we have to add another case into udevKludgeStorageType()
4aa5c4
to treat /dev/nvme* devlinks as any other disk.
4aa5c4
4aa5c4
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045953
4aa5c4
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4aa5c4
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4aa5c4
(cherry picked from commit f103976ff34a52298df1810d82ececa3e7da4291)
4aa5c4
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2056673
4aa5c4
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4aa5c4
---
4aa5c4
 src/node_device/node_device_udev.c | 5 +++++
4aa5c4
 1 file changed, 5 insertions(+)
4aa5c4
4aa5c4
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
4aa5c4
index dd18401e78..a9e8bf10da 100644
4aa5c4
--- a/src/node_device/node_device_udev.c
4aa5c4
+++ b/src/node_device/node_device_udev.c
4aa5c4
@@ -903,6 +903,11 @@ udevKludgeStorageType(virNodeDeviceDef *def)
4aa5c4
          * ID_TYPE=disk does not exist on DASDs they fall through
4aa5c4
          * the udevProcessStorage detection logic. */
4aa5c4
         { "/dev/dasd", "dasd" },
4aa5c4
+
4aa5c4
+        /* NVMe disk. While strictly speaking /dev/nvme is a
4aa5c4
+         * controller not a disk, this function is called if and
4aa5c4
+         * only if @def is of VIR_NODE_DEV_CAP_STORAGE type. */
4aa5c4
+        { "/dev/nvme", "disk" },
4aa5c4
     };
4aa5c4
 
4aa5c4
     VIR_DEBUG("Could not find definitive storage type for device "
4aa5c4
-- 
4aa5c4
2.35.1
4aa5c4