2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00
Commit Graph

987 Commits

Author SHA1 Message Date
Ben Pfaff
d77ffabfbc xenserver: Fix bringing up VLAN PIFs.
In configure_datapath(), bringing up a VLAN PIF's datapath is no different
from bringing up a non-VLAN PIF's datapath, but the code was making
unnecessary distinctions.  Also, the test
	if parent and datapath:
did not work at all, because there was no variable named 'datapath' in
scope and no obvious source of one.

In preconfigure(), it then becomes necessary to create a VLAN bridge for a
VLAN PIF, in a straightforward way.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:52:18 -08:00
Ben Pfaff
96c7918c40 xenserver: Hoist identical bridge and vswitch functions into common code.
The previous commit made pif_bridge_name() in the bridge and vswitch
versions of interface-reconfigure functionally identical, so this commit
hoists them into a single common implementation in InterfaceReconfigure.py.

pif_is_bridged() also comes along for the ride because it is also generic
and because it is logically related.  Only the bridge code uses it at the
moment.

Suggested-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:52:13 -08:00
Ben Pfaff
6987c81c05 xenserver: Accept VLAN PIFs in pif_bridge_name().
pif_bridge_name() was written when the vswitch interface-reconfigure was
working with the raw Open vSwitch configuration via ovs-cfg-mod.  Then,
it made no sense to ask for the "bridge name" of a VLAN PIF, because a
VLAN PIF didn't have a bridge.

Now, however, the vSwitch interface-reconfigure works with ovs-vsctl, which
provides a thin layer over the OVS configuration that makes VLAN bridges
appear to exist.  So now it makes sense to ask for the bridge of a VLAN
PIF, and this commit enables that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:59 -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
3b1acc9955 xenserver: Fix comment in interface-reconfigure.
This comment was accurate, but didn't actually say what the function did.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:33 -08:00
Ben Pfaff
394ca24967 ovsdb: Introduce <nonnull-json-value> to clarify specifications. 2010-02-18 11:01:26 -08:00
Ben Pfaff
a817e5246e ovsdb: Fix use of <value> as both a JSON value and as a database value. 2010-02-18 11:00:04 -08:00
Ben Pfaff
23817ac722 xenserver: Upgrade and compact database on system boot.
This should take care of many of the OVSDB-related upgrade and downgrade
problems reported by Nicira internal testers.

Bug #2388.
2010-02-15 12:54:55 -08:00
Ben Pfaff
1e19e50e8d ovsdb: Implement ovsdb-tool commands "compact" and "convert".
Partial fix for bug #2391.
2010-02-15 12:54:52 -08:00
Ben Pfaff
8e71cf88b7 ovsdb: Factor out code to fsync a file's containing directory.
In an upcoming commit, another function wants to do the same thing, so
break it out into a helper function.
2010-02-15 11:31:34 -08:00
Ben Pfaff
a3d573ed9b ovsdb: Refactor code for writing a transaction to a file.
An upcoming commit will add another user for this code, so it is good to
abstract it a little better.
2010-02-15 11:31:34 -08:00
Ben Pfaff
7446f1480b ovsdb: Allow ovsdb_log_open()'s caller to choose whether to lock.
The current callers of ovsdb_log_open() always want to lock the file if
they are accessing it for read/write access.  An upcoming commit will add
a new caller that does not fit this model (it wants to lock the file
across a wider region) and so the caller should be able to choose whether
to do locking.  This commit adds that ability.

Also, get rid of the use of <fcntl.h> flags to choose the open mode, which
has always seemed somewhat crude and which this change would make even
cruder.
2010-02-15 11:31:32 -08:00
Ben Pfaff
475afa1b2c ovsdb-server: Add --run option.
Bug #2398.
2010-02-15 11:31:06 -08:00
Ben Pfaff
58985e09ea ovsdb: Add functions to clone schemas.
These will be used by an upcoming commit.
2010-02-15 11:31:05 -08:00
Ben Pfaff
e5125481cf ovsdb-client: Add blank line between tables in CSV, tabular output.
Adding a blank line makes the output easier to read when there are
multiple tables.
2010-02-15 11:31:05 -08:00
Ben Pfaff
25c269efad ovsdb-client: Add "dump" command for dumping entire database contents.
There are no tests for this currently, but an upcoming commit will use it
to test other commands.
2010-02-15 11:30:06 -08:00
Ben Pfaff
1f44158640 ovsdb-client: Improve HTML output.
This commit introduces links from UUIDs to rows that represent them and
shortens UUIDs added to tables to their first 8 characters.  This makes
the output more readable.
2010-02-15 11:28:40 -08:00
Ben Pfaff
d0d15d58c6 uuid: New function uuid_from_string_prefix().
For use in an upcoming commit.
2010-02-15 11:28:39 -08:00
Ben Pfaff
c3a0bfd57e ovsdb-client: Introduce new data formatting style as the default.
The new data formatting style is generally shorter and easier to read than
the JSON representation (which is still available using "-d json").
2010-02-15 11:28:39 -08:00
Ben Pfaff
0c65cde9db ovsdb-client: Remove --wide option.
This option just confused people, since no one really expected the output
to be truncated at 79 columns by default.
2010-02-15 11:28:39 -08:00
Ben Pfaff
8894256573 ovsdb: Fix commit to disk of rows added to a table with all-default values. 2010-02-15 11:28:39 -08:00
Ben Pfaff
204bad2940 ovs-vsctl: Clarify manpage.
If anyone ever reads the manpage, this should help.
2010-02-12 14:33:10 -08:00
Ben Pfaff
165cd8a38b ofproto: Use UINT16_MAX in place of -1, for clarity.
Reported-by: Jesse Gross <jesse@nicira.com>
2010-02-12 13:58:17 -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
67a4917b07 Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-11 10:59:47 -08:00
Ben Pfaff
62ee3464d9 ovs-ofctl: Drop assignment whose value is never used.
Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:35:28 -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
212fe71c79 ofproto: Avoid passing indeterminate value to rule_insert().
The 'in_port' argument to rule_insert() is only used if its 'packet'
argument is nonnull, so this is not, strictly speaking, a bug, but it
seems much cleaner.

