2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

3402 Commits

Author SHA1 Message Date
Ben Pfaff
aeee85aab0 ovs-vsctl: Add --may-exist option for add-br command.
This will be used in the XenServer interface-reconfigure script.
2010-02-09 11:05:19 -08:00
Ben Pfaff
ae8f13e290 ovsdb: Make scalars and 1-element sets interchangeable.
It is natural to write "abc" in place of ["set",["abc"]] and vice versa.
I cannot think of a reason not to support this, and it can make reading
and writing OVSDB files and transactions easier, so support it.
2010-02-08 16:37:49 -08:00
Ben Pfaff
fbf925e45d ovsdb: Get rid of "declare" operation.
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.
2010-02-08 16:03:21 -08:00
Ben Pfaff
bfe8e67ad5 ovsdb: Fix support for systems where libpcre is not installed.
This is one of the loose ends that I intended to fix up and test before
pushing off my commits to add use of PCRE, but obviously I forgot.
2010-02-08 15:37:49 -08:00
Ben Pfaff
0d0f05b909 ovsdb: Add support for referential integrity in the database itself. 2010-02-08 14:16:19 -08:00
Ben Pfaff
bd76d25d8b ovsdb: Add simple constraints. 2010-02-08 14:16:19 -08:00
Ben Pfaff
f89d818005 ovsdb: Fix result object for "declare" operation.
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.
2010-02-08 14:16:18 -08:00
Justin Pettit
a4af00400a Merge branch 'master' into next
Conflicts:
	COPYING
	datapath/datapath.h
	lib/automake.mk
	lib/dpif-provider.h
	lib/dpif.c
	lib/hmap.h
	lib/netdev-provider.h
	lib/netdev.c
	lib/stream-ssl.h
	ofproto/executer.c
	ofproto/ofproto.c
	ofproto/ofproto.h
	tests/automake.mk
	utilities/ovs-ofctl.c
	utilities/ovs-vsctl.in
	vswitchd/ovs-vswitchd.conf.5.in
	xenserver/etc_init.d_vswitch
	xenserver/etc_xensource_scripts_vif
	xenserver/opt_xensource_libexec_interface-reconfigure
2010-02-05 17:14:55 -08:00
Ben Pfaff
93ff0290fd tests: Fix memory leaks in test programs.
This makes it easier to see memory leaks in the code under test.

Found with valgrind.
2010-02-02 15:21:10 -08:00
Ben Pfaff
028cbd9976 tests: Always make ovsdb-server exit cleanly, to better find memory leaks.
"ovs-appctl exit" causes a cleaner shutdown than "kill" and in particular
lets ovsdb-server clean up better, which makes it easier to find real
memory leaks.
2010-02-02 15:21:09 -08:00
Ben Pfaff
b6fa444705 Add support for running the testsuite under 'valgrind'. 2010-02-02 15:21:09 -08:00
Ben Pfaff
28447a186b tests: Fix timing dependency in ovsdb-log test.
The "lockfile" module logs a message if locking takes a measurable amount
of time.  Running the tests under valgrind tends to make this message
appear, so we need to disable it to make the output comparison come out
cleanly.
2010-02-02 15:21:09 -08:00
Ben Pfaff
7c126fbb8a Rework and simplify the "lcov" support for the testsuite. 2010-02-02 15:21:09 -08:00
Ben Pfaff
5c414a2ed8 ovs-vsctl: Add tests for database commands.
Bug #2396.
2010-01-28 16:18:43 -08:00
Ben Pfaff
e328faadc4 ovs-vsctl: Drop redundant {port,iface}-{set,get}-external-ids commands.
These commands can be implemented just as well, and in a more
general-purpose way, using the "set", "remove", and "get" commands.

The br-{get,set}-external-ids commands have slightly more specialized
behavior and so we can't drop them (yet).
2010-01-27 14:28:30 -08:00
Ben Pfaff
40f0707cd9 daemon: Make --monitor process change its process title.
When --monitor is used, administrators sometimes become confused about the
presence of two copies of each process.  This commit attempts to clarify
the situation by making the monitoring process change its process name, as
seen in /proc/$pid/cmdline and in "ps", to clearly indicate what is going
on.

CC: Dan Wendlandt <dan@nicira.com>
2010-01-26 10:52:46 -08:00
Ben Pfaff
29381db022 tests: Fix ovsdb tests.
This code was updated to use the new name of the schema, but I accidentally
left in the old code to check for the old schema's name.  This worked fine
in my own tests, because I still have a copy of that file sitting around,
but fails on "make distcheck" or a clean source dir.

So this commit deletes the code that checks for the old schema file.
2010-01-26 10:46:56 -08:00
Ben Pfaff
31a763d7d7 ovsdb: Require column type "min" value be 0 or 1.
A "min" value greater than 1 is problematic for the database.  There is no
reasonable way to synthesize a default value for such a column: keys in a
set or map must unique, so the database cannot, say, simply set a set of
3 or more integers to [0, 0, 0].

