summaryrefslogtreecommitdiff
path: root/mgmtd/mgmt_history.c
AgeCommit message (Collapse)Author
2025-01-13lib: fix new (incorrect) CLANG SA warningsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-27lib, mgmtd: fix commit history locationDavid Lamparter
Both of these belong in `/var/lib`, not `/var/run`. Rather hilariously, the history read in `mgmt_history_read_cmt_record_index` was always failing, because it was doing a `file_exists(MGMTD_COMMIT_FILE_PATH)` check. Which is the wrong macro - it's `.../commit-%s.json`, including the unprocessed `%s`, which would never exist. I guess noone ever tried if this actually works. Cool. On the plus side, this means I don't have to implement legacy compatibility for this, since it never worked to begin with. (SQLite3 DB location is also changed in this commit since it also uses `DAEMON_DB_DIR`.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-12-28lib: step 1: mgmtd: add FE get-tree functionalityChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-19mgmtd: KISS the locking codeChristian Hopps
Move away from things like "lock if not locked" type code, require the user has locked prior to geting to that point. For now we warn if we are taking a lock we already had; however, this should really be a failure point. New requirements: SETCFG - not implicit commit - requires user has locked candidate DS and they must unlock after implicit commit - requires user has locked candidate and running DS both locks will be unlocked on reply to the SETCFG COMMITCFG - requires user has locked candidate and running DS and they must unlock after rollback - this code now get both locks and then does an unlock and early return thing on the adapter side. It needs to be un-special cased in follow up work that would also include tests for this functionality. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-18mgmtd: simplify locking, removing read locksChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-13lib: mgmtd: improvements in logging and commentaryChristian Hopps
- log names of datastores not numbers - improve logging for mgmt_msg_read - Rather than use a bool, instead store the pending const string name of the command being run that has postponed the CLI. This adds some nice information to the logging when enabled. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-18mgmtd: fix uninit warning and cleanup history error messagesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-04mgmtd: simplify commit id to just be a timeval stringChristian Hopps
Also fixes coverity warning Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-05mgmtd: Fixing style warningsrgirada
Description: Fixing the style warnings in the mgmtd code. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-04-05mgmtd: Fixing code coverity issues in mgmtdrgirada
Description: the following list of coverity issues seen in mgmtd code. 1. CID 1536832: Memory - corruptions (OVERLAPPING_COPY) /mgmtd/mgmt_history.c: 85 in mgmt_history_create_cmt_rec() 2. CID 1536831: Error handling issues (NEGATIVE_RETURNS) /mgmtd/mgmt_be_server.c: 123 in mgmt_be_server_start() 3. CID 1536830: Resource leaks (RESOURCE_LEAK) /mgmtd/mgmt_history.c: 146 in mgmt_history_read_cmt_record_index() 4. CID 1536829: Error handling issues (NEGATIVE_RETURNS) /mgmtd/mgmt_fe_server.c: 123 in mgmt_fe_server_start() 5. CID 1536828: Possible Control flow issues (DEADCODE) /mgmtd/mgmt_txn.c: 1859 in mgmt_txn_get_config() 6. CID 1536827: Null pointer dereferences (NULL_RETURNS) /mgmtd/mgmt_ds.c: 526 in mgmt_ds_delete_data_nodes() Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-03-24Merge pull request #12953 from donaldsharp/struct_eventJafar Al-Gharaibeh
Struct event
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-23mgmtd: Fix fd leak.Loganaden Velvindron
Close fd before returning to avoid leaks. Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
2023-03-22lib, mgmtd: Add few fixes for commit-check and rollbackPushpasis Sarkar
This commit contains fixes for the following issues found - 'mgmt commit check' issued through 'vtysh -f' was actually commtting the changeset. - On config validation failure backend, mgmtd was not passing the correct error-reason to frontend. - 'mgmt rollback ...' was reverting the change on backend, but config on mgmtd daemon remains intact Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
2023-03-21mgmtd: Add MGMT Transaction FrameworkYash Ranjan
This commit introduces the MGMT Transaction framework that takes management requests from one (or more) frontend client sessions, translates them into transactions and drives them to completion in co-oridination with one (or more) backend client daemons involved in the request. This commit includes the following functionalities in the changeset: 1. Introduces the actual Transaction module. Commands added related to transaction are: a. show mgmt transaction all 2. Adds support for commit rollback feature which stores upto the 10 commit buffers. Each commit has a commit-id which can be used to rollback to the exact configuration state. Commands supported for this feature are: a. show mgmt commit-history b. mgmt rollback commit-id COMMIT_ID 3. Add hidden commands to enable record various performance metrics: a. mgmt performance-measurement b. mgmt reset-statistic Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>