From: Guan Junxiong <guanjunxiong@huawei.com>
To: dm-devel@redhat.com, christophe.varoqui@opensvc.com
Cc: guanjunxiong@huawei.com, niuhaoxin@huawei.com, shenhong09@huawei.com
Subject: [PATCH v2] multipath-tools: output more topology info for NVMe discovery
Date: Mon, 4 Dec 2017 21:13:57 +0800 [thread overview]
Message-ID: <1512393237-18356-1-git-send-email-guanjunxiong@huawei.com> (raw)
From: Jie Yang <yangjie65@huawei.com>
Assign sg_id.channel to controller id of the NVMe/NVMf target
and assign sg_id.lun to namespace ID of the target.
Signed-off-by: Jie Yang <yangjie65@huawei.com>
Reviewed-by: Guan Junxiong <guanjunxiong@huawei.com>
---
change since V1:
patch 2/2 --> path V2 becuase this is an independent patch
libmultipath/discovery.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index cadf461..4b31dde 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1206,12 +1206,14 @@ nvme_sysfs_pathinfo (struct path * pp, vector hwtable)
&pp->sg_id.scsi_id) != 2)
return 1;
pp->sg_id.channel = 0;
- pp->sg_id.lun = 0;
+ pp->sg_id.lun = atoi(udev_device_get_sysattr_value(pp->udev, "nsid"));
parent = udev_device_get_parent(pp->udev);
if (!parent)
return 1;
+ pp->sg_id.channel = atoi(udev_device_get_sysattr_value(parent, "cntlid"));
+
snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
snprintf(pp->product_id, SCSI_PRODUCT_SIZE, "%s",
udev_device_get_sysattr_value(parent, "model"));
--
2.6.4.windows.1
next reply other threads:[~2017-12-04 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 13:13 Guan Junxiong [this message]
2018-01-13 9:09 ` [PATCH v2] multipath-tools: output more topology info for NVMe discovery Christophe Varoqui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1512393237-18356-1-git-send-email-guanjunxiong@huawei.com \
--to=guanjunxiong@huawei.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
--cc=niuhaoxin@huawei.com \
--cc=shenhong09@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.