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

1727 Commits

Author SHA1 Message Date
Ben Pfaff
bb60fa749d ovs-pki: Avoid using local variables, which are non-POSIX.
Reported-by: Srini Seetharaman <seethara@stanford.edu>
2010-02-01 10:09:56 -08:00
Ben Pfaff
6468b79c63 ofproto: Remove support for OpenFlow-based management protocol.
Older versions of Open vSwitch supported a management protocol based on
OpenFlow message framing.  The current Open vSwitch instead uses the
OVSDB protocol for the same purposes.  We don't plan to support this older
protocol any longer, so this commit deletes support.

This commit also deletes the management_id column from the vswitch's
database schema.  The management_id was used by the older management
protocol to match up OpenFlow switch connections to management connections,
but the current implementation instead matches up connections based on
the datapath IDs exported by the configuration database.  In fact, the
OpenFlow connections had no way to actually export the management ID, so
this just deletes code that was essentially without function anyhow.
2010-02-01 10:05:44 -08:00
Ben Pfaff
870aeb4aa0 ovs-vsctl: Add --if-exists option to "get" command, for map columns. 2010-01-28 16:10:12 -08:00
Ben Pfaff
c29a8ba886 ovs-vsctl: Improve error reporting. 2010-01-28 16:10:10 -08:00
Ben Pfaff
492eb7a8ec ovs-vsctl: Alphabetize lists of database column names.
This makes the "list" command print the database columns in alphabetical
order, which seems more sensible than the semi-random order we had before.
2010-01-28 16:10:06 -08:00
Ben Pfaff
3ef917b569 ovs-vsctl: Make "create" command print new row's UUID.
Also, document limitations of other commands regarding UUIDs of new rows.
2010-01-28 16:10:01 -08:00
Ben Pfaff
3da1c516ba ovs-vsctl: Add postprocess step.
Nothing uses this new feature yet, so this commit by itself has no visible
effect.

This is a step toward printing the UUIDs of newly inserted rows.
2010-01-28 16:09:58 -08:00
Ben Pfaff
f8ff4bc4f3 ovs-vsctl: Refactor in preparation for adding "postprocess" step.
Until now, all the ovs-vsctl commands have had no need to look at the
results of the database transaction.  However, to print the UUID of newly
inserted database records, they do need to do this.

This commit refactors ovs-vsctl in preparation for adding this ability.
2010-01-28 16:09:26 -08:00
Jesse Gross
0e17074a1a openflowd: Update for changes to dpif and netdev.
Openflowd had been a bit neglected as changes were made to the dpif
and netdev interfaces over time.  This brings it up to date with all
the latest changes.
2010-01-27 20:03:38 -05:00
Jesse Gross
1a6f1e2a6d dpif: Update dpif interface to match netdev.
This brings over some features that were added to the netdev interface,
most notably the separation between the name and the type.  In addition
to being cleaner, this also avoids problems where it is expected that
the local port has the same name as the datapath.
2010-01-27 20:03:38 -05: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
8f7501e83f ovs-vsctl: Update --help message. 2010-01-27 13:51:52 -08:00
Ben Pfaff
b7f74b6f59 ovs-vsctl: Add "destroy" command. 2010-01-27 13:51:52 -08:00
Ben Pfaff
557e37183d ovs-vsctl: Add new "create" command. 2010-01-27 13:51:52 -08:00
Ben Pfaff
71bd6358a2 ovs-vsctl: Add --force option to database commands to override safety checks. 2010-01-27 13:51:52 -08:00
Ben Pfaff
63f08492f4 ovs-vsctl: Fix formatting in manpage.
The stray .TP was screwing up the right margin for the whole rest of the
manpage.  The .STs were just adding too much vertical space.
2010-01-27 13:51:52 -08:00
Ben Pfaff
90c4bd001a ovs-vsctl: Add "remove" and "clear" commands. 2010-01-27 13:51:52 -08:00
Ben Pfaff
1bc6ff2918 ovs-vsctl: Make parsing functions return error instead of aborting.
The upcoming "remove" command for ovs-vsctl wants to try parsing an
argument two different ways.  This doesn't work if a parse error always
aborts immediately.  This commit fixes the problem, by making a parsing
failure pass up an error for higher layers to deal with instead of aborting
immediately.

This commit should have no user-visible effect.
2010-01-27 13:51:52 -08:00
Ben Pfaff
c611c9d011 ovs-vsctl: Make the "list" format more uniform. 2010-01-27 13:51:52 -08:00
Ben Pfaff
5128bd9c3c ovs-vsctl: Score perfect matches higher than ones that differ in case.
Before, both "xY_z" and "xy-z" were considered equally good matches for
"xy-z", but obviously the latter is a much better match.  This commit fixes
the problem (which was found by inspection).
2010-01-27 13:51:52 -08:00
Jesse Gross
93255bc565 ovs-vsctl: Fix uninitialized variable.
When querying a row we could return an uninitialized variable in
some cases if we can't find what we are looking for.
2010-01-27 15:46:40 -05:00
Jesse Gross
7345004715 ovs-vsctl: Add missing columns.
bond_updelay and flood_vlans were missing from the list of
configurable columns.
2010-01-26 16:09:08 -05: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
ad83bfa658 ovs-vsctl: Add commands for low-level database manipulation.
The new "get", "list", "set", and "add" commands provide lower-level
access to the vswitch database than the other ovs-vsctl commands, but they
are more convenient than using ovsdb-client directly.

This commit deserves several enhancements, but users are clamoring for
some kind of interface, so this is a starting point.
2010-01-26 09:49:30 -08:00
Ben Pfaff
49c36903d6 Merge "sflow" into "master".
No conflicts, but lib/dpif.c needed a few changes since struct dpif's
member "class" was renamed to "dpif_class" in master since sflow was
branched off.
2010-01-25 10:52:28 -08:00
Jesse Gross
84a0ee89e2 ovs-vsctl: Prevent uninitialized variable warning.
The compiler warns about next_cfg being uninitialized but in the cases
where it is unset we will never reach the point where it is used.  This
just sets next_cfg to 0 to stop the whining.
2010-01-20 14:24:22 -05: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
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