Vladimir Sementsov-Ogievskiy 8cad15b156 util: add transactions.c
Add simple transaction API to use in further update of block graph
operations.

Supposed usage is:

- "prepare" is main function of the action and it should make the main
  effect of the action to be visible for the following actions, keeping
  possibility of roll-back, saving necessary things in action state,
  which is prepended to the action list (to do that, prepare func
  should call tran_add()). So, driver struct doesn't include "prepare"
  field, as it is supposed to be called directly.

- commit/rollback is supposed to be called for the list of action
  states, to commit/rollback all the actions in reverse order

- When possible "commit" should not make visible effect for other
  actions, which make possible transparent logical interaction between
  actions.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210428151804.439460-9-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-04-30 12:27:47 +02:00
..
2020-11-03 09:42:52 -05:00
2020-12-10 12:15:18 -05:00
2020-01-06 18:41:32 +04:00
2020-10-15 16:06:27 +02:00
2021-02-18 07:48:22 -08:00
2021-02-12 11:23:19 -06:00
2020-09-01 12:07:52 +02:00
2019-09-11 08:46:17 +02:00
2020-12-10 17:16:44 +01:00
2019-04-18 22:18:59 +02:00
2019-08-16 13:31:52 +02:00
2021-04-30 12:27:47 +02:00
2021-04-01 15:27:44 +04:00