From: hare@kernel.org
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>
Subject: [PATCH nvmetcli] 'discovery_nqn' configfs attribute
Date: Fri, 22 Aug 2025 13:54:49 +0200 [thread overview]
Message-ID: <20250822115449.105656-1-hare@kernel.org> (raw)
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
next reply other threads:[~2025-08-23 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 11:54 hare [this message]
2025-09-30 11:55 ` [PATCH nvmetcli] 'discovery_nqn' configfs attribute Hannes Reinecke
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=20250822115449.105656-1-hare@kernel.org \
--to=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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.