render / rpms / libvirt

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