Linux-NVME Archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>
Subject: [PATCH] nvmetcli: Support unique discovery NQN
Date: Wed,  3 Apr 2024 13:51:56 +0200	[thread overview]
Message-ID: <20240403115156.22244-1-hare@kernel.org> (raw)

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



             reply	other threads:[~2024-04-03 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 11:51 Hannes Reinecke [this message]
2024-04-07 19:57 ` [PATCH] nvmetcli: Support unique discovery NQN Sagi Grimberg

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=20240403115156.22244-1-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --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 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 read-only IMAP folder(s) and NNTP newsgroup(s).