laforge submitted this change.
Add INACTIVE state to slot mapping
If multiple mapping (with different priorities) exist for the same
bank/slot, only one client/slot can be connected to the bank/slot at the
same time. The other mapping(s) will be in INACTIVE state.
Related: SYS#8159
Change-Id: I95dff90deb965f8198effdd355d45419bb4c2b02
---
M src/server/rest_api.c
M src/slotmap.c
M src/slotmap.h
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index 2dc54a2..99c3238 100644
--- a/src/server/rest_api.c
+++ b/src/server/rest_api.c
@@ -368,7 +368,8 @@
switch (map->state) {
case SLMAP_S_NEW:
- /* new map, not yet sent to bank: we can remove it immediately */
+ case SLMAP_S_INACTIVE:
+ /* new or inactive map, not yet sent to bank: we can remove it immediately */
/* delete from bank list (if any) */
llist_del(&map->bank_list);
/* safely initialize list head to avoid trouble when del_slotmap() does another llist_del() */
diff --git a/src/slotmap.c b/src/slotmap.c
index 57cb5b4..9f53ff7 100644
--- a/src/slotmap.c
+++ b/src/slotmap.c
@@ -38,6 +38,7 @@
{ SLMAP_S_ACTIVE, "ACTIVE" },
{ SLMAP_S_DELETE_REQ, "DELETE_REQ" },
{ SLMAP_S_DELETING, "DELETING" },
+ { SLMAP_S_INACTIVE, "INACTIVE" },
{ 0, NULL }
};
diff --git a/src/slotmap.h b/src/slotmap.h
index 9128e70..b1180b4 100644
--- a/src/slotmap.h
+++ b/src/slotmap.h
@@ -38,6 +38,7 @@
SLMAP_S_ACTIVE, /* fully active map; acknowledged by bankd */
SLMAP_S_DELETE_REQ, /* fully active map; REST has requested deletion */
SLMAP_S_DELETING, /* RSPRO has issued Remove to bankd, but bankd hasn't confirmed yet */
+ SLMAP_S_INACTIVE, /* suspended mapping is inactive */
};
extern const struct value_string slot_map_state_name[];
static inline const char *slotmap_state_name(enum slot_mapping_state st)
To view, visit change 43744. To unsubscribe, or for help writing mail filters, visit settings.