Jesse Gross [Sat, 16 Jan 2010 14:45:45 +0000 (09:45 -0500)]
netdev-linux: Properly store netdev_dev pointer for RTNL callbacks.
We were storing a struct netdev_dev_linux ** instead of a
netdev_dev_linux * in the cache map. This prevented the cache
from being invalidated on changes such as link status.
Justin Pettit [Sat, 16 Jan 2010 08:53:09 +0000 (00:53 -0800)]
rtnetlink: Fix typo in comments referencing rtnetlink_notifier_register()
Justin Pettit [Sat, 16 Jan 2010 01:27:28 +0000 (17:27 -0800)]
netdev: Increase default ingress policing burst size
The default burst rate was 10Kb. This increases it to 1000kb, since
we were having problems getting traffic through at 10kb. A better value
probably exists between these two points, but that will require
additional experimentation.
Ben Pfaff [Fri, 15 Jan 2010 23:22:54 +0000 (15:22 -0800)]
idl: Gracefully handle destroying a transaction before receiving its reply.
If ovsdb_idl_txn_destroy() is called to destroy a transaction before its
reply has been received from the database server, then until now we would
drop the connection to the database when the reply actually arrived,
because we would have no record of that transaction ID any longer.
Notably, ovs-vswitchd does this: it "fires and forgets" database
transactions. (Really, it should not do that, but that's a bigger commit.)
This commit fixes the problem by not dropping the database connection in
such a case.
This fixes an observed problem such that sometimes ovs-vsctl took a long
time to complete, which was because ovs-vswitchd was dropping its
connection to the database and backing off.
Ben Pfaff [Fri, 15 Jan 2010 22:06:15 +0000 (14:06 -0800)]
netdev-linux: Don't close(0) when closing an ordinary netdev.
Calling close(0) at random points is bad. It means that the next call to
socket() or open() returns fd 0. Then the next time a netdev gets closed,
that socket or file fd gets closed too, and you end up with weird "Bad
file descriptor" errors.
Found by installing the following as lib/unistd.h in the source tree:
#ifndef UNISTD_H
#define UNISTD_H 1
#include <stdlib.h>
#include_next <unistd.h>
#undef close
#define close(fd) rpl_close(fd)
static inline int rpl_close(int fd)
{
if (!fd) {
abort();
}
return (close)(fd);
}
#endif
Ben Pfaff [Fri, 15 Jan 2010 21:09:32 +0000 (13:09 -0800)]
Enable daemon monitoring and automatic restart by default.
Tested on a XenServer by running "kill -SEGV" on the daemon processes and
watching them restart automatically and by running plain "kill" and
watching them terminate normally.
Ben Pfaff [Fri, 15 Jan 2010 20:13:46 +0000 (12:13 -0800)]
daemon: Add support for process monitoring and restart.
Ben Pfaff [Fri, 15 Jan 2010 23:29:52 +0000 (15:29 -0800)]
daemon: Refactor code.
This commit should not change behavior, but it paves the way for
implementing --monitor in the following commit.
Ben Pfaff [Fri, 15 Jan 2010 20:12:51 +0000 (12:12 -0800)]
tests: New macro OVS_WAIT_WHILE.
For use by upcoming tests.
Ben Pfaff [Fri, 15 Jan 2010 20:12:36 +0000 (12:12 -0800)]
tests: Factor OVSDB_INIT out of OVS_VSCTL_SETUP for other tests to use.
New tests in upcoming commits will use this.
Ben Pfaff [Fri, 15 Jan 2010 23:28:14 +0000 (15:28 -0800)]
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.
Ben Pfaff [Fri, 15 Jan 2010 18:31:57 +0000 (10:31 -0800)]
unixctl: Avoid double error reporting.
All of these programs were re-reporting an error that
unixctl_server_create() had already reported. There's no need for that.
Ben Pfaff [Fri, 15 Jan 2010 18:31:06 +0000 (10:31 -0800)]
unixctl: Improve error reporting.
The ovs_error() function is our standard way of reporting startup errors,
so use it. (It also outputs the program name at the beginning of the
message.)
Ben Pfaff [Fri, 15 Jan 2010 18:26:20 +0000 (10:26 -0800)]
tests: Improve error reporting for timeval test failures.
Jesse Gross [Fri, 15 Jan 2010 16:48:29 +0000 (11:48 -0500)]
netdev: Fix build for switchui.
Justin Pettit [Fri, 15 Jan 2010 16:33:03 +0000 (08:33 -0800)]
xenserver: Give ovs-vsctl a bit more time to do its work
Creating bonds sometimes fails due to ovs-vsctl timing out. This commit
increases the time interface-reconfigure gives ovs-vsctl from five to
twenty seconds. We should investigate why it's taking ovs-vsctl so
long, but this helps for now.
Jesse Gross [Tue, 12 Jan 2010 20:58:40 +0000 (15:58 -0500)]
netdev-linux: Cleanup tap netdev.
TAP devices need to be treated slightly differently from other other
devices because they cannot be opened multiple times. Instead we
open them once and share the file descriptor. This means that if
the netdev is opened multiple times one reader can drain the buffers
of another. While this is a deviation from the normal convention,
it does not impact current or planned users.
In addition, this cleans up some confusion between the file
descriptor for tap devices versus other FD's.
Jesse Gross [Tue, 12 Jan 2010 00:00:17 +0000 (19:00 -0500)]
gre: Add support for destroying GRE devices.
This allows GRE tunnel devices to be torn down on graceful exit
of vswitch and cleaned up on restart for non-graceful exits.
Jesse Gross [Tue, 12 Jan 2010 21:01:43 +0000 (16:01 -0500)]
netdev: Fully handle netdev lifecycle through refcounting.
This builds on earlier work that implemented netdev object refcounting.
However, rather than requiring explicit create and destroy calls,
these operations are now performed automatically based on the referenece
count. This is important because in certain situations it is not
possible to know whether a netdev has already been created. A
workaround existed (which looked fairly similar to this paradigm) but
introduced it's own issues. This simplifies and unifies the API.
Justin Pettit [Fri, 15 Jan 2010 05:53:43 +0000 (21:53 -0800)]
ovs-vsctl: Add option to create fake iface when adding a bond
Some systems, such as XenServer, expect that bonds have their own interface.
This commit adds the ability to do that with the "--fake-iface" option
in ovs-vsctl's add-bond command. It also has XenServer's
interface-reconfigure use it.
Part of solution to Bug #2376
Jesse Gross [Fri, 15 Jan 2010 01:58:20 +0000 (20:58 -0500)]
gre: Workarounds for large packets over GRE
The first change is to not propagate the IP DF bit from the inner
packet to the outer packet. Large TCP packets can get segmented
first which will set the DF bit. However these segmented packets
might still be too large after the GRE header is added, requiring
fragmentation.
The second change is to raise the MTU of the GRE tunnel device.
This prevents packets from being dropped in the datapath before
they can be fragmented. Since the datapath is layer 2 it does not
do any fragmentation and drops any packets that are too large.
Both of these are temporary workarounds that need to be addressed
more carefully in the future.
Bug #2379
Justin Pettit [Fri, 15 Jan 2010 02:06:33 +0000 (18:06 -0800)]
ovs-vsctl: Don't mask timeout argument
ovs-vsctl supports the "--timeout" option, which specifies the amount
of time that the operation is allowed to take before a SIGALRM is
raised. The code that parsed options had a local "timeout" that masked
the global one that was supposed to be set.
Jesse Gross [Wed, 13 Jan 2010 22:43:09 +0000 (17:43 -0500)]
bonding: Use device names instead of Xen OpaqueRefs
When configuring the slaves of a bond, interface-reconfigure was
directly writing the Xen OpaqueRef as the name instead of first
converting it into a standard device name.
Bug #2377
Justin Pettit [Thu, 14 Jan 2010 21:10:35 +0000 (13:10 -0800)]
ovsdb: Provide helper function to determine if IDL has ever connected
Justin Pettit [Thu, 14 Jan 2010 20:20:09 +0000 (12:20 -0800)]
ovs-brcompatd: Don't consume CPU if can't connect to config db
When ovs-brcompatd can't connect to the database, the "ovs" variable
is never set. The function "brc_recv_update" takes care of draining
brcompat kernel module's netlink messages. When the netlink message
comes in to modify the bridge, that function never gets called, so a
netlink message always appears to be ready and we consume 100% CPU
looping.
With this commit, we log a warning and drop the request on the floor.
Bug #2373
Ben Pfaff [Wed, 13 Jan 2010 17:55:52 +0000 (09:55 -0800)]
ovsdb-client: Fix regression introduced with changes to daemonize().
daemonize() now closes the standard file descriptors, but ovsdb-client's
"monitor" command uses stdout even after daemonizing. This caused
tests that used "ovsdb-client --detach monitor" to fail without printing
their complete output. This commit fixes the problem.
Ben Pfaff [Tue, 12 Jan 2010 22:10:11 +0000 (14:10 -0800)]
daemon: Close standard file descriptors when daemonizing.
Before SSH terminates, it waits for the PTYs that it creates for use as
stdin, stdout, and stderr to be closed. When any of the Open vSwitch
daemons were started in the background over an SSH session, they held
those file descriptors open and thus the SSH session hung. This commit
fixes the problem by closing those file descriptors, allowing SSH to
terminate.
Ben Pfaff [Tue, 12 Jan 2010 18:57:12 +0000 (10:57 -0800)]
xenserver: Make BRCOMPATD_MEMLEAK_LOGFILE setting work.
Sometimes it's too bad that shell variables don't need declarations.
Ben Pfaff [Tue, 12 Jan 2010 18:51:52 +0000 (10:51 -0800)]
ovsdb-idl: Fix memory leak committing a no-op transaction.
Partial fix for bug #2373.
Ben Pfaff [Tue, 12 Jan 2010 18:51:30 +0000 (10:51 -0800)]
jsonrpc: Fix memory leak in jsonrpc_session_send() when not connected.
Partial fix for bug #2373.
Justin Pettit [Tue, 12 Jan 2010 02:36:56 +0000 (18:36 -0800)]
vswitchd: Fix issue of networking not working when Tools not installed
During the transition to the configuration database, not all code from
the bridge compatibility layer was updated. In particular, the code
which removes port configuration based on RTNL notifications of port
removal was not updated. This commit brings that code back.
Note that the code that removes ports based on actively checking whether
ports exist is still commented out pending a review of its impact on GRE
support.
Bug #2370
Justin Pettit [Tue, 12 Jan 2010 00:57:29 +0000 (16:57 -0800)]
ovs-vsctl: Print correct fail-mode
When printing the fail-mode, ovs-vsctl would always attempt to print the
top-level one--even if it didn't exist. So, in addition to sometimes
being wrong, it could cause segfaults.
Thanks to Peter Balland for reporting the error.
Bug #2374
Ben Pfaff [Tue, 12 Jan 2010 01:00:25 +0000 (17:00 -0800)]
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.
Justin Pettit [Mon, 11 Jan 2010 23:31:14 +0000 (15:31 -0800)]
debian: Fix tab/space issues
Justin Pettit [Mon, 11 Jan 2010 23:20:44 +0000 (15:20 -0800)]
debian: Create the config database if it doesn't exist on startup
On startup, create an empty config database if it doesn't already exist. This
is the behavior of the XenServer init scripts.
Ben Pfaff [Mon, 11 Jan 2010 23:21:33 +0000 (15:21 -0800)]
vswitch: Fix null pointer dereference in iface_is_internal().
Reported by Henrik Amren.
Ben Pfaff [Mon, 11 Jan 2010 21:47:35 +0000 (13:47 -0800)]
ovsdb-tool: Make show-log command offer more verbose output.
This may be useful for debugging.
With fixes suggested by Justin Pettit.
Ben Pfaff [Mon, 11 Jan 2010 21:30:15 +0000 (13:30 -0800)]
ovsdb: Improve comments.
Suggested by Justin Pettit.
Ben Pfaff [Mon, 11 Jan 2010 21:14:54 +0000 (13:14 -0800)]
ovsdb: Save some space in the log for newly inserted records.
When a new record is inserted into a database, ovsdb logs the values of all
of the fields in the record. However, often new records have many columns
that contain default values. There is no need to log those values, so this
commit causes them to be omitted.
As a side effect, this also makes "ovsdb-tool show-log --more --more"
output easier to read, because record insertions print less noise. (Adding
--more --more to this command makes it print changes to database records.
The --more option will be introduced in an upcoming commit.)
Ben Pfaff [Mon, 11 Jan 2010 21:07:11 +0000 (13:07 -0800)]
ovsdb: Add tests for OVSDB protocol over SSL.
Ben Pfaff [Mon, 11 Jan 2010 21:06:42 +0000 (13:06 -0800)]
jsonrpc: Check RPC status after trying to send, not before.
This usually prevented JSON-RPC over SSL from working.
Reported-by: Jeremy Stribling <strib@nicira.com>
Ben Pfaff [Mon, 11 Jan 2010 20:03:20 +0000 (12:03 -0800)]
ovsdb: Clarify spec for map mutation insert mutator.
Suggested by Jeremy Stribling.
Ben Pfaff [Mon, 11 Jan 2010 18:04:13 +0000 (10:04 -0800)]
xenserver: Fix init script with multiple --remote options to ovsdb-server.
Reported-by: Peter Balland <peter@nicira.com>
Ben Pfaff [Fri, 8 Jan 2010 23:36:06 +0000 (15:36 -0800)]
jsonrpc: Properly implement connection timeout.
jsonrpc_session_connect() indirectly called reconnect_disconnected(), which
told the reconnect object that the connection had failed, before it told it
that the connection attempt had started. When the connection didn't
complete immediately, this caused the connection to time out immediately,
without any backoff.
Reported by Jeremy Stribling.
Ben Pfaff [Fri, 8 Jan 2010 21:09:10 +0000 (13:09 -0800)]
datapath: Add a find the kernel source directory for Debian 2.6.32+.
Debian's kernel-headers packages starting from 2.6.32 (or thereabouts) put
links to the kernel build and source directories at the same level, named
"build" and "source" respectively. Add support for this structure.
Ben Pfaff [Fri, 8 Jan 2010 18:41:48 +0000 (10:41 -0800)]
xenserver: Fix fallout from removing remote command execution.
Commit
2280e7223 "ofproto: Drop remote command execution feature." removed
the remote command execution feature from the vswitch. This commit removes
one bit that was overlooked.
Ben Pfaff [Fri, 8 Jan 2010 18:02:49 +0000 (10:02 -0800)]
configure: Fix indentation.
Ben Pfaff [Fri, 8 Jan 2010 18:01:27 +0000 (10:01 -0800)]
tests: Make test-vconn build and pass tests without OpenSSL.
Ben Pfaff [Fri, 8 Jan 2010 17:41:29 +0000 (09:41 -0800)]
tests: Improve vconn tests.
Ben Pfaff [Fri, 8 Jan 2010 17:40:45 +0000 (09:40 -0800)]
stream-ssl: Fix bug that crept in during rebasing.
Ben Pfaff [Fri, 8 Jan 2010 00:11:28 +0000 (16:11 -0800)]
Distribute some forgotten files that are needed by "make check".
Ben Pfaff [Thu, 7 Jan 2010 22:00:58 +0000 (14:00 -0800)]
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.
Ben Pfaff [Thu, 7 Jan 2010 21:59:44 +0000 (13:59 -0800)]
stream: Really enable SSL streams.
SSL streams were supposed to work, but they didn't. Oops.
Ben Pfaff [Thu, 7 Jan 2010 21:58:49 +0000 (13:58 -0800)]
stream-ssl: Fix ssl_recv() and ssl_send() return value semantics.
These functions' return value semantics did not match those documented
in stream-provider.h.
Ben Pfaff [Thu, 7 Jan 2010 21:57:53 +0000 (13:57 -0800)]
stream-ssl: Try to shut SSL connections down gracefully.
It's nice to shut down SSL connections gracefully when we can.
Ben Pfaff [Thu, 7 Jan 2010 21:55:35 +0000 (13:55 -0800)]
stream: Make passive SSL and TCP streams report bound addresses as names.
The names of passive SSL and TCP streams were being poorly reported: TCP
always simply reported "ptcp", and SSL reported whatever was passed in.
This commit makes them report the addresses that were actually bound by
the TCP/IP stack, which is more useful for testing, debugging, and logging.
Ben Pfaff [Thu, 7 Jan 2010 23:00:47 +0000 (15:00 -0800)]
socket-util: Make inet_open_passive() pass back the bound address.
This feature is useful in an upcoming commit.
Ben Pfaff [Thu, 7 Jan 2010 19:12:36 +0000 (11:12 -0800)]
socket-util: Allow binding without a port number in inet_open_passive().
The test-vconn program binds a socket to a nonspecific port number. To
add SSL support to this program, it needs to be able to use SSL, and the
stream library is the easiest way to do that. But the stream library
can't bind to a nonspecific port. This commit adds that feature, by adding
it to the function that the stream SSL library uses as a building block.
Ben Pfaff [Tue, 22 Dec 2009 00:38:58 +0000 (16:38 -0800)]
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.
Ben Pfaff [Mon, 21 Dec 2009 21:06:47 +0000 (13:06 -0800)]
ovs-vswitchd: Add ability to bootstrap SSL.
Ben Pfaff [Wed, 6 Jan 2010 22:35:20 +0000 (14:35 -0800)]
vconn: Reimplement in terms of the "stream" abstraction.
This reduces the amount of redundancy in the source tree, by making all of
the current implementations of a vconn simply delegate to the "stream"
abstraction.
Ben Pfaff [Mon, 21 Dec 2009 18:38:26 +0000 (10:38 -0800)]
stream: Remove spurious #includes from header file.
Ben Pfaff [Mon, 21 Dec 2009 21:13:48 +0000 (13:13 -0800)]
Add SSL support to "stream" library and OVSDB.
Ben Pfaff [Sat, 19 Dec 2009 00:15:01 +0000 (16:15 -0800)]
poll-loop: Drop unused poll_fd_callback() feature.
The last user of this feature has been removed, so delete the feature too,
simplifying poll-loop.c significantly.
poll_cancel() is no longer used, either, but deleting it is much less
beneficial.
Ben Pfaff [Wed, 6 Jan 2010 22:27:46 +0000 (14:27 -0800)]
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.
Ben Pfaff [Wed, 6 Jan 2010 22:26:48 +0000 (14:26 -0800)]
stream: Add stream_run(), stream_run_wait() functions.
SSL, which will be added in an upcoming commit, requires some background
processing, which is best done in a "run" function in our architecture.
This commit adds stream_run() and stream_run_wait() and calls to them from
the places where they will be required.
Ben Pfaff [Wed, 6 Jan 2010 22:20:19 +0000 (14:20 -0800)]
Check invariants earlier in vconn and stream code.
These invariants are checked by vconn_open() and stream_open(), but there
is no reason not to check them earlier also. vconn and stream creation
don't have to go through vconn_open() and stream_open(), so this ensures
that the invariants get checked either way.
Ben Pfaff [Mon, 21 Dec 2009 21:10:55 +0000 (13:10 -0800)]
Factor vconn and SSL documentation into manpage include files.
Jesse Gross [Tue, 8 Dec 2009 22:11:22 +0000 (14:11 -0800)]
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.
Justin Pettit [Tue, 5 Jan 2010 03:15:22 +0000 (19:15 -0800)]
ovs-vsctl: Add support for extended vlog options
The man page states that ovs-vsctl supports extended vlog options (e.g.,
--log-file), but the executable did not. This commit adds it.
Justin Pettit [Tue, 15 Dec 2009 19:20:58 +0000 (11:20 -0800)]
datapath: Add missing definitions for building GRE on older kernels
Ben Pfaff [Mon, 4 Jan 2010 21:21:32 +0000 (13:21 -0800)]
ofproto: Get rid of unused parameter to ofconn_destroy().
Ben Pfaff [Mon, 4 Jan 2010 21:21:13 +0000 (13:21 -0800)]
ovs-openflowd: Don't pass extra argument to printf().
Ben Pfaff [Mon, 4 Jan 2010 21:13:12 +0000 (13:13 -0800)]
ovsdb-server: Fix minor memory leak.
Noticed by Justin Pettit.
Ben Pfaff [Tue, 22 Dec 2009 01:02:17 +0000 (17:02 -0800)]
ofproto: Drop remote command execution feature.
At one point Nicira had deployment plans for which adding a remote command
execution feature to the OpenFlow stack made a lot of sense. We no longer
have those plans, as far as I know, and leaving the feature in seems like
a huge potential security hole. So this commit blows away the entire
feature.
Ben Pfaff [Mon, 4 Jan 2010 18:05:51 +0000 (10:05 -0800)]
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.
Ben Pfaff [Thu, 17 Dec 2009 23:16:43 +0000 (15:16 -0800)]
ovsdb-server: Factor out complication by using jsonrpc_session.
Ben Pfaff [Thu, 17 Dec 2009 21:46:16 +0000 (13:46 -0800)]
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.
Ben Pfaff [Fri, 18 Dec 2009 21:46:33 +0000 (13:46 -0800)]
daemon: Don't ignore failed write to pipe.
If the write to the pipe fails here then the parent will think that the
child failed to start up, so the child should oblige it by bailing out.
Justin Pettit [Fri, 18 Dec 2009 22:40:12 +0000 (14:40 -0800)]
xenserver: Use ovs-appctl to reopen log files
During the changes to use the configuration database the "reload"
command was removed from the init script. In addition to reloading the
configuration file, binaries also reopened their log files, which is the
behavior the logrotate configuration expected. This change makes the
logrotate configuration no longer user the "reload" command.
Justin Pettit [Fri, 18 Dec 2009 22:34:05 +0000 (14:34 -0800)]
Remove cfg library
A few places in bridge.c still reference the old cfg library, but they
were commented out a while back. This removes the library, since we've
now switched over to a configuration database.
Justin Pettit [Fri, 18 Dec 2009 22:14:37 +0000 (14:14 -0800)]
xenserver: Use ovs-vsctl for controller configuration in xsconsole
Justin Pettit [Fri, 18 Dec 2009 21:43:28 +0000 (13:43 -0800)]
ovs-vsctl: Support configuring SSL.
Justin Pettit [Fri, 18 Dec 2009 00:05:55 +0000 (16:05 -0800)]
ovs-vsctl: Don't allow controller configuration on fake bridges
Fake bridges can't have controller configuration separate from its
parent, so prevent this from happening.
Thanks to Ben Pfaff for pointing out the problem.
Justin Pettit [Fri, 18 Dec 2009 00:07:14 +0000 (16:07 -0800)]
ovs-vsctl: Fix minor typo in error message
Ben Pfaff [Thu, 17 Dec 2009 18:56:01 +0000 (10:56 -0800)]
daemon: Allow daemon child process to report success or failure to parent.
There are conflicting pressures in startup of a daemon process:
* The parent process should exit with an error code if the daemon
cannot start up successfully.
* Some startup actions must be performed in the child process, not in
the parent. The most obvious of these are file locking, since
child processes do not inherit locks, and anything that requires
knowing the child process's PID (e.g. unixctl sockets).
Until now, this conflict has usually been handled by giving up part of the
first property, i.e. in some cases the parent process would exit
successfully and the child immediately afterward exit with a failure code.
This commit introduces a better approach, by allowing daemons to perform
startup work in the child and only then signal the parent that they have
successfully started. If the child instead exits without signaling
success, the parent passes this exit code along to its own parent.
This commit also modifies the daemons that can usefully take advantage of
this new feature to do so.
Ben Pfaff [Fri, 18 Dec 2009 20:33:34 +0000 (12:33 -0800)]
ovs-brcompatd: Simplify logic and make more robust.
The ovs-brcompatd code was trying hard to make sure that an Open_vSwitch
record would exist in the database before it would look for one. It is
easier to just check for a record and use it if it is there, and it is
also more robust against databases that have not been initialized.
Ben Pfaff [Fri, 18 Dec 2009 18:21:28 +0000 (10:21 -0800)]
ovs-brcompatd: Handle TXN_UNCHANGED status.
This status was introduced several commits ago but not added to the switch
statement here.
Also, change the "status" variable to type enum ovsdb_idl_txn_status so
that GCC will warn about future additions.
Ben Pfaff [Fri, 18 Dec 2009 00:52:49 +0000 (16:52 -0800)]
debian: Distribute some files that were forgotten.
This is important for successfully building Debian packages from a tarball
made with "make dist".
Ben Pfaff [Fri, 18 Dec 2009 00:06:20 +0000 (16:06 -0800)]
debian: Tolerate varying locations of vswitch-idl.ovsschema.
The Debian packaging as well as the testsuite was picky about where
the ovsschema file appeared. This should fix the problem.
Ben Pfaff [Thu, 17 Dec 2009 23:53:43 +0000 (15:53 -0800)]
ovs-vsctl: Fix segfault with fake bridges.
A fake bridge has no br_cfg, so we can't dereference it.
There is a similar problem in cmd_set_controller() and
cmd_del_controller() but this commit does not fix it.
Ben Pfaff [Thu, 17 Dec 2009 23:49:48 +0000 (15:49 -0800)]
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.
Ben Pfaff [Thu, 17 Dec 2009 23:47:27 +0000 (15:47 -0800)]
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.
Ben Pfaff [Thu, 17 Dec 2009 19:20:31 +0000 (11:20 -0800)]
ovsdb-server: Remove write-only struct member.
Justin Pettit [Wed, 16 Dec 2009 23:10:35 +0000 (15:10 -0800)]
ovs-vsctl: Add commands for modifying controller settings
Adds the ability to configure the controller and fail-mode.
Ben Pfaff [Thu, 17 Dec 2009 00:26:17 +0000 (16:26 -0800)]
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.
Ben Pfaff [Wed, 16 Dec 2009 21:58:33 +0000 (13:58 -0800)]
ovsdb-tool: Add "show-log" command for use in debugging.
Ben Pfaff [Wed, 16 Dec 2009 21:40:55 +0000 (13:40 -0800)]
debian: Don't unload kernel modules in init script on "stop" or "restart".
Unloading kernel modules will destroy all of the datapaths, which is a
drastic action. So we are probably better off doing that only if the
user requests it explicitly.
Ben Pfaff [Wed, 16 Dec 2009 21:30:53 +0000 (13:30 -0800)]
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.
Ben Pfaff [Wed, 16 Dec 2009 19:28:13 +0000 (11:28 -0800)]
dynamic-string: New function ds_cstr_ro().