Skip to contentSkip to conversation

nvmetcli: reservation configuration support

PATCH In review Guixin Liu 3 participants 5 messages Oct 8, 2024 – Oct 20, 2024 NVMe

lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvmetcli: reservation configuration support

Add support for reservation configuration.

---
 nvmet/nvme.py | 2 +-
 nvmetcli      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
nvmet/nvme.py +1 -1
index 59efdb5..20b3cca 100644
@@ -567,7 +567,7 @@ class Namespace(CFSNode):
             if nsid < 1 or nsid > self.MAX_NSID:
                 raise CFSError("NSID must be 1 to %d" % self.MAX_NSID)
 
-        self.attr_groups = ['device', 'ana']
+        self.attr_groups = ['device', 'ana', 'resv']
         self._subsystem = subsystem
         self._nsid = nsid
         self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid)
nvmetcli +2 -0
index d949891..6e5348f 100755
@@ -283,6 +283,8 @@ class UINamespaceNode(UINode):
             info.append("nguid=" + ns_nguid)
         if self.cfnode.grpid != 0:
             info.append("grpid=" + str(self.cfnode.grpid))
+        resv_enable = self.cfnode.get_attr("resv", "enable")
+        info.append("resv_enable=" + str(resv_enable))
         info.append("enabled" if self.cfnode.get_enable() else "disabled")
         ns_enabled = self.cfnode.get_enable()
         return (", ".join(info), True if ns_enabled == 1 else ns_enabled)
Signature · 1 line
2.43.0
author
#1 lore raw

gentel ping..

Best Regards,

Guixin Liu

Quoted 34 lines · Guixin Liu

Add support for reservation configuration.

---
  nvmet/nvme.py | 2 +-
  nvmetcli      | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
nvmet/nvme.py +1 -1
index 59efdb5..20b3cca 100644
@@ -567,7 +567,7 @@ class Namespace(CFSNode):
              if nsid < 1 or nsid > self.MAX_NSID:
                  raise CFSError("NSID must be 1 to %d" % self.MAX_NSID)
 
-        self.attr_groups = ['device', 'ana']
+        self.attr_groups = ['device', 'ana', 'resv']
          self._subsystem = subsystem
          self._nsid = nsid
          self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid)
nvmetcli +2 -0
index d949891..6e5348f 100755
@@ -283,6 +283,8 @@ class UINamespaceNode(UINode):
              info.append("nguid=" + ns_nguid)
          if self.cfnode.grpid != 0:
              info.append("grpid=" + str(self.cfnode.grpid))
+        resv_enable = self.cfnode.get_attr("resv", "enable")
+        info.append("resv_enable=" + str(resv_enable))
          info.append("enabled" if self.cfnode.get_enable() else "disabled")
          ns_enabled = self.cfnode.get_enable()
          return (", ".join(info), True if ns_enabled == 1 else ns_enabled)
author
#2 lore raw
In reply to Guixin Liu

Hi Christoph,

    Could you please take a look at this nvmetcli patch?

Best Regards,

Guixin Liu

Quoted 34 lines · Guixin Liu

Add support for reservation configuration.

---
  nvmet/nvme.py | 2 +-
  nvmetcli      | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
nvmet/nvme.py +1 -1
index 59efdb5..20b3cca 100644
@@ -567,7 +567,7 @@ class Namespace(CFSNode):
              if nsid < 1 or nsid > self.MAX_NSID:
                  raise CFSError("NSID must be 1 to %d" % self.MAX_NSID)
 
-        self.attr_groups = ['device', 'ana']
+        self.attr_groups = ['device', 'ana', 'resv']
          self._subsystem = subsystem
          self._nsid = nsid
          self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid)
nvmetcli +2 -0
index d949891..6e5348f 100755
@@ -283,6 +283,8 @@ class UINamespaceNode(UINode):
              info.append("nguid=" + ns_nguid)
          if self.cfnode.grpid != 0:
              info.append("grpid=" + str(self.cfnode.grpid))
+        resv_enable = self.cfnode.get_attr("resv", "enable")
+        info.append("resv_enable=" + str(resv_enable))
          info.append("enabled" if self.cfnode.get_enable() else "disabled")
          ns_enabled = self.cfnode.get_enable()
          return (", ".join(info), True if ns_enabled == 1 else ns_enabled)
#3 lore raw
Quoted 3 lines · Guixin Liu

Hi Christoph,

    Could you please take a look at this nvmetcli patch?

I'll try to find time to do a nvmetcli sweep this week.