Skip to content

Merge several fixes/features#2

Open
alesax wants to merge 7 commits into
linux-nvme:masterfrom
alesax:pr
Open

Merge several fixes/features#2
alesax wants to merge 7 commits into
linux-nvme:masterfrom
alesax:pr

Conversation

@alesax

@alesax alesax commented Jun 26, 2026

Copy link
Copy Markdown

This merges several patches submitted to the mailing list:

  • "Use exported configshell symbols" from Stephan Müller
  • "Use preferred module name" from Stephan Müller
  • "'discovery_nqn' configfs attribute" from Hannes Reinecke
  • "chore: remove use of the Python six package." from Matěj Cepl
  • "nvmetcli: add support for NVMe passthru target" from Nilay Shroff
  • "When kmodpy is not available call kmod binary directly" from Michal Suchanek
  • "nvmetcli: reservation configuration support" from Guixin Liu

guixinliu1995 and others added 7 commits June 30, 2026 15:43
Add support for reservation configuration.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
kmodpy is an unmaintained project. Python is not really good at
backwards compatibility. With the upstream project not keeping up with
python churn using the library is a maintenance burden.

nvmet does not use the python library in any substantial way, it only
loads a module once. This can be easily accomplished without any library
using the modprobe tool directly.
This change adds the support for configuring NVMe passthru target.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Python 2 has been truly and completely dead for over five years,
I don't know about any Linux distribution which wouldn't have
Python 3 as its default Python. Please, let it die.
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>
The configshell-fb module is now called configshell. From v2.0.0
onwards the preferred way is to import the module as configshell.

Signed-off-by: Stephan Müller <stephan.mueller@phys.ethz.ch>
Replace direct invocations of configshell internals with actually
exported symbols.

Signed-off-by: Stephan Müller <stephan.mueller@phys.ethz.ch>
@igaw

igaw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

just formality from a quick glance: patch 2 and 3 are missing SoB.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR merges multiple upstream patches to modernize nvmetcli’s Python dependencies, switch to exported configshell symbols, and extend configfs support (discovery NQN, reservations, and NVMe passthru target configuration) across the CLI and backing nvmet library.

Changes:

  • Drop Python six usage and update code to native Python 3 APIs (e.g., dict.items()), updating packaging/docs accordingly.
  • Add support for the discovery_nqn configfs attribute and surface it in the CLI.
  • Introduce passthru and reservation-related plumbing in nvmet/nvme.py and expose passthru controls in the interactive CLI.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
rpm/nvmetcli.spec.tmpl Removes the runtime dependency on python-six.
README Updates stated Python support (Python 3) after removing six.
nvmetcli Switches to exported configshell symbols; adds discovery summary, passthru UI node, and reservation status display.
nvmet/nvme.py Removes six dependency; adds discovery attr group, passthru support, reservation attr group; adds kmod fallback behavior.
nvmet/init.py Exposes Passthru in the package exports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nvmet/nvme.py

nsids = [n.nsid for n in subsystem.namespaces]
for index in moves.xrange(1, self.MAX_NSID + 1):
for index in xrange(1, self.MAX_NSID + 1):
Comment thread nvmet/nvme.py

grpids = [n.grpid for n in port.ana_groups]
for index in moves.xrange(2, self.MAX_GRPID + 1):
for index in xrange(2, self.MAX_GRPID + 1):
Comment thread nvmet/nvme.py
Comment on lines +265 to +272
# Try the binary specified in /proc
try:
kmod = None
with open('/proc/sys/kernel/modprobe', 'r') as f:
kmod = f.read().rstrip()
os.system(kmod + ' ' + modname)
except Exception as e:
pass
Comment thread nvmet/nvme.py
Comment on lines 538 to 542
d['nqn'] = self.nqn
d['namespaces'] = [ns.dump() for ns in self.namespaces]
d['allowed_hosts'] = self.allowed_hosts
d['passthru'] = [self.passthru.dump()]
return d
Comment thread nvmet/nvme.py
try:
pt = Passthru(subsys)
except CFSError as e:
err_func("Could not create Namespace object: %s" % e)
Comment thread nvmetcli
Comment on lines 173 to +177
def refresh(self):
self._children = set([])
UINamespacesNode(self)
UIAllowedHostsNode(self)
UIPassthruNode(self)
Comment thread nvmetcli
Comment on lines +104 to +107
def summary(self):
info = []
info.append("discovery=" + self.cfnode.get_attr("discovery", "nqn"))
return (", ".join(info), True)
Comment thread nvmetcli
Comment on lines +371 to +372
resv_enable = self.cfnode.get_attr("resv", "enable")
info.append("resv_enable=" + str(resv_enable))
Comment thread nvmetcli
Comment on lines +257 to +260
if self.cfnode.admin_timeout != 0:
info.append("admin_tomeout=" + str(self.cfnode.admin_timeout))
if self.cfnode.io_timeout != 0:
info.append("io_tomeout=" + str(self.cfnode.io_timeout))
@maurizio-lombardi

Copy link
Copy Markdown
Contributor

May I suggest to consider this one too? https://lore.kernel.org/linux-nvme/20250728155504.403426-1-mlombard@redhat.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants