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