mgmtd: address review comments

Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
Christian Hopps 2023-05-23 08:35:56 -04:00
parent 8611886d52
commit 51941c1916
4 changed files with 8 additions and 14 deletions

View File

@ -2734,10 +2734,8 @@ FILE *vty_open_config(const char *config_file, char *config_default_dir)
if (strstr(config_default_dir, "vtysh") == NULL) { if (strstr(config_default_dir, "vtysh") == NULL) {
ret = stat(integrate_default, &conf_stat); ret = stat(integrate_default, &conf_stat);
if (ret >= 0) { if (ret >= 0)
// read_success = true;
goto tmp_free_and_out; goto tmp_free_and_out;
}
} }
#endif /* VTYSH */ #endif /* VTYSH */
confp = fopen(config_default_dir, "r"); confp = fopen(config_default_dir, "r");

View File

@ -790,11 +790,6 @@ struct msg_conn *mgmt_be_create_adapter(int conn_fd, union sockunion *from)
MGMTD_BE_ADAPTER_DBG("Added new MGMTD Backend adapter '%s'", MGMTD_BE_ADAPTER_DBG("Added new MGMTD Backend adapter '%s'",
adapter->name); adapter->name);
#if 0 /* wait until we receive the SUBSCR_REQ registration with name */
/* Trigger resync of config with the new adapter */
mgmt_be_adapter_sched_init_event(adapter);
#endif
return adapter->conn; return adapter->conn;
} }
@ -820,7 +815,7 @@ int mgmt_be_get_adapter_config(struct mgmt_be_client_adapter *adapter,
assert(cfg_chgs); assert(cfg_chgs);
/* /*
* TODO: we should be consider making this an assertable condition and * TODO: we should consider making this an assertable condition and
* guaranteeing it be true when this function is called. B/c what is * guaranteeing it be true when this function is called. B/c what is
* going to happen if there are some changes being sent, and we don't * going to happen if there are some changes being sent, and we don't
* gather a new snapshot, what new changes that came after the previous * gather a new snapshot, what new changes that came after the previous

View File

@ -76,10 +76,10 @@ DECLARE_LIST(mgmt_be_adapters, struct mgmt_be_client_adapter, list_linkage);
* MGMT_SUBSCR_NOTIFY_CFG :: the client should be notified of config changes * MGMT_SUBSCR_NOTIFY_CFG :: the client should be notified of config changes
* MGMT_SUBSCR_OPER_OWN :: the client owns the given oeprational state * MGMT_SUBSCR_OPER_OWN :: the client owns the given oeprational state
*/ */
#define MGMT_SUBSCR_VALIDATE_CFG 0x1 #define MGMT_SUBSCR_VALIDATE_CFG 0x1
#define MGMT_SUBSCR_NOTIFY_CFG 0x2 #define MGMT_SUBSCR_NOTIFY_CFG 0x2
#define MGMT_SUBSCR_OPER_OWN 0x4 #define MGMT_SUBSCR_OPER_OWN 0x4
#define MGMT_SUBSCR_ALL 0x7 #define MGMT_SUBSCR_ALL 0x7
struct mgmt_be_client_subscr_info { struct mgmt_be_client_subscr_info {
uint xpath_subscr[MGMTD_BE_CLIENT_ID_MAX]; uint xpath_subscr[MGMTD_BE_CLIENT_ID_MAX];

View File

@ -2477,7 +2477,8 @@ int mgmt_txn_notify_be_adapter_conn(struct mgmt_be_client_adapter *adapter,
* has failed. * has failed.
*/ */
FOREACH_TXN_IN_LIST (mgmt_txn_mm, txn) { FOREACH_TXN_IN_LIST (mgmt_txn_mm, txn) {
/* XXX why is this config only? */ /* TODO: update with operational state when that is
* completed */
if (txn->type == MGMTD_TXN_TYPE_CONFIG) { if (txn->type == MGMTD_TXN_TYPE_CONFIG) {
cmtcfg_req = txn->commit_cfg_req cmtcfg_req = txn->commit_cfg_req
? &txn->commit_cfg_req ? &txn->commit_cfg_req