sliver-openvswitch.git
14 years agotests: Make test-vconn build and pass tests without OpenSSL.
Ben Pfaff [Fri, 8 Jan 2010 18:01:27 +0000 (10:01 -0800)]
tests: Make test-vconn build and pass tests without OpenSSL.

14 years agotests: Improve vconn tests.
Ben Pfaff [Fri, 8 Jan 2010 17:41:29 +0000 (09:41 -0800)]
tests: Improve vconn tests.

14 years agostream-ssl: Fix bug that crept in during rebasing.
Ben Pfaff [Fri, 8 Jan 2010 17:40:45 +0000 (09:40 -0800)]
stream-ssl: Fix bug that crept in during rebasing.

14 years agoDistribute some forgotten files that are needed by "make check".
Ben Pfaff [Fri, 8 Jan 2010 00:11:28 +0000 (16:11 -0800)]
Distribute some forgotten files that are needed by "make check".

14 years agovconn: Test SSL vconns too.
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.

14 years agostream: Really enable SSL streams.
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.

14 years agostream-ssl: Fix ssl_recv() and ssl_send() return value semantics.
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.

14 years agostream-ssl: Try to shut SSL connections down gracefully.
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.

14 years agostream: Make passive SSL and TCP streams report bound addresses as names.
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.

14 years agosocket-util: Make inet_open_passive() pass back the bound address.
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.

14 years agosocket-util: Allow binding without a port number in inet_open_passive().
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.

14 years agoRemove "fault" module.
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.

14 years agoovs-vswitchd: Add ability to bootstrap SSL.
Ben Pfaff [Mon, 21 Dec 2009 21:06:47 +0000 (13:06 -0800)]
ovs-vswitchd: Add ability to bootstrap SSL.

14 years agovconn: Reimplement in terms of the "stream" abstraction.
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.

14 years agostream: Remove spurious #includes from header file.
Ben Pfaff [Mon, 21 Dec 2009 18:38:26 +0000 (10:38 -0800)]
stream: Remove spurious #includes from header file.

14 years agoAdd SSL support to "stream" library and OVSDB.
Ben Pfaff [Mon, 21 Dec 2009 21:13:48 +0000 (13:13 -0800)]
Add SSL support to "stream" library and OVSDB.

14 years agopoll-loop: Drop unused poll_fd_callback() feature.
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.

14 years agovconn: Convert vconn code to modern OVS structure.
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.

14 years agostream: Add stream_run(), stream_run_wait() functions.
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.

14 years agoCheck invariants earlier in vconn and stream code.
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.

14 years agoFactor vconn and SSL documentation into manpage include files.
Ben Pfaff [Mon, 21 Dec 2009 21:10:55 +0000 (13:10 -0800)]
Factor vconn and SSL documentation into manpage include files.

14 years agofatal-signal: Run signal hooks outside of actual signal handlers.
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.

14 years agoovs-vsctl: Add support for extended vlog options
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.

14 years agodatapath: Add missing definitions for building GRE on older kernels
Justin Pettit [Tue, 15 Dec 2009 19:20:58 +0000 (11:20 -0800)]
datapath: Add missing definitions for building GRE on older kernels

14 years agoofproto: Get rid of unused parameter to ofconn_destroy().
Ben Pfaff [Mon, 4 Jan 2010 21:21:32 +0000 (13:21 -0800)]
ofproto: Get rid of unused parameter to ofconn_destroy().

14 years agoovs-openflowd: Don't pass extra argument to printf().
Ben Pfaff [Mon, 4 Jan 2010 21:21:13 +0000 (13:21 -0800)]
ovs-openflowd: Don't pass extra argument to printf().

14 years agoovsdb-server: Fix minor memory leak.
Ben Pfaff [Mon, 4 Jan 2010 21:13:12 +0000 (13:13 -0800)]
ovsdb-server: Fix minor memory leak.

Noticed by Justin Pettit.