This should have no effect on the vswitch in practice because it does not
have any columns that require more than one element.
2010-01-26 10:32:33 -08:00
Ben Pfaff
7d23a63aa4 json: Export function to parse an individual JSON string.
The JSON syntax for strings is very reasonable.  An upcoming commit will
have a need for a string parser, so make the JSON string parser available
for that.

Also, this change improves the error message for strings that end in the
middle of a \u sequence, so update the tests to match.
2010-01-26 09:47:54 -08:00
Ben Pfaff
00732bf5b5 Cleanly separate IDL annotations from OVSDB schema information.
Until now, the OVSDB IDL annotations have been glommed together with the
schema information in a single file, and then we've used ovsdb-idlc to
extract the schema from that file.  This commit reverses the process:
the schema and the annotations are stored separately and then glommed
together as necessary at build time.

This new arrangement has a few advantages:

    - We can now easily have multiple different sets of IDL annotations
      for a single OVSDB schema.  For example, some users may not need
      access to columns that other users do.

    - Bugs in ovsdb-idlc cannot screw up the underlying schema (as shown
      by a recent commit).
2010-01-26 09:46:42 -08:00
Ben Pfaff
f99cd6eed2 tests: Prefer $(VAR) over @VAR@ in Makefiles.
The Autoconf documentation recently started recommending $(VAR) over @VAR@,
so adopt this style.
2010-01-26 09:31:05 -08:00
Ben Pfaff
05b3c97be6 Add build checks for portable OpenFlow structure padding and alignment.
This causes the build to fail with an error message if openflow.h contains
a structure whose members are not aligned in a portable way.
2010-01-25 10:49:31 -08:00
Ben Pfaff
ff8decf1a3 daemon: Add support for process monitoring and restart. 2010-01-15 15:29:54 -08:00
Ben Pfaff
f59613353b tests: New macro OVS_WAIT_WHILE.
For use by upcoming tests.
2010-01-15 15:28:16 -08:00
Ben Pfaff
24c8ae5330 tests: Factor OVSDB_INIT out of OVS_VSCTL_SETUP for other tests to use.
New tests in upcoming commits will use this.
2010-01-15 15:28:16 -08:00
Ben Pfaff
e3830e909d fatal-signal: After fork, clear hooks instead of disabling them.
Until now, fatal_signal_fork() has simply disabled all the fatal signal
callback hooks.  This worked fine, because a daemon process forked only
once and the parent didn't do much before it exited.

But upcoming commits will introduce a --monitor option, which requires
processes to fork multiple times.  Sometimes the parent process will fork,
then run for a while, then fork again.  It's not good to disable the
hooks in the child process in such a case, because that prevents e.g.
pidfiles from being removed at the child's exit.

So this commit changes the semantics of fatal_signal_fork() to just
clearing out hooks.  After hooks are cleared, new hooks can be added and
will be executed on process termination in the usual way.

This commit also introduces a cancellation callback function so that a
canceled hook can free resources.
2010-01-15 15:28:14 -08:00
Ben Pfaff
4a8535f39d tests: Improve error reporting for timeval test failures. 2010-01-15 11:33:18 -08:00
Ben Pfaff
3603f8da20 reconnect: Fix repeated RECONNECT_CONNECT that was confusing JSON-RPC.
reconnect_run() returns RECONNECT_CONNECT to tell the client that it should
start a new connection.  The client is then supposed to call
reconnect_connecting() to tell the FSM that it has begun a connection
attempt.  However, even after reconnect_connecting() was called,
reconnect_run() continued to return RECONNECT_CONNECT on each call until
the connection succeeded or failed.  This confused the jsonrpc_session
client, which expected that it would get a 0 return value from
reconnect_run() while the connection attempt was in progress.  Connections
that required multiple trips through the main poll loop, e.g. for SSL
negotiation, would often get cut off to start a second connection attempt.

This commit change reconnect_run() to return RECONNECT_CONNECT only until
the client tells it that a connection is in progress, which fixes the
problem.  This change entails a change to the internal details of the
reconnect FSM, so this commit also updates the reconnect tests to match.

Reported by Jeremy Stribling.
2010-01-11 17:02:43 -08:00
Ben Pfaff
80d326ad2a ovsdb: Add tests for OVSDB protocol over SSL. 2010-01-11 13:07:11 -08:00
Ben Pfaff
869decd4fe tests: Make test-vconn build and pass tests without OpenSSL. 2010-01-08 10:01:27 -08:00
Ben Pfaff
d27ce5292c tests: Improve vconn tests. 2010-01-08 09:41:29 -08:00
Ben Pfaff
4c4d10b13f Distribute some forgotten files that are needed by "make check". 2010-01-07 16:13:34 -08:00
Ben Pfaff
dc68127607 vconn: Test SSL vconns too.
This test should help avoid simple bugs in the SSL vconn and SSL stream
implementations in the future.  It would have found the bugs fixed by
recent commits.
2010-01-07 15:00:51 -08:00
Ben Pfaff
557092898d stream: Really enable SSL streams.
SSL streams were supposed to work, but they didn't.  Oops.
2010-01-07 15:00:51 -08:00
Ben Pfaff
250382a8fc Remove "fault" module.
This module, which catches segmentation faults and prints a backtrace
before exiting, was useful for a while, but I believe that it has now
outlived its purpose.  It is altogether better to have a core dump from
which one can extract much more information than a usually-poor backtrace,
and core dumps are much better integrated into a typical Unix system.
In addition, the "fault" module was of course not all that portable.
2010-01-06 17:01:56 -08:00
Ben Pfaff
9467fe6246 Add SSL support to "stream" library and OVSDB. 2010-01-06 14:30:29 -08:00
Ben Pfaff
60cb3eb8b2 vconn: Convert vconn code to modern OVS structure.
The vconn code is a relative fossil as OVS code goes.  It was written
before we had really figured how code should fit together.  Part of that
history is that it used poll_fd_callback() to register callbacks without
the assistance of other code.  That isn't how the rest of OVS works now;
this code is the only remaining user of that function.

