summaryrefslogtreecommitdiff
path: root/ovsdb/execution.c
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb: Fix error leak for negative timeout and invalid until caseThomas Graf2014-08-281-0/+2
| | | | | | | | | | Although the check for negative timeout is present, the error string is overwritten if an invalid "until" is found right after. This leaks an error string and results in not reporting the negative timeout back to the user even though it is encountered first. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Fix memory leaks in error paths.yinpeijun2014-08-271-0/+1
| | | | | | | Found by Fortify. Signed-off-by: yinpeijun <yinpeijun@huawei.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Avoid printf type modifiers not supported by MSVC C runtime library.Alin Serdean2013-11-251-2/+2
| | | | | | | | | | | | | 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>
* Replace most uses of assert by ovs_assert.Ben Pfaff2013-01-161-2/+1
| | | | | | | | This is a straight search-and-replace, except that I also removed #include <assert.h> from each file where there were no assert calls left. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* ovsdb: Enforce immutability of immutable columns.Ben Pfaff2012-09-051-1/+17
| | | | | | | | | | | OVSDB has always had the ability to mark a column as "immutable", so that its value cannot be changed in a given row after that row is initially inserted. However, we discovered recently that ovsdb-server has never enforced this constraint. This commit implements enforcement. Reported-by: Paul Ingram <paul@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.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: Correct specification inconsistency between "lock" and "assert".Ben Pfaff2011-08-081-1/+1
| | | | | | | | | | | The "lock" request requires the lock name to be an <id> but it is shown as <string> in the "assert" operation. This corrects the "assert" specification and fixes the suggested naming convention (since ":" is not valid in an <id>). This commit also updates the implementation to match the specification. Reported-by: Jeremy Stribling <strib@nicira.com>
* ovsdb: Implement a "lock" feature in the database protocol.Ben Pfaff2011-07-261-1/+32
| | | | | | | | | | | 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: Make ovsdb_column_set_from_json() take table schema instead of table.Ben Pfaff2011-06-061-3/+5
| | | | | | | 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.
* ovsdb: Check ovsdb_mutation_set_execute() return value in transactions.Ben Pfaff2011-05-311-4/+5
| | | | | | | | | Errors from this function were being ignored, which meant that transactions could use "mutate" to bypass number-of-elements constraints on sets and maps. This fixes the problem and adds a test to prevent the problem from recurring. Bug #5781.
* Add missing "static" keywords.Ben Pfaff2011-05-161-6/+6
| | | | Found by sparse.
* ovsdb-data: Rename 'used' to 'created' in struct ovsdb_symbol.Ben Pfaff2011-03-101-2/+2
| | | | | | The name 'created' better reflects the actual meaning of this member: in both ovsdb and ovs-vsctl, it is true if a row has been created with the symbol's UUID and false otherwise.
* ovsdb: Improve error message for duplicate uuid-name.Ben Pfaff2011-03-101-11/+12
| | | | | | | | | | | | ovsdb_execute_insert() tried to return a helpful error message when there was a duplicate uuid-name, but ovsdb_execute() (its caller) makes any parse error override a parse error. Since ovsdb_execute_insert() would skip parsing the row when the uuid-name was a duplicate, this meant that the error actually reported would be that "row" was not allowed here, which wasn't at all helpful (since "row" is in fact mandatory). This commit clears up the problem by always retrieving the "row" member, which required a small amount of refactoring, and adds a test.
* ovsdb: Free "error" string in ovsdb_execute_insert().Justin Pettit2011-02-221-0/+1
| | | | Coverity #10723
* Avoid shadowing local variable names.Ben Pfaff2010-09-201-2/+0
| | | | | | | | | | | All of these changes avoid using the same name for two local variables within a same function. None of them are actual bugs as far as I can tell, but any of them could be confusing to the casual reader. The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer loops both using (different) variables named 'i'. Found with GCC -Wshadow.
* ovsdb: Fix bug in "wait" command implementation.Ben Pfaff2010-09-201-1/+0
| | | | | | | | The declaration of "error" that this commit removes shadowed an outer local declaration of "error", which caused errors detected by this code not to be propagated up to the outer level. Found with GCC -Wshadow.
* ovsdb: Fix error message when parsing an operation fails.Ben Pfaff2010-03-181-1/+1
| | | | | Otherwise you get errors with text like "ovsdb operation 2 of 1", which is confusing.
* Merge "master" into "next".Ben Pfaff2010-02-111-6/+6
| | | | | The main change here is the need to update all of the uses of UNUSED in the next branch to OVS_UNUSED as it is now spelled on "master".
* ovsdb: Add support for multiple databases to the protocol.Ben Pfaff2010-02-091-4/+13
| | | | | | This also adds protocol compatibility to the database itself and to ovsdb-client. It doesn't actually add multiple database support to ovsdb-server, since we don't really need that yet.
* ovsdb: Get rid of "declare" operation.Ben Pfaff2010-02-081-45/+8
| | | | | | It's more elegant, and just as easy to implement, if we allow a "named-uuid" to be a forward reference to a "uuid-name" in a later "insert" operation.
* ovsdb: Add simple constraints.Ben Pfaff2010-02-081-1/+25
|
* ovsdb: Fix result object for "declare" operation.Ben Pfaff2010-02-081-2/+5
| | | | | | | | | The "declare" operation is specified to return a <uuid>, e.g.: ["uuid", "7b703002-f7b6-45c6-bfd6-7619b21a1a5f"] It was actually just returning the second part, e.g. "7b703002-f7b6-45c6-bfd6-7619b21a1a5f" This commit makes the result match the specification.
* ovsdb-server: Fix various memory leaks.Ben Pfaff2010-02-021-3/+6
| | | | | | | Some of these are serious leaks, in that they could leak some amount of memory for every transaction processed by the database server. Found with valgrind.
* ovsdb: Add "comment" feature to transactions and make ovs-vsctl use them.Ben Pfaff2009-12-161-0/+17
| | | | | | The idea here is that transaction comments get copied to the ovsdb-server's transaction log, which can then make it clear later why a particular change was made to the database, to ease debugging.
* ovsdb: Add new "mutation" operation to transactions.Ben Pfaff2009-12-161-0/+61
|
* ovsdb: Implement new "declare" operation.Ben Pfaff2009-12-071-2/+46
|
* ovsdb: Allow a named-uuid to be used within the operation that creates it.Ben Pfaff2009-12-021-5/+8
| | | | | | | | | | | | This allows a transaction like this: [{"op": "insert", "table": "mytable", "row": {"i": 0, "k": ["named-uuid", "self"]}, "uuid-name": "self"}] It was already possible to do this by following up on the "insert" with an "update", but since this was easy to implement I did it.
* ovsdb: Add replication support and refactor files in terms of replication.Ben Pfaff2009-11-161-36/+2
| | | | | | | An upcoming commit will add support for replicating tables across JSON-RPC connection. As a prerequisite ovsdb itself must support basic replication. This commit adds that support and then reimplements the ovsdb file storage in terms of that replication.
* ovsdb: Rename ovsdb_file to ovsdb_log.Ben Pfaff2009-11-161-4/+4
| | | | | This prepares for introducing a new, higher-level ovsdb_file that encapsulates ovsdb storage in a file.
* ovsdb: Improve error message for transaction that uses unknown operation.Ben Pfaff2009-11-061-2/+2
| | | | | Without this commit, misspelling an operation name provokes a mysterious error message.
* Initial implementation of OVSDB.Ben Pfaff2009-11-041-0/+613