The default -1 value of in_port matches what pktbuf_retrieve() stores
there on failure.

Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:35:28 -08:00
Ben Pfaff
b0ef055116 ovsdb: Drop write-only variable.
Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:35:28 -08:00
Ben Pfaff
4869f1b170 ovs-brcompatd: Use error instead of pointer in handle_fdb_query_cmd().
It is safe to use either value here but as long as we are saving the
error value we might as well use it.

Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
02ef592c37 sflow: Don't assign value that is never used.
The "error" return from collectors_create() is actually not that
interesting, because there could still be some collectors configured
properly anyhow, so we might as well discard the error return here,
without even assigning it to a variable.

Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
5fbb4e187d vswitchd: Drop assignment whose value is never used in port_reconfigure().
Seems cleaner this way.

Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
651471fda8 process: Remove pointless, redundant assignments from stream_read().
Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
f0f4410a47 tests: Remove write-only variables.
Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
141c83fa93 ovsdb: Remove write-only variable from parse_body() in log.c.
Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
8b71367c38 ovsdb: Add default case to ovsdb_mutation_set_execute().
The value of 'error' is indeterminate if m->mutator is not set to a valid
value here, so we should add a default case to handle the exception.  It
shouldn't happen, of course.

Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
b62aeed2ab netdev-linux: Avoid fiddling with indeterminate data.
If we are using netlink to get stats and get_ifindex() fails, then for
an internal network device we will then swap around a bunch of
indeterminate (uninitialized) data values.  That won't hurt anything--the
caller will still set them to all-1-bits due to the error--but it still
seems wrong.  So this commit avoid it.

Found using Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:34:45 -08:00
Ben Pfaff
413f274f20 dhcp: Don't pass NULL to memcmp() even with size 0.
ISO C says that the arguments to memcmp() must be nonnull even if the
size argument is 0, so don't do that.

Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:33:11 -08:00
Ben Pfaff
f446d59b36 vswitch: Fix uninitialized variable.
The 'ip' variable in this inner "if" statement shadows a variable with
the same name in the enclosing block.  The variable in the inner block
is never initialized.

Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:33:11 -08:00
Ben Pfaff
3a919aee44 flow: Fix null pointer dereference in flow_from_match().
Found by Clang (http://clang-analyzer.llvm.org).
2010-02-11 10:33:11 -08:00
Ben Pfaff
e91087c7f9 xenserver: Fix bond configuration.
This bug was introduced as part of the merge from "master" and does not
therefore exist in Citrix upstream code.
2010-02-10 16:57:48 -08:00
Ben Pfaff
193ec5109d ovs-wdt: Mark variable static and use NULL for a null pointer.
Neither is really a bug but it's cleaner this way.

Found by sparse (http://sparse.wiki.kernel.org/).
2010-02-10 16:54:48 -08:00
Ben Pfaff
35f7605b3f datapath: Mark functions "static".
Found by sparse (http://sparse.wiki.kernel.org/).
2010-02-10 16:54:48 -08:00
Ben Pfaff
2175540274 datapath: When adding a port, return the new port number to userspace.
'port' is a kernel-space copy of the odp_port and modifying it is useless.
'portp' is the userspace copy; modifying it is useful.

None of our current userspace users care about the port number and so we
never noticed.

Found by sparse (http://sparse.wiki.kernel.org/).
2010-02-10 16:54:48 -08:00
Ben Pfaff
fea39b9f1c ovs-brcompatd: Handle transaction errors slightly more gracefully.
It is not a good idea to just exit on an OVSDB transaction error.
TXN_TRY_AGAIN will definitely happen in practice; TXN_ERROR should not but
we should not just fail if it does.

This should allow us to better debug bug #2418.
2010-02-10 10:41:44 -08:00
Ben Pfaff
9cb53f2613 ovsdb: Add support for multiple databases to the protocol.
This also adds protocol compatibility to the database itself and to
ovsdb-client.  It doesn't actually add multiple database support to
ovsdb-server, since we don't really need that yet.
2010-02-09 14:25:32 -08:00
Ben Pfaff
7b09e42666 xenserver: Fix failure to bring up secondary management interfaces.
When a secondary management interface is configured on a XenServer,
interface-reconfigure would fail to bring it up because it would attempt
to add a bridge that already exists.  This commit makes it tolerate that
situation.
2010-02-09 12:13:52 -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