To make it more like the rest of the system, this code gets rid of the use
of poll_fd_callback().  It also adds vconn_run() and vconn_run_wait()
functions and calls to them from the places where they are now required.
2010-01-06 14:27:46 -08:00
Ben Pfaff
78f172aa4e Add runtime test that strtok_r() bug fix works.
Our bug fix for glibc's strtok_r() bug was not effective in distribution
tarballs.  This new test should catch that problem earlier in case it
recurs.
2010-01-06 10:01:19 -08:00
Jesse Gross
d8b3070205 fatal-signal: Run signal hooks outside of actual signal handlers.
Rather than running signal hooks directly from the actual signal
handler, simply record the fact that the signal occured and run
the hook next time around the poll loop.  This allows significantly
more freedom as to what can actually be done in the signal hooks.
2010-01-06 09:11:58 -05:00
Ben Pfaff
0b1fae1b73 ovsdb-server: Make database connections configurable from database itself.
Most importantly this adds a "managers" column to the vswitch database
that specifies where the ovsdb-server should connect.
2010-01-04 10:05:51 -08:00
Ben Pfaff
a85c0bbcfd reconnect: Add connection attempt limiting feature.
Sometimes it is useful to limit the number of connection attempts, either
from policy or because it is not possible to reconnect at all (e.g. because
a connection was accepted from a listening socket instead of made with
connect()).  This commit adds that feature.
2010-01-04 09:47:01 -08:00
Ben Pfaff
8419883d69 testsuite: Look for .ovsschema files in source dir as well as build dir.
When a distribution is built with "make dist", the .ovsschema files are
included as part of it, so that the builder does not have to have Python
installed.  However in that case the distributed .ovsschema files are in
the source dir instead of the build dir.  The testsuite always expected
them in the latter directory.  This commit makes it look for them in both
places.
2009-12-17 15:50:01 -08:00
Ben Pfaff
5562d6f55e test-json: Avoid use of /dev/stdin to fix builds in limited chroots.
The chroots in which we often build Open vSwitch don't have /proc and
thus cannot support /dev/stdin, because on Linux that is a symlink to
/proc/self/fd/0.  So avoid using /dev/stdin in the testsuite.
2009-12-17 15:50:01 -08:00
Ben Pfaff
b54e22e91e Make ovs-vswitchd report when it is done configuring; make ovs-vsctl wait.
Until now the ovsdb-based vswitch has provided no way to know when it has
finished applying the configuration from the database.  This commit
introduces a way:

  * The client who wants to wait increments the "next_cfg" column of the
    Open_vSwitch record.

  * When ovs-vswitchd finishes reconfiguring, it sets the value of the
    "cur_cfg" column to that of the "next_cfg" column.

  * The client waits until the "cur_cfg" column is at least as great as
    the value it set into "next_cfg".

This allows us to drop the 5-second sleep in interface-reconfigure.
2009-12-16 16:26:17 -08:00
Ben Pfaff
d171b5846f ovsdb: Add "comment" feature to transactions and make ovs-vsctl use them.
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.
2009-12-16 13:30:53 -08:00
Ben Pfaff
e9f8f9367e ovsdb: Add new "mutation" operation to transactions. 2009-12-16 10:56:04 -08:00
Ben Pfaff
a105c27b4e json: Accurately parse very large real numbers.
The test for whether a real number was outside the valid range was
imprecise and failed at the edge of the real range.  This commit changes
the code to use the C library's strtod(), which presumably does better.
2009-12-16 10:56:04 -08:00
Justin Pettit
18b9283b98 Clean-up compiler warnings about ignoring return values
Some systems complain when certain functions' return values are not
checked.  This commit fixes those warnings.

Creating ignore() function suggested by Ben Pfaff.
2009-12-15 00:14:32 -08:00
Ben Pfaff
99b2042d3b ovsdb: Fix segfault when a column set contains an invalid column name. 2009-12-11 16:37:29 -08:00
Ben Pfaff
ee9e92d81a ovsdb: Cleanly abort delete operations. 2009-12-11 13:26:08 -08:00