14 years agoofproto: Drop remote command execution feature.
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.

14 years agoovsdb-server: Make database connections configurable from database itself.
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.

14 years agoovsdb-server: Factor out complication by using jsonrpc_session.
Ben Pfaff [Thu, 17 Dec 2009 23:16:43 +0000 (15:16 -0800)]
ovsdb-server: Factor out complication by using jsonrpc_session.

14 years agoreconnect: Add connection attempt limiting feature.
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.

14 years agodaemon: Don't ignore failed write to pipe.
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.

14 years agoxenserver: Use ovs-appctl to reopen log files
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.

14 years agoRemove cfg library
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.

14 years agoxenserver: Use ovs-vsctl for controller configuration in xsconsole
Justin Pettit [Fri, 18 Dec 2009 22:14:37 +0000 (14:14 -0800)]
xenserver: Use ovs-vsctl for controller configuration in xsconsole

14 years agoovs-vsctl: Support configuring SSL.
Justin Pettit [Fri, 18 Dec 2009 21:43:28 +0000 (13:43 -0800)]
ovs-vsctl: Support configuring SSL.

14 years agoovs-vsctl: Don't allow controller configuration on fake bridges
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.

14 years agoovs-vsctl: Fix minor typo in error message
Justin Pettit [Fri, 18 Dec 2009 00:07:14 +0000 (16:07 -0800)]
ovs-vsctl: Fix minor typo in error message

14 years agodaemon: Allow daemon child process to report success or failure to parent.
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.

14 years agoovs-brcompatd: Simplify logic and make more robust.
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.

14 years agoovs-brcompatd: Handle TXN_UNCHANGED status.
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.

14 years agodebian: Distribute some files that were forgotten.
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".

14 years agodebian: Tolerate varying locations of vswitch-idl.ovsschema.
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.

14 years agoovs-vsctl: Fix segfault with fake bridges.
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.

14 years agotestsuite: Look for .ovsschema files in source dir as well as build dir.
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.

14 years agotest-json: Avoid use of /dev/stdin to fix builds in limited chroots.
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.

14 years agoovsdb-server: Remove write-only struct member.
Ben Pfaff [Thu, 17 Dec 2009 19:20:31 +0000 (11:20 -0800)]
ovsdb-server: Remove write-only struct member.

14 years agoovs-vsctl: Add commands for modifying controller settings
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.

14 years agoMake ovs-vswitchd report when it is done configuring; make ovs-vsctl wait.
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.

14 years agoovsdb-tool: Add "show-log" command for use in debugging.
Ben Pfaff [Wed, 16 Dec 2009 21:58:33 +0000 (13:58 -0800)]
ovsdb-tool: Add "show-log" command for use in debugging.

14 years agodebian: Don't unload kernel modules in init script on "stop" or "restart".
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.

14 years agoovsdb: Add "comment" feature to transactions and make ovs-vsctl use them.
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.

14 years agodynamic-string: New function ds_cstr_ro().
Ben Pfaff [Wed, 16 Dec 2009 19:28:13 +0000 (11:28 -0800)]
dynamic-string: New function ds_cstr_ro().

14 years agoFix typos in ovsdb specification.
Ben Pfaff [Wed, 16 Dec 2009 19:27:58 +0000 (11:27 -0800)]
Fix typos in ovsdb specification.

14 years agoovsdb: Add new "mutation" operation to transactions.
Ben Pfaff [Wed, 16 Dec 2009 18:49:31 +0000 (10:49 -0800)]
ovsdb: Add new "mutation" operation to transactions.

14 years agojson: Accurately parse very large real numbers.
Ben Pfaff [Wed, 16 Dec 2009 18:55:46 +0000 (10:55 -0800)]
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.

14 years agodebian: Change openvswitch-switch deb to use ovsdb-server and ovs-vswitchd.
Ben Pfaff [Tue, 15 Dec 2009 21:11:24 +0000 (13:11 -0800)]
debian: Change openvswitch-switch deb to use ovsdb-server and ovs-vswitchd.

