]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: Treat NVMe disks as regular disks
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 26 Jan 2022 12:47:33 +0000 (13:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 27 Jan 2022 07:40:35 +0000 (08:40 +0100)
Unfortunately, udev doesn't set ID_TYPE attribute for NVMe disks,
therefore we have to add another case into udevKludgeStorageType()
to treat /dev/nvme* devlinks as any other disk.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045953
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/node_device/node_device_udev.c

index dd18401e78e617ecc514bbb15b56b0290ce757d6..a9e8bf10da59807607df0a03409a7fdb995a3d96 100644 (file)
@@ -903,6 +903,11 @@ udevKludgeStorageType(virNodeDeviceDef *def)
          * ID_TYPE=disk does not exist on DASDs they fall through
          * the udevProcessStorage detection logic. */
         { "/dev/dasd", "dasd" },
+
+        /* NVMe disk. While strictly speaking /dev/nvme is a
+         * controller not a disk, this function is called if and
+         * only if @def is of VIR_NODE_DEV_CAP_STORAGE type. */
+        { "/dev/nvme", "disk" },
     };
 
     VIR_DEBUG("Could not find definitive storage type for device "