summaryrefslogtreecommitdiff
path: root/ovsdb
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb: Force strong references to non-root tables to be persistent.Ben Pfaff2011-03-312-23/+49
| | | | | | | | | | | | | | | | | | | | | | When a strong reference to a non-root table is ephemeral, the database log can contain inconsistencies. In particular, if the column in question is the only reference to a row, then the row will be created in one logged transaction but the reference to it will not be logged (because it is ephemeral). Thus, any later occurrence of the row later in the log (to modify it, to delete it, or just to reference it) will yield a transaction error and reading the database will abort at that point. This commit fixes the problem by forcing any column with a strong reference to a non-root table to be persistent. The change to ovsdb_schema_from_json() looks bigger than it really is: it just swaps the order of two operations on the schema and updates their comments. Similarly for the update to ovs.db.DbSchema.__init__(). Bug #5144. Reported-by: Sujatha Sumanth <ssumanth@nicira.com> Bug #5149. Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
* Convert shash users that don't use the 'data' value to sset instead.Ben Pfaff2011-03-311-18/+16
| | | | | | In each of the cases converted here, an shash was used simply to maintain a set of strings, with the shash_nodes' 'data' values set to NULL. This commit converts them to use sset instead.
* ovsdb-tool: Fix cut-and-paste error in manpage.Ben Pfaff2011-03-281-2/+2
| | | | Reported-by: Paul Ingram <paul@nicira.com>
* ovsdbmonitor: Fix "make install" race.Ben Pfaff2011-03-141-1/+1
| | | | | | | In a parallel make, the install-exec-local target runs concurrently with the creation of the directory that it installs into. Fix the race by using the install-exec-hook target instead, which runs subsequently to directory creation.
* ovsdb-server: Report time since last connect and disconnect for each manager.Andrew Evans2011-03-143-9/+15
| | | | | | | | | | | | Only the time connected (if connected) or disconnected (if disconnected) is currently reported for each manager. Change to reporting both in seconds since the last connect and disconnect events respectively. An empty value indicates no previous connection or disconnection. This can help diagnose certain connectivity problems, e.g. flapping. Requested-by: Peter Balland <peter@nicira.com> Bug #4833.
* ovsdb: Fix uninitialized data;.Ethan Jackson2011-03-101-1/+1
| | | | This could causes unit tests to fail sometimes.
* ovsdb: Implement garbage collection.Ben Pfaff2011-03-109-39/+237
|
* ovsdb: Don't count self-references in ovsdb_row's n_refs member.Ben Pfaff2011-03-101-0/+4
| | | | | | | | | | | | The comment on the n_refs member of struct ovsdb_row says that it does not count references from a row to itself, but the code didn't implement this properly. This commit makes the code consistent with the comment. This does not actually affect any existing OVSDB behavior, because a row's reference count currently affects only whether it may be deleted, and references from a row to itself disappear when the row is deleted. But an upcoming commit will add new uses for a row's reference count, so at that point it becomes important.
* ovsdb: Provide a way for for_each_txn_row() callback to delete any row.Ben Pfaff2011-03-101-18/+28
| | | | | | | | | | | | | | | | for_each_txn_row() restricts the txn_rows that its callback may delete. Until now, this has meant that its callback could not delete any rows that were created within the transaction being processed. These rows have txn_rows with null 'old' and nonnull 'new', so to delete them requires either removing the txn_row entirely (forbidden by for_each_txn_row()) or clearing its 'new' to null. The latter is forbidden because a txn_row is not allowed to have both 'old' and 'new' null. Until now, this has not been a significant restriction, because none of the processing at transaction commit time required deleting arbitrary rows. Implementing garbage collection, however, does require this ability, so this commit makes it possible by eliminating the requirement that at least 'old' or 'new' be nonnull.
* 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: Improve error reporting for some internal errors.Ben Pfaff2011-03-101-5/+3
| | | | | | | | | Sometimes internal errors are generated based on an originating error. In these cases we were just throwing this information away. This commit adds this information to the internal error report so that the error will be easier to track down. I haven't actually seen a situation like this come up.
* ovsdb-data: Verify that named-uuid string is an <id>.Ben Pfaff2011-03-101-1/+1
| | | | | | | | The "uuid-name" that creates symbols must be an <id> but we weren't verifying the same constraint on the "named-uuid"s that refer to symbols, which was a bit confusing in writing transactions by hand. This commit fixes the inconsistency and updates the SPECS file to clarify that a named-uuid string has to be an <id>.
* ovsdb: Change the way connection duration time is reported in Manager table.Andrew Evans2011-03-093-4/+8
| | | | | | | | | | | | | | Commit 0b3e7a8b71 (ovsdb-server: Write manager status information to Manager table.) attempted to provide managers with the ability to debug manager-related connection problems, but it turns out that reporting "time_in_state" is not very useful, because the state is constantly changing. What people really want is the time each manager has been connected or disconnected, depending on the current connection state. Replace "time_in_state" key with "time_connected" and "time_disconnected" keys. Only one exists at a time, and time is in seconds. Bug #4833.
* ovsdb: Explicitly ignore sscanf() return value in is_valid_version().Ben Pfaff2011-02-231-1/+1
| | | | | | The return value isn't interesting here: it will always be 0. Coverity #10698.
* ovsdb: Warn when result of ovsdb_txn_commit() is ignored and fix caller.Justin Pettit2011-02-232-2/+3
| | | | | | | | ovsdb_txn_commit() may return a ovsdb_error structure, which should be freed by the caller. The only remaining caller that discards the result is in ovsdb_file_open__(), which this fixes. Suggested-by: Ben Pfaff <blp@nicira.com>
* ovsdb-tool: Close "log" in do_show_log().Justin Pettit2011-02-231-0/+1
| | | | Coverity #10726
* ovsdb: Don't check "date" before assignment in ovsdb_file_txn_from_json().Justin Pettit2011-02-221-3/+1
| | | | | | | | There's no indication that "date" is optional in the description of ovsdb_file_txn_from_json(), and the one caller always passes it in, so don't bother checking whether it exists. Coverity #10732
* ovsdb: Free "error" string in ovsdb_execute_insert().Justin Pettit2011-02-221-0/+1
| | | | Coverity #10723
* ovsdb: Fix double free in ovsdb_file_open_log().Justin Pettit2011-02-221-1/+0
| | | | Coverity #11066
* ovsdb-server: Fix memory leak.Ethan Jackson2011-02-171-2/+2
| | | | | Reported-by: Peter Balland <peter@nicira.com> Bug #4698.
* ovsdb-tool: New command "needs-conversion".Ben Pfaff2011-02-154-0/+42
|
* ovsdb-tool: Add commands for printing the database checksum.Ben Pfaff2011-02-155-20/+65
|
* ovsdb: New function ovsdb_file_read_schema() for reading schema from db.Ben Pfaff2011-02-153-26/+76
| | | | | | This new function saves reading the whole database when only the schema is of interest. This commit adapts ovsdb-tool to use it for the "db-version" command. Upcoming commits will introduce another caller.
* table: Add new "bare" output formatting options.Ben Pfaff2011-02-082-1/+2
| | | | | | | --format=list corresponds to the output format that "ovs-vsctl list" has always used. --bare is easier for scripts to parse.
* ovsdb-client: Break table formatting into new library.Ben Pfaff2011-02-082-546/+15
| | | | | This makes the table formatting functions available to other programs. ovs-vsctl will start using it soon on the "list" and "find" commands.
* ovsdb: Fix unused warning.Ethan Jackson2011-02-081-3/+1
| | | | | | | | "warning: 'parse_db_string_column' defined but not used" This commit fixes the above warning when compiling on systems which do not have SSL support. It also causes query_db_string() to always be compiled on these systems as it is not SSL specific and may be useful in the future.
* ovs-vswitchd: Complete daemonization only after initial configuration.Ben Pfaff2011-02-071-0/+3
| | | | | | | Otherwise when we add support for saving and restoring configuration of internal devices around kernel module unload and reload, there's no easy way for the "restore" code to tell when all the interfaces should be set up and ready for configuration.
* daemon: Define daemon options enums the same way as other option enums.Ben Pfaff2011-02-072-3/+5
| | | | | | | Other modules that accept options use this style and I don't see a reason for the daemon code to be different. The style used by the daemon code until now runs the risk of ending up with conflicting values accidentally, which would be confusing.
* ovsdb-server: Write manager status information to Manager table.Andrew Evans2011-02-013-13/+263
| | | | | | | | | | | | This commit makes the status of manager connections visible via the Manager table in the database. Two new columns have been created for this purpose: 'is_connected' and 'status'. The former is a boolean flag, and the latter is a string-string map which may contain the keys "last_error", "state", and "time_in_state". Requested-by: Keith Amidon <keith@nicira.com> Reviewed by: Ben Pfaff. Feature #3692.
* ovsdb-server: Correct Manager inactivity probe column name.Andrew Evans2011-01-271-1/+1
| | | | | | ovsdb-server tries to read from a column named 'probe_interval' in the Manager table, but the column is actually named 'inactivity_probe', so a user-configured probe interval will never be used.
* Add some new generated files to .gitignore.Justin Pettit2011-01-111-0/+2
| | | | A few generated files have snuck in that should be ignored by git.
* Implement database schema versioning.Ben Pfaff2010-12-277-6/+129
| | | | | As the database schema evolves, it might be useful to have an identifier for the particular version in use. This commit adds that feature.
* dot2pic: Be less picky parsing "dot" output.Ben Pfaff2010-12-011-3/+4
| | | | | | | | | | | | | Some versions of "dot" put two spaces after the "node" keyword instead of one, which didn't match the regular expression used in dot2pic. This commit changes dot2pic not to care about the number of spaces in "node" and "graph" lines. (The "graph" lines weren't actually a problem but I don't see a reason to be picky about them either.) Different versions of "dot" still produce different output for the same input, but I don't see how to avoid that. Reported-by: Justin Pettit <jpettit@nicira.com>
* Implement stress option framework.Ben Pfaff2010-11-302-0/+3
| | | | | | | | | | | | | | | | Stress options allow developers testing Open vSwitch to trigger behavior that otherwise would occur only in corner cases. Developers and testers can thereby more easily discover bugs that would otherwise manifest only rarely or nondeterministically. Stress options may cause surprising behavior even when they do not actually reveal bugs, so they should only be enabled as part of testing Open vSwitch. This commit implements the framework and adds a few example stress options. This commit started from code written by Andrew Lambeth. Suggested-by: Henrik Amren <henrik@nicira.com> CC: Andrew Lambeth <wal@nicira.com>
* ovsdb: constify should apply to all pointer types.Ethan Jackson2010-11-291-3/+1
| | | | | All pointers (except double stars) should be const-able in ovsdb-idlc.in generated header files.
* ovsdb: Remove trailing whitespaceEthan Jackson2010-11-296-18/+18
| | | | | This commit removes trailing whitespace from the files in the ovsdb directory.
* Make the "exit" unixctl command reliable in ovsdb-server, ovs-vswitchd.Ben Pfaff2010-11-161-0/+3
| | | | | | | | | | If "ovs-appctl exit" happens to hit ovsdb-server or ovs-vswitchd at a moment when nothing else is happening to wake the daemon up, it can take a long time for them to exit. This seems to account for occasional "make check" failures on Nicira's internal builds. It probably fixes some Debian automatic build failures as well.
* ovsdb: Support replicating a table without including any columns.Ben Pfaff2010-11-161-20/+31
| | | | | | | | | The OVSDB wire protocol has a "monitor" feature that supports table replication on a column-by-column basis. This wire protocol in theory supports replicating a table without replicating any columns in it. In such a case, the client only tracks the UUIDs of the rows in the table. However, the ovsdb-server implementation did not support this possibility properly. This commit fixes the bug.
* ovsdb: Fix "make dist" by distributing dot2pic.Ben Pfaff2010-11-091-1/+1
|
* Add "Manager" and "manager_options" to allow options for OVSDB connections.Ben Pfaff2010-11-054-26/+227
| | | | | | | | | I'm retaining the "managers" column in the Open_vSwitch table for now, but I hope that applications transition to using "manager_options" eventually so that we could drop it. CC: Andrew Lambeth <wal@nicira.com> CC: Jeremy Stribling <strib@nicira.com>
* docs: Implement our own dot->pic translator.Ben Pfaff2010-11-052-0/+64
| | | | | | | | Recent versions of Graphviz no longer support output to PIC format, so this commit adds our own internal translator from dot's "plain" output format to PIC format. The "plain" format works best with slightly different "dot" input (advised by the Graphviz manual description of the "plain" format) so this commit also adjusts ovsdb-dot's output.
* configure: Fix Graphviz test and input generation.Ben Pfaff2010-11-051-5/+7
| | | | | | | | | | This check for Graphviz never actually worked properly because Autoconf swallows up the [] around [gG], so Graphviz was always detected as missing. This commit fixes the problem by doubling up to [[gG]]. Because Graphviz was never used, I never noticed that ovsdb-dot had not been revised to use the latest Python interface to OVSDB, so this commit fixes up those problems too.
* ovsdb-client: Add JSON output format.Ben Pfaff2010-11-032-2/+72
| | | | | Requested-by: DK Moon <dkmoon@nicira.com> CC: DK Moon <dkmoon@nicira.com>
* ovsdb-client: Refactor table code to save original json during formatting.Ben Pfaff2010-11-031-92/+92
| | | | | | This refactoring should not change user-visible behavior, but saving the JSON used to format tables will make it possible to print the raw JSON in the following commit.
* vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.Ben Pfaff2010-10-296-6/+6
| | | | | It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon, so this commit switches to the more common form.
* ovsdb: Document the "mutable" feature for columns.Ben Pfaff2010-10-221-1/+4
| | | | | This feature has been implemented in OVSDB since the beginning, but until now it was undocumented.
* ovsdb-client: Make "dump" print table names in default output format too.Ben Pfaff2010-10-211-0/+4
| | | | | | | | The "dump" command printed table names in CSV and HTML output formats but they were omitted in the default tabular form. This commit corrects the discrepancy. Reported-by: Brad Hall <brad@nicira.com>
* Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.Ben Pfaff2010-10-018-52/+32
| | | | | These macros require one fewer argument by switching, which makes code that uses them shorter and more readable.
* ovsdb-doc: Implement new <option>, <ol> tags.Ben Pfaff2010-09-231-4/+10
|