]> git.proxmox.com Git - mirror_frr.git/commitdiff
mgmtd: address review comments
authorChristian Hopps <chopps@labn.net>
Tue, 23 May 2023 12:35:56 +0000 (08:35 -0400)
committerChristian Hopps <chopps@labn.net>
Tue, 30 May 2023 06:10:20 +0000 (02:10 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
lib/vty.c
mgmtd/mgmt_be_adapter.c
mgmtd/mgmt_be_adapter.h
mgmtd/mgmt_txn.c

index ab709ef4c9e5a9a96eeea97ab8abc9eaddd43dac..4cf63508bffd6ef2c7a20be9afd07372d785f1b1 100644 (file)
--- 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");
index c88b8cf40483b0f3e038a793e57df06022fc0c47..2d01f8ecad47ef5f36a71b65eaab92a94fd81949 100644 (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'",
                             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
index 910ae34b34415880599f3992b9bc9239d2cfc3f7..8f4eef5fb35c989115a1376051fed6b201216219 100644 (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_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];
index d37bcaf985185843de94929b00369503362ea656..bf59224338355946e21c471c357d6c04058d9dde 100644 (file)
@@ -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