This appears to work in that it creates the database on installation,
starts and stops the programs and loads and unloads the kernel modules at
the right times, but it has not been tested beyond that.

14 years agodebian: Move openvswitch-dbg to "debug" section.
Ben Pfaff [Tue, 15 Dec 2009 19:24:25 +0000 (11:24 -0800)]
debian: Move openvswitch-dbg to "debug" section.

Noticed by lintian.

14 years agodebian: Update changelog.
Ben Pfaff [Tue, 15 Dec 2009 19:00:50 +0000 (11:00 -0800)]
debian: Update changelog.

14 years agodebian: Make all binary packages depend on ${misc:Depends}.
Ben Pfaff [Tue, 15 Dec 2009 18:59:49 +0000 (10:59 -0800)]
debian: Make all binary packages depend on ${misc:Depends}.

According to lintian:

> The source package uses debhelper but it does not use ${misc:Depends} in
> the given binary package's debian/control entry. This is required so the
> dependencies are set correctly in case the result of a call to any of
> the dh_ commands cause the package to depend on another package.

Fixed by adding ${misc:Depends} as a dependency to all binary packages that
didn't already have it.

14 years agodebian: Make binary NMUs possible.
Ben Pfaff [Tue, 15 Dec 2009 18:56:59 +0000 (10:56 -0800)]
debian: Make binary NMUs possible.

According to lintian:

> The package is not safely binNMUable because an arch:any package depends
> on another arch:any package with a (= ${source:Version}) relationship.
> Please use (= ${binary:Version}) instead.

Fixed according to lintian's advice (above).

14 years agodebian: Break rules for datapath module out of debian/rules.
Ben Pfaff [Tue, 15 Dec 2009 18:19:03 +0000 (10:19 -0800)]
debian: Break rules for datapath module out of debian/rules.

debian/rules included makefiles from /usr/share/modass/include.
Unfortunately these makefiles set some environment variables to values that
we do not want in the general Debian build, e.g. on this machine they set
CC to gcc-4.1.  It appears that it is generally good practice to break
out the kernel module rules from the general-purpose rules anyhow, so this
commit does so.

14 years agoovsdb-server: Improve error message when database file argument is missing.
Ben Pfaff [Tue, 15 Dec 2009 21:10:16 +0000 (13:10 -0800)]
ovsdb-server: Improve error message when database file argument is missing.

14 years agoClean-up compiler warnings about ignoring return values
Justin Pettit [Tue, 15 Dec 2009 07:08:10 +0000 (23:08 -0800)]
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.

14 years agonetdev-linux: Fix aliasing error.
Ben Pfaff [Tue, 15 Dec 2009 06:59:55 +0000 (22:59 -0800)]
netdev-linux: Fix aliasing error.

The latest version of GCC flags a common socket convention as breaking
strict-aliasing rules.  This commit removes the aliasing and gets rid of
the scary warning.

14 years agoxenserver: Actually destroy VIFs by using ovs-vsctl
Justin Pettit [Tue, 15 Dec 2009 01:44:17 +0000 (17:44 -0800)]
xenserver: Actually destroy VIFs by using ovs-vsctl

When VIFs were destroyed, they were not actually being deleted in the
config database.  This commit makes the appropriate ovs-vsctl commands
in the 'vif' script to accomplish that.

14 years agoovs-vsctl: Set timeout to a default value of five seconds
Justin Pettit [Mon, 14 Dec 2009 21:59:58 +0000 (13:59 -0800)]
ovs-vsctl: Set timeout to a default value of five seconds

In general, we don't want ovs-vsctl to wait forever to connect to the
database, as ovs-vsctl is used extensively in init scripts and the
system will not boot.  Use a default value of five seconds as a
stop-gap.  Eventually, we'll switch to a model of connection attempts,
since using time-based approach is kind of a hack.

