From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-nvme@lists.infradead.org
Cc: hch@lst.de, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH 2/2] nvmetcli: allow setting of the subsystem model
Date: Thu, 21 Nov 2019 23:42:13 -0800 [thread overview]
Message-ID: <20191122074213.12232-3-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20191122074213.12232-1-chaitanya.kulkarni@wdc.com>
From: Mark Ruijter <MRuijter@onestopsystems.com>
This patch allows users to set the subsystem's model.
Signed-off-by: Mark Ruijter <MRuijter@onestopsystems.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
nvmetcli | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/nvmetcli b/nvmetcli
index 4fdac53..ea17f95 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -157,6 +157,7 @@ class UISubsystemNode(UINode):
'serial': ('string', 'Export serial number to hosts'),
'cntlid_min': ('number', 'Set min ctrl id'),
'cntlid_max': ('number', 'Set max ctrl id'),
+ 'model': ('string', 'Set a model description'),
'version': ('string', 'Export version number to hosts'),
}
@@ -189,6 +190,13 @@ class UISubsystemNode(UINode):
if cntlid_max != "n/a":
info.append("cntlid_max=" + cntlid_max)
+ try:
+ model = str(self.cfnode.get_attr("attr", "model"))
+ except Exception as e:
+ model = "n/a"
+ if model != "n/a":
+ info.append("model=" + model)
+
return (", ".join(info), True)
--
2.22.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
prev parent reply other threads:[~2019-11-22 7:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 7:42 [PATCH 0/2] nvmetcli: make model and ctrl-id configurable Chaitanya Kulkarni
2019-11-22 7:42 ` [PATCH 1/2] nvmetcli: allow setting of the cntlid[min|max] Chaitanya Kulkarni
2019-11-22 7:42 ` Chaitanya Kulkarni [this message]
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=20191122074213.12232-3-chaitanya.kulkarni@wdc.com \
--to=chaitanya.kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).