All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nvmetcli] 'discovery_nqn' configfs attribute
@ 2025-08-22 11:54 hare
  2025-09-30 11:55 ` Hannes Reinecke
  0 siblings, 1 reply; 2+ messages in thread
From: hare @ 2025-08-22 11:54 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

From: Hannes Reinecke <hare@kernel.org>

Implement support for the 'discovery_nqn' configfs attribute to
allow the user to read or modify the persistent discovery NQN.

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..5111db7 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -234,6 +234,7 @@ class Root(CFSNode):
     def __init__(self):
         super(Root, self).__init__()
 
+        self.attr_groups = ['discovery']
         if not os.path.isdir(self.configfs_dir):
             self._modprobe('nvmet')
 
diff --git a/nvmetcli b/nvmetcli
index d949891..9df6e89 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -94,10 +94,18 @@ class UINode(configshell.node.ConfigNode):
 
 
 class UIRootNode(UINode):
+    ui_desc_discovery = {
+        'nqn': ('string', 'Discovery NQN'),
+    }
     def __init__(self, shell):
         UINode.__init__(self, '/', parent=None, cfnode=nvme.Root(),
                         shell=shell)
 
+    def summary(self):
+        info = []
+        info.append("discovery=" + self.cfnode.get_attr("discovery", "nqn"))
+        return (", ".join(info), True)
+
     def refresh(self):
         self._children = set([])
         UISubsystemsNode(self)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-30 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 11:54 [PATCH nvmetcli] 'discovery_nqn' configfs attribute hare
2025-09-30 11:55 ` Hannes Reinecke

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.