14 years agoxenserver: Cleanup xs-network-uuids and xs-network-names usage
Justin Pettit [Mon, 14 Dec 2009 21:43:25 +0000 (13:43 -0800)]
xenserver: Cleanup xs-network-uuids and xs-network-names usage

Switch xs-network-uuids delimiter to a semicolon to match the one used
by xs-network-uuids.  Also, fix pluralization of xs-network-uuids in
vswitch IDL description of the "Bridge" table.

Add description of xs-network-names to vswitch IDL description.

14 years agoHave git ignore "vswitch-idl.txt"
Justin Pettit [Mon, 14 Dec 2009 21:42:06 +0000 (13:42 -0800)]
Have git ignore "vswitch-idl.txt"

14 years agovswitchd: Do not choose generated MAC address for local port.
Ben Pfaff [Mon, 14 Dec 2009 21:09:47 +0000 (13:09 -0800)]
vswitchd: Do not choose generated MAC address for local port.

ovs-vswitchd needs to choose a sensible MAC address for the local port of
a bridge.  Until now, the algorithm has ignored certain interfaces, in
particular internal interfaces and those with the MAC addresses that
indicate that they are probably Xen VIFs.  The goal is to choose a physical
interface's MAC address because this is more stable and more likely to
be meaningful to the outside world.  Stability, in turn, is important
because the MAC address of the local port is used as the default datapath
ID for OpenFlow connections.

This existing algorithm was too specialized to work well with the new
kinds of ports that we have been introducing in OVS.  In particular,
GRE ports could be chosen as the MAC address.  This commit changes the
algorithm for choosing the local port MAC address.  Now it ignores any
interface that has the "local" bit set in its MAC address, which
catches GRE ports.  The new rule also catches the VIF and internal
port cases, so this commit also deletes those special cases.

This commit deleted the only user of eth_addr_is_vif(), so it deletes
that function also.

Jesse Gross suggested this revised heuristic.

CC: Jeremy Stribling <strib@nicira.com>
14 years agoovs-vsctl: Add -t or --timeout option to limit runtime.
Ben Pfaff [Mon, 14 Dec 2009 18:13:36 +0000 (10:13 -0800)]
ovs-vsctl: Add -t or --timeout option to limit runtime.

14 years agoxenserver: Add xs-network-names to "external_ids" column in config db
Justin Pettit [Sat, 12 Dec 2009 00:54:01 +0000 (16:54 -0800)]
xenserver: Add xs-network-names to "external_ids" column in config db

14 years agoxenserver: Cleanup vswitch-xapi-update init script
Justin Pettit [Sat, 12 Dec 2009 00:22:16 +0000 (16:22 -0800)]
xenserver: Cleanup vswitch-xapi-update init script

Remove unused variables and correct typo in usage string.

14 years agoxenserver: Suppress output when creating initial config DB
Justin Pettit [Fri, 11 Dec 2009 21:03:01 +0000 (13:03 -0800)]
xenserver: Suppress output when creating initial config DB

14 years agovswitch: Set datapath_id and ofport in ovsdb.
Ben Pfaff [Sat, 12 Dec 2009 01:03:35 +0000 (17:03 -0800)]
vswitch: Set datapath_id and ofport in ovsdb.

Now ovs-vswitchd fills in the Interface ofport and Bridge datapath_id
fields when it reconfigures.

The existing Bridge datapath_id and hwaddr columns, which had surprising
meanings, have been banished to a new other_config column.

14 years agoRemove redundant calls to set_nonblocking().
Ben Pfaff [Sat, 12 Dec 2009 01:00:28 +0000 (17:00 -0800)]
Remove redundant calls to set_nonblocking().

These set_nonblocking() calls are on a fd returned by make_unix_socket(),
which has already set the fd nonblocking.

