|
|
4728c8 |
---
|
|
|
4728c8 |
libmultipath/discovery.c | 11 +++++++++--
|
|
|
4728c8 |
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
4728c8 |
|
|
|
4728c8 |
Index: multipath-tools-130222/libmultipath/discovery.c
|
|
|
4728c8 |
===================================================================
|
|
|
4728c8 |
--- multipath-tools-130222.orig/libmultipath/discovery.c
|
|
|
4728c8 |
+++ multipath-tools-130222/libmultipath/discovery.c
|
|
|
4728c8 |
@@ -889,7 +889,7 @@ nvme_sysfs_pathinfo (struct path * pp)
|
|
|
4728c8 |
{
|
|
|
4728c8 |
struct udev_device *parent;
|
|
|
4728c8 |
const char *attr_path = NULL;
|
|
|
4728c8 |
-
|
|
|
4728c8 |
+ const char *attr;
|
|
|
4728c8 |
|
|
|
4728c8 |
attr_path = udev_device_get_sysname(pp->udev);
|
|
|
4728c8 |
if (!attr_path)
|
|
|
4728c8 |
@@ -902,10 +902,17 @@ nvme_sysfs_pathinfo (struct path * pp)
|
|
|
4728c8 |
pp->sg_id.channel = 0;
|
|
|
4728c8 |
pp->sg_id.lun = 0;
|
|
|
4728c8 |
|
|
|
4728c8 |
- parent = udev_device_get_parent(pp->udev);
|
|
|
4728c8 |
+ parent = udev_device_get_parent_with_subsystem_devtype(pp->udev,
|
|
|
4728c8 |
+ "nvme", NULL);
|
|
|
4728c8 |
if (!parent)
|
|
|
4728c8 |
return 1;
|
|
|
4728c8 |
|
|
|
4728c8 |
+ attr = udev_device_get_sysattr_value(pp->udev, "nsid");
|
|
|
4728c8 |
+ pp->sg_id.lun = attr ? atoi(attr) : 0;
|
|
|
4728c8 |
+
|
|
|
4728c8 |
+ attr = udev_device_get_sysattr_value(parent, "cntlid");
|
|
|
4728c8 |
+ pp->sg_id.channel = attr ? atoi(attr) : 0;
|
|
|
4728c8 |
+
|
|
|
4728c8 |
snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
|
|
|
4728c8 |
snprintf(pp->product_id, PATH_PRODUCT_SIZE, "%s",
|
|
|
4728c8 |
udev_device_get_sysattr_value(parent, "model"));
|