* [PATCH] nvmetcli: Support unique discovery NQN
@ 2024-04-03 11:51 Hannes Reinecke
2024-04-07 19:57 ` Sagi Grimberg
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2024-04-03 11:51 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Keith Busch, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme,
Hannes Reinecke
If the configuration supports unique discovery NQNs we should be
able to view and modify it from nvmetcli.
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
nvmet/nvme.py | 1 +
nvmetcli | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/nvmet/nvme.py b/nvmet/nvme.py
index 59efdb5..fc9c7fe 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -241,6 +241,7 @@ class Root(CFSNode):
raise CFSError("%s does not exist. Giving up." %
self.configfs_dir)
+ self.attr_groups = ['discovery']
self._path = self.configfs_dir
self._create_in_cfs('lookup')
diff --git a/nvmetcli b/nvmetcli
index d949891..3424e6e 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -94,6 +94,10 @@ class UINode(configshell.node.ConfigNode):
class UIRootNode(UINode):
+ ui_desc_attr = {
+ 'nqn': ('string', 'Unique discovery NQN')
+ }
+
def __init__(self, shell):
UINode.__init__(self, '/', parent=None, cfnode=nvme.Root(),
shell=shell)
@@ -116,6 +120,10 @@ class UIRootNode(UINode):
"Configuration restored, %d errors:\n%s" %
(len(errors), "\n".join(errors)))
+ def summary(self):
+ info = []
+ info.append("discovery=" + self.cfnode.get_attr("discovery","nqn"))
+ return (", ".join(info), True)
class UISubsystemsNode(UINode):
def __init__(self, parent):
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-07 19:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03 11:51 [PATCH] nvmetcli: Support unique discovery NQN Hannes Reinecke
2024-04-07 19:57 ` Sagi Grimberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox