]> git.puffer.fish Git - matthieu/frr.git/commit
mgmtd: KISS the locking code
authorChristian Hopps <chopps@labn.net>
Sun, 18 Jun 2023 20:19:54 +0000 (16:19 -0400)
committerChristian Hopps <chopps@labn.net>
Mon, 19 Jun 2023 04:13:28 +0000 (00:13 -0400)
commitdf0173ceeb93572329b04f1bfc5a8925e60513e3
tree6b48aab9aafa50b106ffb7fa0aecd952dd0915b7
parent04b4ede097c94f04cc1d14ce90ee82e35a63d670
mgmtd: KISS the locking code

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>
13 files changed:
lib/command.c
lib/mgmt.proto
lib/mgmt_fe_client.c
lib/mgmt_fe_client.h
lib/northbound_cli.c
lib/vty.c
lib/vty.h
mgmtd/mgmt_fe_adapter.c
mgmtd/mgmt_history.c
mgmtd/mgmt_txn.c
tests/lib/test_grpc.cpp
vtysh/vtysh.c
vtysh/vtysh_config.c