Blame SOURCES/0002-nvmetcli-don-t-remove-ANA-Group-1-on-clear.patch

cc39cd
From 0827df8deb5304854d9efc58e9df5971aa66f490 Mon Sep 17 00:00:00 2001
cc39cd
From: Hannes Reinecke <hare@suse.de>
cc39cd
Date: Fri, 27 Mar 2020 08:01:34 +0100
cc39cd
Subject: [PATCH] nvmetcli: don't remove ANA Group 1 on clear
cc39cd
cc39cd
The first ANA group is maintained by the kernel so it cannot
cc39cd
be deleted.
cc39cd
cc39cd
Signed-off-by: Hannes Reinecke <hare@suse.de>
cc39cd
Signed-off-by: Christoph Hellwig <hch@lst.de>
cc39cd
---
cc39cd
 nvmet/nvme.py | 5 +++++
cc39cd
 1 file changed, 5 insertions(+)
cc39cd
cc39cd
diff --git a/nvmet/nvme.py b/nvmet/nvme.py
cc39cd
index 0647ddc..fdec4ff 100644
cc39cd
--- a/nvmet/nvme.py
cc39cd
+++ b/nvmet/nvme.py
cc39cd
@@ -845,6 +845,11 @@ class ANAGroup(CFSNode):
cc39cd
 
cc39cd
         a._setup_attrs(n, err_func)
cc39cd
 
cc39cd
+    def delete(self):
cc39cd
+        # ANA Group 1 is automatically created/deleted
cc39cd
+        if self.grpid != 1:
cc39cd
+            super(ANAGroup, self).delete()
cc39cd
+
cc39cd
     def dump(self):
cc39cd
         d = super(ANAGroup, self).dump()
cc39cd
         d['grpid'] = self.grpid
cc39cd
-- 
cc39cd
2.30.2
cc39cd