14 years agosocket-util: Clarify EAGAIN error code for make_unix_socket().
Ben Pfaff [Sat, 12 Dec 2009 00:59:44 +0000 (16:59 -0800)]
socket-util: Clarify EAGAIN error code for make_unix_socket().

make_unix_socket() can return EAGAIN in rare circumstances, e.g. when the
server's socket listen queue is full.  A lot of OVS callers interpret
EAGAIN as a "try again" error code, but in this case it means that the
attempt to create the socket failed.  So munge EAGAIN into another error
code to prevent that misinterpretation.

14 years agoovsdb-idl: Prevent segfault destroying an incomplete transaction.
Ben Pfaff [Sat, 12 Dec 2009 00:58:16 +0000 (16:58 -0800)]
ovsdb-idl: Prevent segfault destroying an incomplete transaction.

14 years agoovsdb: Fix segfault when a column set contains an invalid column name.
Ben Pfaff [Sat, 12 Dec 2009 00:37:29 +0000 (16:37 -0800)]
ovsdb: Fix segfault when a column set contains an invalid column name.

14 years agovswitch: Generate text file documenting the vswitch schema.
Ben Pfaff [Fri, 11 Dec 2009 22:12:50 +0000 (14:12 -0800)]
vswitch: Generate text file documenting the vswitch schema.

Now you can read vswitchd/vswitch-idl.txt for some textual documentation
of the OVS schema.

14 years agoovsdb-idl: Fix deletion of modified row.
Ben Pfaff [Fri, 11 Dec 2009 21:16:15 +0000 (13:16 -0800)]
ovsdb-idl: Fix deletion of modified row.

If the transaction modified a row and then deleted it, the IDL would
instead mistakenly leave the row entirely untouched.

This commit fixes this bug.  It needs a regression test, but this commit
does not add one.

14 years agoovsdb: Cleanly abort delete operations.
Ben Pfaff [Fri, 11 Dec 2009 20:58:30 +0000 (12:58 -0800)]
ovsdb: Cleanly abort delete operations.

14 years agoovs-vsctl: Add --dry-run option.
Ben Pfaff [Fri, 11 Dec 2009 19:28:36 +0000 (11:28 -0800)]
ovs-vsctl: Add --dry-run option.

14 years agoovsdb-client: Add support for pretty-printing JSON in output.
Ben Pfaff [Fri, 11 Dec 2009 19:14:00 +0000 (11:14 -0800)]
ovsdb-client: Add support for pretty-printing JSON in output.

14 years agoovsdb-idl: Fix row insertion and deletion behavior.
Ben Pfaff [Fri, 11 Dec 2009 18:46:59 +0000 (10:46 -0800)]
ovsdb-idl: Fix row insertion and deletion behavior.

When the IDL was used to insert a row, but all of the new row's columns
were left at the default values, then the IDL would not insert the row at
all.

When the IDL was used to delete one or more rows, and the transaction did
not include any update or insertion operations, the transaction was dropped
entirely.

This commit fixes these two bugs.  It needs a regression test, but this
commit does not add one.

14 years agoovs-vsctl: Initialize the database automatically.
Ben Pfaff [Fri, 11 Dec 2009 18:40:55 +0000 (10:40 -0800)]
ovs-vsctl: Initialize the database automatically.

14 years agoxenserver: Have brctl wrapper use config DB instead of config file
Justin Pettit [Fri, 11 Dec 2009 01:07:14 +0000 (17:07 -0800)]
xenserver: Have brctl wrapper use config DB instead of config file

This is a first cut and is likely buggy.  VLANs have not been tested.

14 years agoxenserver: Fix typo in dump-vif-details
Justin Pettit [Fri, 11 Dec 2009 00:54:48 +0000 (16:54 -0800)]
xenserver: Fix typo in dump-vif-details

dump-vif-details was calling ovs-vsctl with "bridge-set-external-id",
when it should have been "br-set-external-id".

