diff options
author | Alex Wang <alexw@nicira.com> | 2015-08-04 09:52:26 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2015-08-08 09:49:39 -0700 |
commit | a548a764b89ac6421c9c8bbb5c683aff0d5ddd88 (patch) | |
tree | 707898cbdbc200d4672910d089c56c6219a67564 /lib/ovsdb-idl.h | |
parent | bf4afb5a1582076bc822b8260213291c9ea39e94 (diff) | |
download | openvswitch-a548a764b89ac6421c9c8bbb5c683aff0d5ddd88.tar.gz |
idl-loop: Move idl-loop into ovsdb-idl library.
idl-loop is needed in implementing other controller (i.e., vtep controller).
So, this commit moves the logic into ovsdb-idl library module.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Diffstat (limited to 'lib/ovsdb-idl.h')
-rw-r--r-- | lib/ovsdb-idl.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h index a49f84fb6..519412231 100644 --- a/lib/ovsdb-idl.h +++ b/lib/ovsdb-idl.h @@ -222,5 +222,24 @@ const struct ovsdb_idl_row *ovsdb_idl_txn_insert( const struct uuid *); struct ovsdb_idl *ovsdb_idl_txn_get_idl (struct ovsdb_idl_txn *); + + +/* ovsdb_idl_loop provides an easy way to manage the transactions related + * to 'idl' and to cope with different status during transaction. */ +struct ovsdb_idl_loop { + struct ovsdb_idl *idl; + unsigned int skip_seqno; + + struct ovsdb_idl_txn *committing_txn; + unsigned int precommit_seqno; + + struct ovsdb_idl_txn *open_txn; +}; + +#define OVSDB_IDL_LOOP_INITIALIZER(IDL) { .idl = (IDL) } + +void ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *); +struct ovsdb_idl_txn *ovsdb_idl_loop_run(struct ovsdb_idl_loop *); +void ovsdb_idl_loop_commit_and_wait(struct ovsdb_idl_loop *); #endif /* ovsdb-idl.h */ |