diff options
| author | Christian Hopps <chopps@labn.net> | 2023-11-29 22:29:14 -0500 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-12-05 13:39:40 -0500 |
| commit | 71ede2db9ee298fbc96ad7310a9e7e1cad4a417c (patch) | |
| tree | a885c30ad765f40877a919abe995d5107fd0f01e /mgmtd/mgmt_be_adapter.c | |
| parent | c37c19a9ec66eb6b0dd2fdbd6d09c09bd2a22108 (diff) | |
mgmtd: enable conn debug when user enables mgmtd debugs
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'mgmtd/mgmt_be_adapter.c')
| -rw-r--r-- | mgmtd/mgmt_be_adapter.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index 0043c9d8e0..ed93244b83 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -668,6 +668,8 @@ struct msg_conn *mgmt_be_create_adapter(int conn_fd, union sockunion *from) MGMTD_BE_MAX_NUM_MSG_WRITE, MGMTD_BE_MSG_MAX_LEN, adapter, "BE-adapter"); + adapter->conn->debug = DEBUG_MODE_CHECK(&mgmt_debug_be, DEBUG_MODE_ALL); + MGMTD_BE_ADAPTER_DBG("Added new MGMTD Backend adapter '%s'", adapter->name); @@ -677,8 +679,7 @@ struct msg_conn *mgmt_be_create_adapter(int conn_fd, union sockunion *from) struct mgmt_be_client_adapter * mgmt_be_get_adapter_by_id(enum mgmt_be_client_id id) { - return (id < MGMTD_BE_CLIENT_ID_MAX ? mgmt_be_adapters_by_id[id] - : NULL); + return (id < MGMTD_BE_CLIENT_ID_MAX ? mgmt_be_adapters_by_id[id] : NULL); } struct mgmt_be_client_adapter * @@ -687,6 +688,14 @@ mgmt_be_get_adapter_by_name(const char *name) return mgmt_be_find_adapter_by_name(name); } +void mgmt_be_adapter_toggle_client_debug(bool set) +{ + struct mgmt_be_client_adapter *adapter; + + FOREACH_ADAPTER_IN_LIST (adapter) + adapter->conn->debug = set; +} + /* * Get a full set of changes for all the config that an adapter is subscribed to * receive. |
