2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 05:18:13 +00:00

83 Commits

Author SHA1 Message Date
Ben Pfaff
e49190c493 Fix minor memory leaks found by valgrind.
All of these leaks are in normally short-lived programs, so none of them
is very important.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-28 14:54:48 -07:00
Ben Pfaff
8a07709cb8 configure: Remove --with-build-number.
From early days, Nicira used the --with-build-number option to configure to
stamp our internal builds.  We've since switched to another scheme, so
this option is obsolete.

Good riddance.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-19 10:07:09 -07:00
Ben Pfaff
e4476f7438 ovsdb-tool: Use typical db and schema install locations as defaults.
This makes ovsdb-tool easier to use in the common case.

Feature #7756.
Requested-by: Reid Price <reid@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-11 10:23:10 -08:00
Ben Pfaff
4e92542cef ovsdb-tool: Make "show-log" convert raw JSON to easier-to-read syntax.
Now output that formerly looked like ["map", [["key1", "value1"], ["key2",
"value2"]]] is printed like {key1=value1, key2=value2}, which I find easier
to read.
2011-10-24 09:19:34 -07:00
Ben Pfaff
a0a15a0071 ovsdb-tool: Add abbreviated UUIDs to "show-log" even when we have a name.
The "show-log" command tries to give names to the rows to make it easier to
understand what's going on, but it's still important to see at least
partial UUIDs so that one can search the output for references to the rows
by UUID.
2011-10-24 09:19:34 -07:00
Justin Pettit
55d5bb44cb util: Introduce get_program_version function.
Useful in an upcoming commit.
2011-08-04 11:15:43 -07:00
Ben Pfaff
da897f41cd ovsdb: Implement a "lock" feature in the database protocol.
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.
2011-07-26 16:50:09 -07:00
Ben Pfaff
9bdea45ba4 ovsdb-tool: Put version number in comment when compacting or converting.
Adding the version number can make it clear what version of OVS screwed
something up as part of an upgrade or downgrade.
2011-07-07 12:25:04 -07:00
Ben Pfaff
e3c1773370 Consistently write null pointer constants as NULL instead of 0.
Found with sparse.
2011-05-16 13:40:47 -07:00
Justin Pettit
400eb935f2 ovsdb-tool: Close "log" in do_show_log().
Coverity #10726
2011-02-23 11:08:20 -08:00
Ben Pfaff
403e3a25f8 ovsdb-tool: New command "needs-conversion". 2011-02-15 12:24:29 -08:00
Ben Pfaff
6aa0931372 ovsdb-tool: Add commands for printing the database checksum. 2011-02-15 12:24:29 -08:00
Ben Pfaff
e1ebc8cea2 ovsdb: New function ovsdb_file_read_schema() for reading schema from db.
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.
2011-02-15 12:24:28 -08:00
Ben Pfaff
8159b984dc Implement database schema versioning.
As the database schema evolves, it might be useful to have an identifier
for the particular version in use.  This commit adds that feature.
2010-12-27 14:26:47 -08:00
Ben Pfaff
d98e600755 vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.
2010-10-29 09:48:47 -07:00
Justin Pettit
24926bc227 ovsdb-tool: Remove reference to non-implemented "extract-schema" command
While useful sounding, ovsdb-tool does not actually implement a command
called "extract-schema".
2010-09-14 17:57:53 -07:00
Ben Pfaff
5136ce492c vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.
Adding a macro to define the vlog module in use adds a level of
indirection, which makes it easier to change how the vlog module must be
defined.  A followup commit needs to do that, so getting these widespread
changes out of the way first should make that commit easier to review.
2010-07-21 15:47:09 -07:00
Ben Pfaff
9200fb9ef9 vlog: Remove explicit calls to vlog_init().
This is no longer necessary.
2010-07-21 15:47:09 -07:00
Ben Pfaff
ff8bb7e76b timeval: Make time_init() static and remove calls to it.
Since the timeval module now initializes itself on-demand, there is no
longer any need to initialize it explicitly, or to provide an interface to
do so.
2010-07-21 15:47:09 -07:00
Ben Pfaff
7a6ec19d4d ovsdb-tool: Don't wait for lockfiles on "compact" or "convert".
Until now, "ovsdb-tool convert" and "ovsdb-tool compact" were willing to
wait an arbitrarily long time to get a lock on the database or on a
temporary file.  In practice, though, the program most likely to have the
lock is ovsdb-server, which is not a transient process, and thus
ovsdb-tool will likely wait indefinitely if it waits at all.

