From 51941c1916f6ae8a01c40cf325ba2ae9aa9dad0b Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Tue, 23 May 2023 08:35:56 -0400 Subject: [PATCH] mgmtd: address review comments Signed-off-by: Christian Hopps --- lib/vty.c | 4 +--- mgmtd/mgmt_be_adapter.c | 7 +------ mgmtd/mgmt_be_adapter.h | 8 ++++---- mgmtd/mgmt_txn.c | 3 ++- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/vty.c b/lib/vty.c index ab709ef4c9..4cf63508bf 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -2734,10 +2734,8 @@ FILE *vty_open_config(const char *config_file, char *config_default_dir) if (strstr(config_default_dir, "vtysh") == NULL) { ret = stat(integrate_default, &conf_stat); - if (ret >= 0) { - // read_success = true; + if (ret >= 0) goto tmp_free_and_out; - } } #endif /* VTYSH */ confp = fopen(config_default_dir, "r"); diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index c88b8cf404..2d01f8ecad 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -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'", 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; } @@ -820,7 +815,7 @@ int mgmt_be_get_adapter_config(struct mgmt_be_client_adapter *adapter, 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 * 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 diff --git a/mgmtd/mgmt_be_adapter.h b/mgmtd/mgmt_be_adapter.h index 910ae34b34..8f4eef5fb3 100644 --- a/mgmtd/mgmt_be_adapter.h +++ b/mgmtd/mgmt_be_adapter.h @@ -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_OPER_OWN :: the client owns the given oeprational state */ -#define MGMT_SUBSCR_VALIDATE_CFG 0x1 -#define MGMT_SUBSCR_NOTIFY_CFG 0x2 -#define MGMT_SUBSCR_OPER_OWN 0x4 -#define MGMT_SUBSCR_ALL 0x7 +#define MGMT_SUBSCR_VALIDATE_CFG 0x1 +#define MGMT_SUBSCR_NOTIFY_CFG 0x2 +#define MGMT_SUBSCR_OPER_OWN 0x4 +#define MGMT_SUBSCR_ALL 0x7 struct mgmt_be_client_subscr_info { uint xpath_subscr[MGMTD_BE_CLIENT_ID_MAX]; diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c index d37bcaf985..bf59224338 100644 --- a/mgmtd/mgmt_txn.c +++ b/mgmtd/mgmt_txn.c @@ -2477,7 +2477,8 @@ int mgmt_txn_notify_be_adapter_conn(struct mgmt_be_client_adapter *adapter, * has failed. */ 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) { cmtcfg_req = txn->commit_cfg_req ? &txn->commit_cfg_req -- 2.39.5