2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

263 Commits

Author SHA1 Message Date
Ben Pfaff
e1c0e2d173 ovsdb-idl: Make ovsdb_idl_txn_add_comment() take a printf() format string.
All of the callers were calling xasprintf() and then passing the result
to ovsdb_idl_txn_add_comment(), so this slightly simplifies the callers.
2010-03-08 14:18:44 -08:00
Ben Pfaff
af96ccd246 ovsdb-idl: New function ovsdb_idl_txn_commit_block().
This commit factors out common code from multiple callers of
ovsdb_idl_txn_commit() into a new function ovsdb_idl_txn_commit_block().
2010-03-03 12:55:39 -08:00
Ben Pfaff
7c79588e00 xenserver: Delete ports by interface name.
ovs-vsctl command "--if-exists del-port eth0" does nothing if eth0 is on
a bridge as part of a bond, because the bond's port name is not eth0 but
something else.  But interface-reconfigure needs to do that, so this commit
adds that ability to ovs-vsctl and modifies interface-reconfigure to use it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:44 -08:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00
Ben Pfaff
b89d833925 ovs-vsctl: Avoid redundant initializations in "add-br" command.
Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:35:28 -08:00
Ben Pfaff
bb1c67c813 ovs-vsctl: Add --may-exist option for add-port, add-bond commands.
This is useful in interface-reconfigure, in an upcoming commit.
2010-02-09 12:13:52 -08:00
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
e6e7ab8792 ovs-vsctl: Improve error message when options follow command names. 2010-02-09 11:05:19 -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
91e310a5c2 ovsdb-idl: On transaction hard failure make a reason available to client.
This make ovs-vsctl able to report problems that occur in better detail.
2010-02-08 14:16:18 -08:00
Ben Pfaff
8cf8cc6606 ovs-vsctl: When deleting a real bridge, delete ports of child fake bridges.
Otherwise these ports and their interfaces hang around unreferenced.
2010-02-08 14:16:18 -08:00
Ben Pfaff
b86b43aa48 ovs-vsctl: Free memory on successful exit.
This is not important in itself, but it helps to spot real memory leaks.

Found with valgrind.
2010-02-02 15:21:10 -08:00
Ben Pfaff
a3326252a1 ovs-vsctl: Fix memory leaks.
Found with valgrind.
2010-02-02 15:21:10 -08:00
Ben Pfaff
1d48b4bed0 ovs-vsctl: Free memory on fatal error.
Freeing memory just before exiting is not important in itself, but it makes
it easier to see real memory leaks.

Found with valgrind.
2010-02-02 15:21:10 -08:00
Ben Pfaff
def90f6204 ovs-vsctl: Use vsctl_fatal() consistently.
vsctl_fatal() logs its argument as well as printing it on stderr, so it
is preferable within ovs-vsctl.  An upcoming commit will also make
vsctl_fatal() free memory, so using it consistently will also make that
memory freed consistently.
2010-02-02 15:21:10 -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
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
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
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
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
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
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
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
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