2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 13:58:14 +00:00
Commit Graph

1150 Commits

Author SHA1 Message Date
Ben Pfaff
4d12270a61 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.
2010-01-15 11:33:18 -08:00
Jesse Gross
149f577a25 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.
2010-01-15 11:34:34 -05:00
Justin Pettit
b4182c7f2d 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
2010-01-15 08:28:59 -08:00
Justin Pettit
1626118f26 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.
2010-01-14 18:08:52 -08:00
Justin Pettit
d35a4ea82f 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
2010-01-11 17:07:19 -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
fe55ad159d 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.
2010-01-06 14:35:20 -08:00
Ben Pfaff
9467fe6246 Add SSL support to "stream" library and OVSDB. 2010-01-06 14:30:29 -08:00
Ben Pfaff
84ee7bcfde Factor vconn and SSL documentation into manpage include files. 2010-01-06 14:10:54 -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
Justin Pettit
e26b5a068c 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.
2010-01-05 00:10:17 -08:00
Justin Pettit
87c8489148 Add extended vlog options to utilities
The ovs-discover, ovs-dpctl, and ovs-ofctl man pages indicated that they
supported extended vlog options (e.g., --log-file), but they actually
did not.  This commit adds them.

Reported by Tetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>
2010-01-04 18:55:00 -08:00
Ben Pfaff
67b732e885 ovs-openflowd: Don't pass extra argument to printf(). 2010-01-04 13:21:13 -08:00
Ben Pfaff
72b0630028 Initial implementation of sFlow.
Tested very slightly with "ping" and "sflowtool -t | tcpdump -r -".
2010-01-04 13:08:37 -08:00
Ben Pfaff
2280e7223c 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.
2010-01-04 10:09:27 -08:00
Justin Pettit
dd8ac6fe86 ovs-vsctl: Support configuring SSL. 2009-12-20 22:05:22 -08:00
Justin Pettit
975ac53133 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.
2009-12-20 22:05:18 -08:00
Justin Pettit
11aa56278b ovs-vsctl: Fix minor typo in error message 2009-12-18 14:46:02 -08:00
Ben Pfaff
95440284bd 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.
2009-12-18 13:37:44 -08:00
Ben Pfaff
175106cbf6 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.
2009-12-17 15:53:43 -08:00
Justin Pettit
5aa0063548 ovs-vsctl: Add commands for modifying controller settings
Adds the ability to configure the controller and fail-mode.
2009-12-17 13:28:26 -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
Justin Pettit
a39a859a30 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.
2009-12-14 14:51:17 -08:00
Ben Pfaff
342045e177 ovs-vsctl: Add -t or --timeout option to limit runtime. 2009-12-14 10:13:49 -08:00
Ben Pfaff
577aebdfec ovs-vsctl: Add --dry-run option. 2009-12-11 13:26:08 -08:00
Ben Pfaff
524555d18b ovs-vsctl: Initialize the database automatically. 2009-12-11 13:26:05 -08:00
Ben Pfaff
c88b6a2788 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.
2009-12-10 16:05:20 -08:00
Ben Pfaff
0c3dd1e1a1 ovs-vsctl: Accept documented --no-wait option. 2009-12-10 15:32:50 -08:00
Ben Pfaff
460aad8048 ovs-vsctl: Add --if-exists options to del-br, del-port commands.
These options make it easier to reimplement interface-reconfigure using
ovs-vsctl.
2009-12-10 14:07:54 -08:00
Ben Pfaff
01845ce8ca ovs-vsctl: Make functions to find entities more flexible.
This will be used in upcoming commits.
2009-12-10 14:07:54 -08:00
Ben Pfaff
5d9cb63c91 ovs-vsctl: Add options parsing infrastructure.
This paves the way for adding options to commands but should have no
user-visible change.
2009-12-10 14:07:54 -08:00
Ben Pfaff
68be4616d6 ovs-vsctl: Add --help output for external-id commands. 2009-12-10 10:12:02 -08:00
Justin Pettit
a0a9f31ddc ovs-vsctl: Fix minor memory leak in add_port(). 2009-12-10 02:33:56 -08:00
Justin Pettit
7a44236e27 Update .gitignore files 2009-12-10 02:33:56 -08:00
Ben Pfaff
457e1eb040 ovs-vsctl: New commands for working with external IDs.
This aids XenServer integration and should make it easier to integrate
with other environments in the future as well.
2009-12-09 17:06:49 -08:00
Ben Pfaff
586bb84a49 ovs-vsctl: Fix performance problem. 2009-12-09 13:29:02 -08:00
Ben Pfaff
dfbe07ba61 ovs-vsctl: Fix bugs.
The full ovs-vsctl test suite now passes.
2009-12-09 13:28:48 -08:00
Ben Pfaff
c75d15113c vsctl: Start making it work with ovsdb.
This passes at least one test (the one named "add-br a").  It probably
doesn't pass any more than that.

This is *way* not up to my quality standards, but we are in a super hurry
so I'm pushing it anyhow.
2009-12-08 17:18:12 -08:00
Justin Pettit
a47f084024 ovs-vsctl: Fix traceback when telling target to reload
The code to tell the target to reload was referencing a non-existent
global variable to determine the target.  This change uses the correct
one.
2009-12-04 14:11:53 -08:00
Ben Pfaff
7634353824 vswitchd: Initial conversion to database-based configuration.
This has seen very little testing, so some features are almost certainly
busted.  Port mirroring is not yet converted, so it will definitely not
work.
2009-12-03 11:28:40 -08:00
Ben Pfaff
58fda1dab1 Merge "master" branch into "db". 2009-12-02 11:49:53 -08:00
Ben Pfaff
e3e9370bf9 ovs-openflowd: Add support for userspace-only switching. 2009-11-23 15:58:48 -08:00
Jean Tourrilhes
9af9e2e8cf ovs-controller: Add --wildcard and --normal features.
This adds two command line switches to ovs-controller to:
	1) Use wildcards instead of exact matches.
	2) Use "normal" action instead of explicit port.
2009-11-19 12:48:36 -08:00
Justin Pettit
e423eca6e9 ovs-ofctl: Add support for transport and network modification actions
Add support to ovs-ofctl for modifying the network source and destination
IP address with the "mod_nw_src" and "mod_nw_dst" actions, respectively.
And support modifying the TCP/UDP source and destination ports with the
"mod_tp_src" and "mod_tp_dst" actions, respectively.
2009-11-16 18:48:26 -08:00
Justin Pettit
fb344b867b ovs-appctl: Fix shadow variable that could cause segfault
The variable "socket_name" contains the name of the unix domain socket
to be used for communicating with the OVS process.  If the target does
not begin with a "/", the socket name is determined based on a pidfile.
A shadow copy of "socket_name" was kept in the block that looks at the
pidfile, which would cause the function-level one to not be set.  This
removes that shadow copy.
2009-11-16 18:11:39 -08:00
Justin Pettit
436cf33bb7 ovs-openflowd: Setup default listener
By default, ovs-openflowd was not listening for any management
connections.  Tools such as ovs-ofctl attempt to use a default location
based on the datapath name.  This change creates that default listener.
2009-11-13 15:51:44 -08:00
Jesse Gross
d65349ea28 Merge citrix branch into master. 2009-11-10 15:12:01 -08:00
Ben Pfaff
01b528c1b7 ovs-vsctl: Capitalize names of global constants but not variables.
Conforms to the Google style guide for Python.

Reported by Justin.
2009-11-09 15:02:05 -08:00