14 years agoxenserver: Fixes related to creating config DB in RPM spec file
Justin Pettit [Thu, 10 Dec 2009 23:28:49 +0000 (15:28 -0800)]
xenserver: Fixes related to creating config DB in RPM spec file

Some programs require a "Open_vSwitch" table to exist in the
configuration DB.  This change adds that table when a new DB is created.

Also, don't try to create the DB unless it doesn't exist.

14 years agoovs-brcompatd: Remove references to locking config file
Justin Pettit [Thu, 10 Dec 2009 23:24:26 +0000 (15:24 -0800)]
ovs-brcompatd: Remove references to locking config file

With the config DB, it is no longer necessary to lock the config file.
This removes references to the need for that.

14 years agoxenserver: Remove references to "reload" in init script
Justin Pettit [Thu, 10 Dec 2009 23:21:56 +0000 (15:21 -0800)]
xenserver: Remove references to "reload" in init script

With ovs-vswitchd using the config DB, it is no longer necessary to tell
it to reload its configuration file.  This removes references to the
need for reloading.

It also cleans up some messages placed on the console during boot up.

14 years agoovs-brcompatd: Change man page to reflect new config db changes
Justin Pettit [Thu, 10 Dec 2009 23:04:22 +0000 (15:04 -0800)]
ovs-brcompatd: Change man page to reflect new config db changes

14 years agoxensource: Add kluge to make interface-reconfigure work better.
Ben Pfaff [Fri, 11 Dec 2009 00:43:10 +0000 (16:43 -0800)]
xensource: Add kluge to make interface-reconfigure work better.

This change makes xsconsole able to reconfigure the management interface
on some XenServer hosts.  It's not clear why it is needed--apparently
xapi is creating the bridge behind our back.

14 years agoovs-vsctl: Log fatal errors as well as printing them on the console.
Ben Pfaff [Fri, 11 Dec 2009 00:05:20 +0000 (16:05 -0800)]
ovs-vsctl: Log fatal errors as well as printing them on the console.

This makes debugging errors on XenServer much simpler, since many uses of
ovs-vsctl direct stderr to /dev/null.

14 years agoxenserver: Make basic VM networking work.
Ben Pfaff [Thu, 10 Dec 2009 23:53:03 +0000 (15:53 -0800)]
xenserver: Make basic VM networking work.

Tested by starting and stopping a VM that has a single VIF and verifying
that the VM could get an IP address via DHCP and access the network and
that the VIF's external-ids were set to plausible values.

14 years agoxenserver: Make basic interface-reconfigure calls work.
Ben Pfaff [Thu, 10 Dec 2009 23:37:59 +0000 (15:37 -0800)]
xenserver: Make basic interface-reconfigure calls work.

Now a XenServer can boot OK with the database at least in simple cases.

interface-reconfigure is slow because there is a 5-second sleep in place of
a proper way to wait for vswitchd reconfiguration to complete.

14 years agoxenserver: Check ovsdb-server version and status also.
Ben Pfaff [Thu, 10 Dec 2009 23:36:02 +0000 (15:36 -0800)]
xenserver: Check ovsdb-server version and status also.

14 years agoxenserver: Implement clearing database at boot.
Ben Pfaff [Thu, 10 Dec 2009 23:35:29 +0000 (15:35 -0800)]
xenserver: Implement clearing database at boot.

14 years agoovs-vsctl: Accept documented --no-wait option.
Ben Pfaff [Thu, 10 Dec 2009 23:32:50 +0000 (15:32 -0800)]
ovs-vsctl: Accept documented --no-wait option.

14 years agoovs-vsctl: Add --if-exists options to del-br, del-port commands.
Ben Pfaff [Thu, 10 Dec 2009 22:07:33 +0000 (14:07 -0800)]
ovs-vsctl: Add --if-exists options to del-br, del-port commands.

These options make it easier to reimplement interface-reconfigure using
ovs-vsctl.