summaryrefslogtreecommitdiff
path: root/tests/test-ovsdb.c
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb-idl: Enhance conditional monitoring APIAndy Zhou2017-01-091-2/+7
| | | | | | | | | To allow client to know when the conditional monitoring changes has been accepted by the OVSDB server and the 'idl' contents has been updated to match the new conditions. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-data: Add support for integer ranges in database commandsLukasz Rzasik2017-01-051-2/+14
| | | | | | | | | | | | | | | | Adding / removing a range of integers to a column accepting a set of integers requires enumarating all of the integers. This patch simplifies it by introducing 'range' concept to the database commands. Two integers separated by a hyphen represent an inclusive range. The patch adds positive and negative tests for the new syntax. The patch was tested by 'make check'. Covarage was tested by 'make check-lcov'. Signed-off-by: Lukasz Rzasik <lukasz.rzasik@gmail.com> Suggested-by: <my_ovs_discuss@yahoo.com> Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idl: Change interface to conditional monitoring.Ben Pfaff2016-12-191-146/+62
| | | | | | | | | | | | | | | | | | | | | | | | Most users of OVSDB react to whatever is currently in their view of the database, as opposed to keeping track of changes and reacting to those changes individually. The interface to conditional monitoring was different, in that it expected the client to say what to add or remove from monitoring instead of what to monitor. This seemed reasonable at the time, but in practice it turns out that the usual approach actually works better, because the condition is generally a function of the data visible in the database. This commit changes the approach. This commit also changes the meaning of an empty condition for a table. Previously, an empty condition meant to replicate every row. Now, an empty condition means to replicate no rows. This is more convenient for code that gradually constructs conditions, because it does not need special cases for replicating nothing. This commit also changes the internal implementation of conditions from linked lists to arrays. I just couldn't see an advantage to using linked lists. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Liran Schour <lirans@il.ibm.com>
* ovsdb-idl: Check internal graph in OVSDB tests.Ben Pfaff2016-10-191-0/+7
| | | | | | | | | Some upcoming tests will add extra trickiness to the IDL internal graph. This worries me, because the IDL doesn't have any checks for its graph consistency. This commit adds some. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idlc: Eliminate <prefix>_init() function from generated code.Ben Pfaff2016-10-191-4/+0
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* Add read-only option to ovs-dpctl and ovs-ofctl commands.Ryan Moats2016-08-151-41/+41
| | | | | | | | | ovs-dpctl and ovs-ofctl lack a read-only option to prevent running of commands that perform read-write operations. Add it and the necessary scaffolding to each. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Make OVSDB backup sever read onlyAndy Zhou2016-08-141-3/+19
| | | | | | | | | | | | | When ovsdb-sever is running in the backup state, it would be nice to make sure there is no un-intended changes to the backup database. This patch makes the ovsdb server only accepts 'read' transactions as a backup server. When the server role is changed into an active server, all existing client connections will be reset. After reconnect, all clinet transactions will then be accepted. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Add/use partial set updates.Ryan Moats2016-08-141-6/+131
| | | | | | | | | | | | | | | | | | | | This patchset mimics the changes introduced in f199df26 (ovsdb-idl: Add partial map updates functionality.) 010fe7ae (ovsdb-idlc.in: Autogenerate partial map updates functions.) 7251075c (tests: Add test for partial map updates.) b1048e6a (ovsdb-idl: Fix issues detected in Partial Map Update feature) but for columns that store sets of values rather than key-value pairs. These columns will now be able to use the OVSDB mutate operation to transmit deltas on the wire rather than use verify/update and transmit wait/update operations on the wire. Side effect of modifying the comments in the partial map update tests. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-nbctl: Add "sync" command to wait for previous changes to take effect.Ben Pfaff2016-08-081-2/+3
| | | | | | | | | | It's slow to add --wait to every ovn-nbctl command; only the last command needs it. But it's sometimes inconvenient to add it to the last command if it's in a loop, etc. This makes it possible to separately wait for the OVN southbound or hypervisors to catch up to the northbound. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com>
* test-ovsdb: Fix memory leak reported by Valgrind.William Tu2016-07-271-0/+1
| | | | | | | | | | | | | | | | | | | Valgrind testcase 1967: simple idl, conditional, modify as delete due to condition - C reports the following leak: json_array_create_empty (json.c:185) json_parser_push_array (json.c:1234) json_parser_input (json.c:1328) json_lex_input (json.c:945) json_parser_feed (json.c:1103) json_from_string (json.c:1025) parse_json (test-ovsdb.c:227) update_conditions (test-ovsdb.c:2324) do_idl (test-ovsdb.c:2389) ovs_cmdl_run_command (command-line.c:121) main (test-ovsdb.c:73) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* json: Move from lib to include/openvswitch.Terry Wilson2016-07-221-1/+1
| | | | | | | | | | | | | | | To easily allow both in- and out-of-tree building of the Python wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to include/openvswitch. This also requires moving lib/{hmap,shash}.h. Both hmap.h and shash.h were #include-ing "util.h" even though the headers themselves did not use anything from there, but rather from include/openvswitch/util.h. Fixing that required including util.h in several C files mostly due to OVS_NOT_REACHED and things like xmalloc. Signed-off-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* lib: add monitor_cond_change API to C IDL libLiran Schour2016-07-181-1/+213
| | | | | | | | | | Add to IDL API that allows the user to add and remove clauses on a table's condition iteratively. IDL maintain tables condition and send monitor_cond_change to the server upon condition change. Add tests for conditional monitoring to IDL. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: add conditions utilities to support monitor_condLiran Schour2016-07-181-2/+76
| | | | | | | | | Change ovsdb_condition to be a 3-element json array or a boolean value (see ovsdb-server man page). Conditions utilities will be used later for conditional monitoring. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Fix dead assignments.William Tu2016-07-021-1/+1
| | | | | | | Found by Clang. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: Add test for partial map updates.Edward Aymerich2016-05-181-1/+116
| | | | | | | | | | Insert basic functionality for testing partial map updates and add a new test table named "simple2". Signed-off-by: Edward Aymerich <edward.aymerich@hpe.com> Signed-off-by: Arnoldo Lutz <arnoldo.lutz.guevara@hpe.com> Co-authored-by: Arnoldo Lutz <arnoldo.lutz.guevara@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/ofp-util.h to include/openvswitch directoryBen Warren2016-04-141-0/+1
| | | | | | | | This commit also adds several #include directives in source files in order to make the 'ofp-util.h' move possible Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* list: Rename all functions in list.h with ovs_ prefix.Ben Warren2016-03-301-2/+2
| | | | | | | This attempts to prevent namespace collisions with other list libraries Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/dynamic-string.h to include/openvswitch directoryBen Warren2016-03-191-1/+1
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* test-ovsdb: Fix memory leak reported by valgrind.William Tu2016-02-101-0/+4
| | | | | | | | | | | | | Testcase 1314: UUID-distinct queries on scalars. Call stacks: allocate_row (row.c:37) ovsdb_row_clone (row.c:67) do_query_distinct (test-ovsdb.c:1232) ovs_cmdl_run_command (command-line.c:121) main (test-ovsdb.c:72) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* test-ovsdb: Fix memory leak reported by valgrind.William Tu2016-02-051-0/+2
| | | | | | | | | | | | Testcase 1311, 1312: Boolean-distinct queries on scalars, reports leak below: xmalloc (util.c:112) do_query_distinct (test-ovsdb.c:1208) ovs_cmdl_run_command (command-line.c:121) main (test-ovsdb.c:72) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idl: Add support for column tracking in IDL.Shad Ansari2016-01-121-0/+63
| | | | | | | | | | Recent IDL change tracking patches allow quick traversal of changed rows. This patch adds additional support to track changed columns. It allows an IDL client to efficiently check if a specific column of a row was updated by IDL. Signed-off-by: Shad Ansari <shad.ansar@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* test-ovsdb: Fix memory leak reported by valgrind.William Tu2016-01-111-1/+3
| | | | | | | | | | | | | | Test case 1205: generate and apply diff -- set -- size (ovsdb-data.at:827) Call stack: ovsdb_error_valist (ovsdb-error.c:40) ovsdb_error (ovsdb-error.c:55) do_diff_data (test-ovsdb.c:427) ovs_cmdl_run_command (command-line.c:121) main (test-ovsdb.c:72) Fix by calling ovsdb_error_destroy() before ovs_fatal() Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* lib: add diff and apply diff APIs for ovsdb_datumAndy Zhou2015-12-111-1/+60
| | | | | | | | | | | | | | | | | | | | | | When an OVSDB column change its value, it is more efficient to only send what has changed, rather than sending the entire new copy. This is analogous to software programmer send patches rather than the entire source file. For columns store a single element, the "diff" datum is the same as the "new" datum. For columns that store set or map, it is only necessary to send the information about the elements changed (including addition or removal). The "diff" for those types are all elements that are changed. Those APIs are mainly used for implementing a new OVSDB server "update2" JSON-RPC notification, which encodes modifications of a column with the contents of those "diff"s. Later patch implements the "update2" notification. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idl: Add support for change tracking.Shad Ansari2015-11-231-52/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ovsdb-idl notifies a client that something changed; it does not track which table, row changed in what way (insert, modify or delete). As a result, a client has to scan or reconfigure the entire idl after ovsdb_idl_run(). This is presumably fine for typical ovs schemas where tables are relatively small. In use-cases where ovsdb is used with schemas that can have very large tables, the current ovsdb-idl notification mechanism does not appear to scale - clients need to do a lot of processing to determine the exact change delta. This change adds support for: - Table and row based change sequence numbers to record the most recent IDL change sequence numbers associated with insert, modify or delete update on that table or row. - Change tracking of specific columns. This ensures that changed rows (inserted, modified, deleted) that have tracked columns, are tracked by IDL. The client can directly access the changed rows with get_first, get_next operations without the need to scan the entire table. The tracking functionality is not enabled by default and needs to be turned on per-column by the client after ovsdb_idl_create() and before ovsdb_idl_run(). /* Example Usage */ idl = ovsdb_idl_create(...); /* Track specific columns */ ovsdb_idl_track_add_column(idl, column); /* Or, track all columns */ ovsdb_idl_track_add_all(idl); for (;;) { ovsdb_idl_run(idl); seqno = ovsdb_idl_get_seqno(idl); /* Process only the changed rows in Table FOO */ FOO_FOR_EACH_TRACKED(row, idl) { /* Determine the type of change from the row seqnos */ if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_DELETE) >= seqno)) { printf("row deleted\n"); } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_MODIFY) >= seqno)) printf("row modified\n"); } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_INSERT) >= seqno)) printf("row inserted\n"); } } /* All changes processed - clear the change track */ ovsdb_idl_track_clear(idl); } Signed-off-by: Shad Ansari <shad.ansari@hp.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* command-line: add ovs_cmdl_contextRussell Bryant2015-03-171-105/+111
| | | | | | | | | | | | | | | | | | | | | | | I started working on a new command line utility that used this shared code. I wanted the ability to pass some data from common initialization code to all of the commands. You can find a similar pattern in ovs-vsctl. This patch updates the command handler to take a new struct, ovs_cmdl_context, instead of argc and argv directly. It includes argc and argv, but also includes an opaque type (void *), where the user of this API can attach its custom data it wants passed along to command handlers. This patch affected the ovstest sub-programs, as well. The patch includes a bit of an odd hack to OVSTEST_REGISTER() to avoid making the main() function of the sub-programs take a ovs_cmdl_context. The test main() functions still receive argc and argv directly, as that seems more natural. The test-subprograms themselves are able to make use of a context internally, though. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_ prefixRussell Bryant2015-03-161-7/+7
| | | | | | | | | | | | | | | | | The coding style guidelines include the following: - Pick a unique name prefix (ending with an underscore) for each module, and apply that prefix to all of that module's externally visible names. Names of macro parameters, struct and union members, and parameters in function prototypes are not considered externally visible for this purpose. This patch adds the new prefix to the externally visible names. This makes it a bit more obvious what code is coming from common command line handling code. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Move compiler.h to <openvswitch/compiler.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | | | The following macros are renamed to avoid conflicts with other headers: * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT * PRINTF_FORMAT to OVS_PRINTF_FORMAT * NO_RETURN to OVS_NO_RETURN Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: Add function to print command usage.Alex Wang2014-10-281-35/+35
| | | | | | | | | | | | | This commit adds a new variable in 'struct command' for recording the command usage. Also, a new function is added to print the usage given the array of defined commands. Later patch will use the output in bash command-line completion script. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* compiler: Define NO_RETURN for MSVC.Gurucharan Shetty2014-09-151-1/+1
| | | | | | | | | | | | | To prevent warnings such as "Not all control paths return a value", we should define NO_RETURN for MSVC. Currently for gcc, we add NO_RETURN at the end of function declaration. But for MSVC, "__declspec(noreturn)" is needed at the beginning of function declaration. So this commit moves NO_RETURN to the beginning of the function declaration as it works with gcc and clang too. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* test-ovsdb: Fix setvbuf incompatibility on Windows.Gurucharan Shetty2014-05-141-1/+1
| | | | | | | | | | | setvbuf() in Windows treats _IOLBF to be the same as _IOFBF. So we cannot have size as zero (otherwise, there is a crash). Workaround is to set _IONBF. I don't see unit test failures because of the change. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Avoid static declarations of arrays with unknown size.Gurucharan Shetty2014-04-041-3/+8
| | | | | | | | | | | Visual studio does not like it. This commit is similar to commit 3815d6c2c (Avoid designated initializers and static decls of arrays of unknown size.) but touches more files. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Revert "ovsdb-data: New functions for predicting serialized length of data."Ben Pfaff2014-04-031-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0ea7bec76d804a2c4efccd3dbdaa3e30cf536a5c. Connections that queue up too much data, because they are monitoring a table that is changing quickly and failing to keep up with the updates, cause problems with buffer management. Since commit 60533a405b2e (jsonrpc-server: Disconnect connections that queue too much data.), ovsdb-server has dealt with them by disconnecting the connection and letting them start up again with a fresh copy of the database. However, this is not ideal because of situations where disconnection happens repeatedly. For example: - A manager toggles a column back and forth between two or more values quickly (in which case the data transmitted over the monitoring connections always increases quickly, without bound). - A manager repeatedly extends the contents of some column in some row (in which case the data transmitted over the monitoring connection grows with O(n**2) in the length of the string). A better way to deal with this problem is to combine updates when they are sent to the monitoring connection, if that connection is not keeping up. In both the above cases, this reduces the data that must be sent to a manageable amount. An upcoming patch implements this new way. This commit reverts part of the previous solution that disconnects backlogged connections, since it is no longer useful. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* Avoid printf type modifiers not supported by MSVC C runtime library.Alin Serdean2013-11-251-6/+6
| | | | | | | | | | | | | The MSVC C library printf() implementation does not support the 'z', 't', 'j', or 'hh' format specifiers. This commit changes the Open vSwitch code to avoid those format specifiers, switching to standard macros from <inttypes.h> where available and inventing new macros resembling them where necessary. It also updates CodingStyle to specify the macros' use and adds a Makefile rule to report violations. Signed-off-by: Alin Serdean <aserdean@cloudbasesolutions.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Make most "struct option" instances "const".Ben Pfaff2013-05-031-1/+1
| | | | | | | | Reducing non-const static data makes code more obviously thread-safe. Although option parsing does not normally need to be thread-safe, I don't know of a drawback to making its data const. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-data: New functions for predicting serialized length of data.Ben Pfaff2013-04-011-3/+11
| | | | | | These will be used for the first time in an upcoming commit. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs-vsctl: Try connecting only once for active connections by default.Ben Pfaff2013-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Until now, ovs-vsctl has kept trying to the database server until it succeeded or the timeout expired (if one was specified with --timeout). This meant that if ovsdb-server wasn't running, then ovs-vsctl would hang. The result was that almost every ovs-vsctl invocation in scripts specified a timeout on the off-chance that the database server might not be running. But it's difficult to choose a good timeout. A timeout that is too short can cause spurious failures. A timeout that is too long causes long delays if the server really isn't running. This commit should alleviate this problem. It changes ovs-vsctl's behavior so that, if it fails to connect to the server, it exits unsuccessfully. This makes --timeout obsolete for the purpose of avoiding a hang if the database server isn't running. (--timeout is still useful to avoid a hang if ovsdb-server is running but ovs-vswitchd is not, for ovs-vsctl commands that modify the database. --no-wait also avoids that issue.) Bug #2393. Bug #15594. Reported-by: Jeff Merrick <jmerrick@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-server: Add support for multiple databases.Ben Pfaff2012-09-241-2/+6
| | | | | | | | | | The OVSDB protocol has supported multiple databases for a long time, but the ovsdb-server implementation only supported one database at a time. This commit adds support for multiple databases. Feature #12353. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-idl: Improve ovsdb_idl_txn_increment() interface.Ben Pfaff2012-04-121-3/+12
| | | | | | The previous interface was just bizarre. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-idl: Simplify transaction retry.Ben Pfaff2012-04-121-3/+11
| | | | | | | | | | | | | | | | | | | | | | Originally the IDL transaction state machine had a return value TXN_TRY_AGAIN to signal the client to wait for a change in the database and then retry its transaction. However, this logic was incomplete, because it was possible for the database to change before the reply to the transaction RPC was received, in which case the client would wait for a further change. Commit 4fdfe5ccf84c (ovsdb-idl: Prevent occasional hang when multiple database clients race.) fixed the problem by breaking TXN_TRY_AGAIN into two status codes, TXN_AGAIN_WAIT that meant to wait for a further change and TXN_AGAIN_NOW that meant that a change had already occurred so try again immediately. This is correct enough, but it is more complicated than necessary. It is simpler and just as correct to use a single "try again" status that requires the client to wait for a change relative to the database contents *before* the transaction was committed. This commit makes that change. It also changes ovsdb_idl_run()'s return type from bool to void because its return type is hardly useful anymore. Signed-off-by: Ben Pfaff <blp@nicira.com>
* Allow configuring DSCP on controller and manager connections.Mehak Mahajan2012-03-231-2/+2
| | | | | | | | | | | The changes allow the user to specify a separate dscp value for the controller connection and the manager connection. The value will take effect on resetting the connections. If no value is specified a default value of 192 is chosen for each of the connections. Feature #10074 Requested-by: Rajiv Ramanathan <rramanathan@nicira.com> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
* jsonrpc: Don't swallow errors in jsonrpc_transact_block().Ethan Jackson2012-02-211-1/+1
| | | | | | | | | If a server returned an error in response to a request, jsonrpc_transact_block() would ignore it. This patch changes the behavior and updates its callers to gracefully handle the possibility. Signed-off-by: Ethan Jackson <ethan@nicira.com>
* tests: Fix typos in C versions of test-ovsdb error messages.Ben Pfaff2011-09-231-3/+3
|
* ovsdb: Implement a "lock" feature in the database protocol.Ben Pfaff2011-07-261-1/+1
| | | | | | | | | | | This provides clients a way to coordinate their access to the database. This is a voluntary, not mandatory, locking protocols, that is, clients are not prevented from modifying the database unless they cooperate with the locking protocol. It is also not related to any of the ACID properties of database transactions. It is strictly a way for clients to coordinate among themselves. The following commit will introduce one user.
* ovsdb: Refactor jsonrpc-server to make the concept of a session public.Ben Pfaff2011-07-261-5/+7
| | | | | | | An upcoming commit will need to expose the concept of a database session to the execution engine, to allow the execution engine to query the locks held by the session. This commit prepares for that by making sessions a publicly visible data structure.
* ovsdb-idl: Plug hole in state machine.Ben Pfaff2011-06-211-0/+7
| | | | | | | | | | | | The state machine didn't have a proper state for "not yet committed or aborted", which meant that destroying an ovsdb_idl_txn without committing or aborting it caused a segfault. This fixes the problem by adding a new state TXN_UNCOMMITTED to the state machine. This is related to commit 79554078d "ovsdb-idl: Fix bad logic in ovsdb_idl_txn_commit() state transitions", which fixed a related bug. Bug #2438.
* ovsdb: Move ovsdb_table_put_row() into test program.Ben Pfaff2011-06-061-2/+12
| | | | | | This function is not useful inside ovsdb itself but only in the "test-ovsdb" test program. To avoid the temptation to use it incorrectly inside ovsdb, this commit moves it into the test program.
* ovsdb: Make ovsdb_column_set_from_json() take table schema instead of table.Ben Pfaff2011-06-061-1/+2
| | | | | | | This function took a struct ovsdb_table but only used the 'schema' member. An upcoming patch needs to parse a column set when only the schema is available, so to prepare for that this patch changes ovsdb_column_set_from_json() to only take the schema that it really needs.
* Consistently write null pointer constants as NULL instead of 0.Ben Pfaff2011-05-161-4/+4
| | | | Found with sparse.