[PATCH] nvmetcli: fixup ana groupid setting for namespaces

Hannes Reinecke hare at suse.de
Fri Feb 5 04:56:36 EST 2021


The ANA group of a namespace is displayed, but can't be set.
So add a new attribute group 'ana' to the namespace such that
it can be set via 'set ana grpid'.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 nvmet/nvme.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvmet/nvme.py b/nvmet/nvme.py
index 83fd75b..d170204 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -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']
+        self.attr_groups = ['device', 'ana']
         self._subsystem = subsystem
         self._nsid = nsid
         self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid)
-- 
2.29.2




More information about the Linux-nvme mailing list