This commit changes these ovsdb-tool commands so that they won't wait at
all if some other program has the lock.  (The other commands already had
this behavior.)

As a side effect, this change fixes the behavior of
"/etc/init.d/openvswitch start" when Open vSwitch was already running.
Previously, it would hang waiting for "ovsdb-tool convert" to finish.
Now, it completes quickly with an error.

CC: Reid Price <reid@nicira.com>
Bug #2864.
2010-06-15 10:17:52 -07:00
Ben Pfaff
ada496b5cc ovsdb: Compact databases online automatically and on-demand.
If the database grows fairly large, and we've written a fair number of
transactions to it, and it's been a while since the database was compacted,
then (after the next commit) compact the database.

Also, compact the database online if the "ovsdb-server/compact" command is
issued via unixctl.  I suspect that this feature will rarely if ever be
used in practice, but it's easier to test than compacting automatically.

Bug #2391.
2010-03-18 11:24:55 -07:00
Ben Pfaff
b932d88b16 ovsdb-tool: Fix segfault if deleted row doesn't exist.
This "can't happen" normally, but it will if you monkey with the OVSDB
file by hand such that a row that gets deleted never actually existed in
the db.
2010-03-17 14:24:55 -07:00
Ben Pfaff
aebfc86937 ovsdb-tool: Do not lock source db for compacting or converting to new db.
"ovsdb-tool compact SRC DST" and "ovsdb-tool convert SRC SCHEMA DST" do not
need to lock SRC, because they do not modify it.

Reported-by: Justin Pettit <jpettit@nicira.com>
2010-03-08 15:28:12 -08:00
Ben Pfaff
1e19e50e8d ovsdb: Implement ovsdb-tool commands "compact" and "convert".
Partial fix for bug #2391.
2010-02-15 12:54:52 -08:00
Ben Pfaff
7446f1480b ovsdb: Allow ovsdb_log_open()'s caller to choose whether to lock.
The current callers of ovsdb_log_open() always want to lock the file if
they are accessing it for read/write access.  An upcoming commit will add
a new caller that does not fit this model (it wants to lock the file
across a wider region) and so the caller should be able to choose whether
to do locking.  This commit adds that ability.

Also, get rid of the use of <fcntl.h> flags to choose the open mode, which
has always seemed somewhat crude and which this change would make even
cruder.
2010-02-15 11:31:32 -08:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
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".
2010-02-11 11:11:23 -08:00
Ben Pfaff
90cc407153 ovsdb-tool: Fix minor memory leak in "create".
This leak is not important, since "ovsdb-tool create" is a short-running
command, but we might as well fix it.

Found with valgrind.
2010-02-02 15:21:10 -08:00
Ben Pfaff
c6782bb0f7 ovsdb-tool: Make show-log command offer more verbose output.
This may be useful for debugging.

With fixes suggested by Justin Pettit.
2010-01-11 13:47:35 -08:00
Ben Pfaff
722f63016f ovsdb-tool: Add "show-log" command for use in debugging. 2009-12-16 13:58:33 -08:00
Ben Pfaff
bd06962ad3 ovsdb: Add replication support and refactor files in terms of replication.
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.
2009-11-16 10:55:29 -08:00
Ben Pfaff
41709cccb8 ovsdb: Rename ovsdb_file to ovsdb_log.
This prepares for introducing a new, higher-level ovsdb_file that
encapsulates ovsdb storage in a file.
2009-11-16 10:55:27 -08:00
Ben Pfaff
8b681e6fdf ovsdb-tool: Make "query" and "transact" commands work properly.
These were passing O_RDONLY or O_RDWR as arguments to a function that
expected "true" or "false", respectively.
2009-11-06 15:33:47 -08:00
Ben Pfaff
f85f8ebbfa Initial implementation of OVSDB. 2009-11-04 17:12:10 -08:00