]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvmetcli: fixup ana groupid setting for namespaces
authorHannes Reinecke <hare@suse.de>
Fri, 5 Feb 2021 09:56:36 +0000 (10:56 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 13 Jul 2021 09:20:05 +0000 (11:20 +0200)
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@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmet/nvme.py

index 83fd75b224501e574cd9a8aefa5c6a2b5c851457..d170204dbb56712a2ac0693243d43d3ca08909ee 100644 (file)
@@ -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)