Ben Pfaff [Tue, 13 Apr 2010 23:49:22 +0000 (16:49 -0700)]
dpif: Make dpif_flow_get() results predictable on error.
If dpif_flow_get()'s caller is less cautious than it should be, then it
will get surprising results when it looks at the returned flow on error.
This commit at least gives it plausible results.
Ben Pfaff [Tue, 13 Apr 2010 23:48:10 +0000 (16:48 -0700)]
ovs-dpctl: In "dump-flows", only print flows that can be retrieved.
If dpif_flow_get() returns an error then we'd better not try to print
the flow (especially not the actions since check_rw_odp_flow() clears
the first action to 0xcc).
Ben Pfaff [Fri, 9 Apr 2010 21:04:10 +0000 (14:04 -0700)]
ofproto: Maximum value of "int" is INT_MAX, not UINT32_MAX.
This bug seems to be dormant at the moment, since the -1 gets passed
through unchanged to do_send_packet_in() and then to make_packet_in()
and then gets converted to SIZE_MAX as part of the MIN invocation in that
function. It is still better to fix it.
Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Ben Pfaff [Tue, 13 Apr 2010 17:12:25 +0000 (10:12 -0700)]
ofproto: Make NXAST_RESUBMIT take header modifications into account.
Until now, the NXAST_RESUBMIT action has always looked up the original
flow except for the updated in_port. This commit changes the semantics to
instead look up the flow as modified by any preceding actions that affect
it, e.g. if OFPAT_SET_VLAN_VID precedes NXAST_RESUBMIT, then NXAST_RESUBMIT
now looks up the flow with the modified VLAN, not the original (as well as
the modified in_port).
Also, document how NXAST_RESUBMIT is supposed to work.
Suggested-by: Paul Ingram <paul@nicira.com>
Ben Pfaff [Fri, 9 Apr 2010 22:19:12 +0000 (15:19 -0700)]
ofproto: Copy the flow being translated in xlate_actions().
This change should have no user-visible effect, but it paves the way for
the following commit, which requires the action_xlate_ctx's flow to be
modifiable.
Ben Pfaff [Tue, 13 Apr 2010 16:28:13 +0000 (09:28 -0700)]
Make fatal signals cause an exit more promptly in special cases.
The fatal-signal library notices and records fatal signals (e.g. SIGTERM)
and terminates the process on the next trip through poll_block(). But
some special utilities do not always invoke poll_block() promptly, e.g.
"ovs-ofctl monitor" does not call poll_block() as long as OpenFlow messages
are available. But these special cases seem like they are all likely to
call into functions that themselves block (those with "_block" in their
names). So make a new rule that such functions should always call
fatal_signal_run(), either directly or through poll_block(). This commit
implements and documents that rule.
Bug #2625.
Justin Pettit [Mon, 12 Apr 2010 20:12:34 +0000 (13:12 -0700)]
xenserver: Fix ip_gre_mod modprobe issue in init script
The OVS kernel modules were moved to kernel/extra/openvswitch, but the
init script wasn't updated to look for the ip_gre_mod kernel module
there. This commit fixes that.
CC: Paul Ingram <paul@nicira.com>
Justin Pettit [Fri, 9 Apr 2010 15:10:34 +0000 (08:10 -0700)]
xenserver: Allow use first class datamodel field for controller IP
Starting in XenServer 5.6.0, a "vswitch_controller" key is available to
store the controller's IP address in the "pool" table of XAPI. Older
versions must still use the "vSwitchController" key in "other_config".
Based on commits 37fee7 and
0ebd737 from the xs5.7 branch written by
Ian Campbell.
Justin Pettit [Fri, 9 Apr 2010 07:40:18 +0000 (00:40 -0700)]
xenserver: Only register xsconsole plugin if OVS is running
The 5.6.0 XenServer release will include OVS but not have it enabled by
default. By only registering the xsconsole plugin on systems running OVS,
this plugin can be included in the main distribution.
Based on commit
0ebd737 from the xs5.7 branch written by Ian Campbell.
Justin Pettit [Thu, 8 Apr 2010 19:42:24 +0000 (12:42 -0700)]
xenserver: Do not raise XenAPIPlugin.Failure in xsconsole plugin
Do not raise XenAPIPlugin.Failure, it is not an exception xsconsole will
handle.
Based on commit fcc495 from the xs5.7 branch written by Ian Campbell.
Ben Pfaff [Wed, 7 Apr 2010 22:20:53 +0000 (15:20 -0700)]
vswitch: Fix documentation for network-uuids external ID in Bridge table.
Jeremy pointed out that this field is semicolon-delimited but we document
it as space-delimited. Fix the documentation.
Reported-by: Jeremy Stribling <strib@nicira.com>
Ben Pfaff [Thu, 18 Mar 2010 19:59:34 +0000 (12:59 -0700)]
ovsdb: Use port 6632 as a default port for database connections.
Until now we have required a port number to be specified explicitly for
database connections. This commit adopts port 6632 as a default.
Ben Pfaff [Thu, 18 Mar 2010 19:59:33 +0000 (12:59 -0700)]
vconn-stream: Factor out port defaults into public helper functions.
These functions will be used elsewhere in an upcoming commit.
Ben Pfaff [Thu, 18 Mar 2010 19:59:32 +0000 (12:59 -0700)]
stream: Generalize stream_open_block().
This change makes it possible to separate opening a stream from blocking on
connection completion. This avoids some code redundancy in an upcoming
commit.
Ben Pfaff [Wed, 24 Mar 2010 17:42:17 +0000 (10:42 -0700)]
ovs-controller: Document how to use with management protocol.
Ben Pfaff [Wed, 24 Mar 2010 17:14:39 +0000 (10:14 -0700)]
jsonrpc: Add support for passive connections.
This allows ovs-vsctl to work as a simple Open vSwitch "manager" if the
XenServer host is configured to connect to it remotely.
Ben Pfaff [Wed, 24 Mar 2010 20:09:38 +0000 (13:09 -0700)]
reconnect: Implement "passive mode".
This allows the reconnect library to support clients that want to listen
for an incoming connection.
Ben Pfaff [Tue, 23 Mar 2010 21:01:54 +0000 (14:01 -0700)]
reconnect: Get rid of unused state.
Nothing ever caused the reconnect FSM to transition to the S_START_CONNECT
state, so we might as well get rid of the code for it.
Ben Pfaff [Wed, 24 Mar 2010 00:19:36 +0000 (17:19 -0700)]
stream-ssl: Make it possible to avoid checking peer SSL certificate.
In Citrix XenServer, the hosts have SSL private keys and certificates, but
those certificates are not signed by any certificate authority. So we
must provide a way to avoid checking certificates against a CA if we want
other OVS tools to be able to talk to XenServer hosts over SSL. This
commit makes that possible.
Ben Pfaff [Tue, 23 Mar 2010 22:30:17 +0000 (15:30 -0700)]
stream: New functions stream_verify_name() and pstream_verify_name().
These functions can be useful for checking whether a given name is an
active or passive connection method.
The implementation is cut-and-paste from vconn_verify_name() and
pvconn_verify_name().
Ben Pfaff [Tue, 23 Mar 2010 22:29:10 +0000 (15:29 -0700)]
ovs-vsctl: Add SSL support.
Normally ovs-vsctl is run locally, with a Unix domain socket as target, but
it can be useful over SSL as well from a remote host, so this commit
enables that use.
Ben Pfaff [Tue, 23 Mar 2010 18:24:38 +0000 (11:24 -0700)]
ovs-controller: Add --unixctl option.
Ben Pfaff [Tue, 23 Mar 2010 18:22:42 +0000 (11:22 -0700)]
ovsdb-server: Document --unixctl option.
Ben Pfaff [Tue, 23 Mar 2010 18:21:34 +0000 (11:21 -0700)]
Fix hyphens in manpage.
Ben Pfaff [Fri, 9 Apr 2010 23:01:02 +0000 (16:01 -0700)]
stream-ssl: Read existing CA certificate more eagerly during bootstrap.
When do_ca_cert_bootstrap() attempts to bootstrap a CA certificate from a
remote host, it gives up if the CA certificate file already exists. It
knows that this file did not exist some time earlier (because it checked),
so it logged a warning and just returns. The next time that
stream_ssl_set_ca_cert_file() gets called, it will read the new CA
certificate file and all will be well.
That works OK in ovsdb-server, which calls stream_ssl_set_ca_cert_file()
every time through its main loop. It does not work well for ovs-vswitchd,
which only calls that function when it needs to reconfigure. But it
should work fine to call it directly from do_ca_cert_bootstrap(), so this
commit changes it to do that.
Bug #2635.
Justin Pettit [Sat, 10 Apr 2010 08:20:23 +0000 (01:20 -0700)]
print: Print mod_vlan_vid action in decimal
In a flow description, the VLAN VID was printed in hex, but an VLAN VID
modification would print the value in decimal. This commit consistently
prints the value in decimal.
CC: Paul Ingram <paul@nicira.com>
Justin Pettit [Sat, 10 Apr 2010 08:09:08 +0000 (01:09 -0700)]
ovs-ofctl: Allow setting cookie as a decimal or hex value
Clean-up a few items related to flow cookies:
- Allow setting the flow cookie as a hex or decimal string
- Consistently print the cookie in hex
- Document the ability to set the flow cookie in ovs-ofctl.
Ben Pfaff [Fri, 9 Apr 2010 20:54:37 +0000 (13:54 -0700)]
netdev: Allow recv, recv_wait, drain, send, send_wait to be null.
Suggested by partner.
Justin Pettit [Fri, 9 Apr 2010 00:53:58 +0000 (17:53 -0700)]
vswitch: Mark bridge_update_desc argument as unused
The implementation of bridge_update_desc() is empty, which causes a
compiler warning for the argument. Mark the argument unused until we
get a chance to fix the function's implementation.
Justin Pettit [Wed, 7 Apr 2010 21:51:18 +0000 (14:51 -0700)]
leak-checker: Document "--leak-limit" option
Justin Pettit [Wed, 7 Apr 2010 01:58:08 +0000 (18:58 -0700)]
xenserver: Put kernel modules in "extra" directory
This change cleans up a couple of items. First, it makes sure that our
newly installed kernel modules are picked up instead of any ones that
shipped with XenServer. Second, it prevents having to do the install
with "--nodeps".
Ian Campbell [Thu, 8 Apr 2010 14:00:21 +0000 (15:00 +0100)]
interface-reconfigure+vif: accept openvswitch in /etc/xensource/network.conf
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Justin Pettit [Tue, 6 Apr 2010 19:14:22 +0000 (12:14 -0700)]
vswitchd: Fix small memory leak in bridge_init
Justin Pettit [Tue, 6 Apr 2010 19:13:32 +0000 (12:13 -0700)]
xenserver: Remove stray "\" in spec file
Ben Pfaff [Tue, 6 Apr 2010 18:17:39 +0000 (11:17 -0700)]
dpif: Really don't log many dpif errors.
The comment here was out of touch with the actual definition. Limiting a
log message to 9999 per minute is not much of a limit!
I suspect that I turned this way up during initial development at some
point and forgot to turn it down to a reasonable level.
Justin Pettit [Tue, 6 Apr 2010 01:13:26 +0000 (18:13 -0700)]
xenserver: Don't install xsconsole plugin as symlink
The OVS xsconsole plugin used to be installed in
/usr/share/openvswitch/scripts directory and then a symlink was created
to the /usr/lib/xsconsole/plugins-base directory. The Citrix packaging of
OVS just placed it directly into the xsconsole plugin directory. This
worked fine until we renamed our package "openvswitch", which is the
same as Citrix uses.
On an upgrade, the default package handler would attempt to clean up files
that were in the Cirix packaging, but not in the upgraded package. Since
it didn't know that we had replaced their plugin with our symlink, it would
destroy our symlink.
This commit just places the plugin directly into the
/usr/lib/xsconsole/plugins-base directory, which allows us to seamlessly
upgrade to newer Open vSwitch versions.
Bug #2608
Justin Pettit [Thu, 1 Apr 2010 12:12:17 +0000 (05:12 -0700)]
xenserver: Minor spec file cleanups
Remove compiled InterfaceReconfigure byte code on uninstall. Also, fix
minor typo in error message.
Justin Pettit [Thu, 1 Apr 2010 12:11:42 +0000 (05:11 -0700)]
xenserver: Only rotate files that end in .log
Ben Pfaff [Mon, 5 Apr 2010 21:21:38 +0000 (14:21 -0700)]
vswitchd: Make the bond rebalancing interval user-configurable.
This may make some bond debugging problems easier. It also seems
reasonable to expose this parameter to the user.
Related to bug #2366.
Ben Pfaff [Mon, 5 Apr 2010 19:58:21 +0000 (12:58 -0700)]
ovs-vsctl: Allow setting arbitrary database columns in add-port, add-bond.
Ben Pfaff [Fri, 2 Apr 2010 22:12:42 +0000 (15:12 -0700)]
ofproto: Make OFPFC_MODIFY and OFPFC_MODIFY_STRICT add a flow if no match.
OpenFlow 1.0 says that OFPFC_MODIFY and OFPFC_MODIFY_STRICT are supposed
to add the specified flow to the flow table if it does not already contain
one that matches.
Reported-by: Natasha Gude <natasha@nicira.com>
Bug #2506.
Ben Pfaff [Mon, 5 Apr 2010 16:37:46 +0000 (09:37 -0700)]
ovs-ofctl: Add support for "resubmit" Nicira vendor extension.
CC: Paul Ingram <paul@nicira.com>
Justin Pettit [Thu, 1 Apr 2010 01:25:02 +0000 (18:25 -0700)]
debian: Updated templates.pot
The various fixes that were made earlier caused a new templates.pot file
to be generated.
Justin Pettit [Thu, 1 Apr 2010 01:09:23 +0000 (18:09 -0700)]
debian: Cleanup config template for Lintian
Lintian wants "boolean" to be used instead of "select" if there are only
two choices. It also wants short descriptions to not end in a period.
Justin Pettit [Thu, 1 Apr 2010 01:00:40 +0000 (18:00 -0700)]
debian: Clarify packages' purpose in description
Lintian was complaining about empty binary packages for nicira-switch
and openvswitch-pki. By clarifying that they are a "meta-package" or
"dependency package", it shuts Lintian up.
Justin Pettit [Thu, 1 Apr 2010 00:42:50 +0000 (17:42 -0700)]
debian: Add $remote_fs to Required-Start/-Stop field in init scripts
Init scripts that depend on items in /usr must have $remote_fs defined
in their Required-Start and Required-Stop fields. This will ensure that
/usr is mounted before a start or stop call is made.
Found by Lintian.
Justin Pettit [Thu, 1 Apr 2010 00:12:37 +0000 (17:12 -0700)]
Define IQ macro for SSL man page fragment
The ssl.man page uses the IQ macro, but doesn't define it. Usually this
doesn't matter since its already been defined by man page that's
including it. However, in a couple of cases it doesn't, so this cleans
that up.
Caught by Lintian.
Justin Pettit [Tue, 30 Mar 2010 09:10:37 +0000 (02:10 -0700)]
debian: Bring Debian packaging in-line with new file locations
This commit brings the Debian packaging in-line with the similar changes
that were made to XenServer in commit
bc39196.
Justin Pettit [Tue, 30 Mar 2010 00:06:19 +0000 (17:06 -0700)]
debian: Fix references to OpenFlow in ovs-switch-config template
The ovs-switch-config template had clearly not been updated since the
project switched from OpenFlow to Open vSwitch. This updates the
dialog's so they're consistent with the project's real name.
Justin Pettit [Mon, 29 Mar 2010 23:27:07 +0000 (16:27 -0700)]
ovs-monitor: Put run files in "/var/run/openvswitch"
Justin Pettit [Mon, 29 Mar 2010 22:21:48 +0000 (15:21 -0700)]
debian: Fix executable name of ovs-controller in init script
Ian Campbell [Thu, 1 Apr 2010 09:45:22 +0000 (10:45 +0100)]
xenserver: strip all alpha-suffixes from the xenserver build number.
The letter at the end of the build number indicates the site where the build
was done. All publicly released builds come from "p" but within Citrix we have
other suffixes (i.e. in Cambridge we get c).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Justin Pettit [Tue, 30 Mar 2010 23:58:12 +0000 (16:58 -0700)]
xenserver: Add emergency_reset hook to XAPI plugin
There's a requirement that OVS can be put back into a known good state
remotely. This will be implemented as a function through the OVS XAPI
plugin. This commit only provides a hook for testing purposes. The
functionality will be added later.
Ben Pfaff [Tue, 30 Mar 2010 21:13:52 +0000 (14:13 -0700)]
xenserver: Add comment to XAPI plugin.
Ben Pfaff [Tue, 30 Mar 2010 16:02:06 +0000 (09:02 -0700)]
openvswitch-cfg-update: Fix "set-ssl" command arguments.
The SSL certificate and the private key are both in
/etc/xensource/xapi-ssl.pem, so it must be mentioned twice in the set-ssl
command invocation.
Bug accidentally introduced in commit
bc391960 "Cleanup default file
locations and XenServer packaging".
Reported-by: Peter Balland <peter@nicira.com>
Tested-by: Peter Balland <peter@nicira.com>
Ben Pfaff [Tue, 30 Mar 2010 16:45:48 +0000 (09:45 -0700)]
xenserver: updated xen-bugtool to XenServer trunk version.
The version of xen-bugtool include in openvswitch.git was forked long
ago from the xenserver version. Pull up to the version taken from
XenServer's trunk branch just after the integration of
22c75d593 from
openvswitch.git.
I tested that core and log files as well as ovs-dpctl {show,dump-flows}
and ovs-ofctl {show,dump-flows,status} are picked up correctly after the
big vswitch->openvswitch renaming.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Tue, 30 Mar 2010 08:34:29 +0000 (09:34 +0100)]
xenserver: gate all logrotate reopens on presence of a pid file
This probably only makes a difference in the case where you have vswitch
installed but (deliberately) not running _and_ you happen to have ovs-* logs big
enough to be worth rotating. Very much an edge case.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Justin Pettit [Sat, 27 Mar 2010 00:15:12 +0000 (17:15 -0700)]
xenserver: Don't reload ovs-brcompatd's log file if it's not running
Justin Pettit [Fri, 26 Mar 2010 23:46:44 +0000 (16:46 -0700)]
xenserver: Update MD5 sums of scripts for 5.5.900-29381p
Justin Pettit [Fri, 26 Mar 2010 23:04:58 +0000 (16:04 -0700)]
xenserver: Only show ovs-brcompatd status in xsconsole for XS 5.5.0
Justin Pettit [Sat, 27 Mar 2010 02:03:52 +0000 (19:03 -0700)]
xenserver: Correct renaming issue in openvswitch-xapi-update
A recent commit changed references from "vswitch" to "openvswitch".
This included changing the name of "vswitch-xapi-update" to
"openvswitch-xapi-update". Unfortunately, the contents of the file
did not get similarly updated, so the script had issues. This commit
fixes that.
Ian Campbell [Wed, 14 Oct 2009 10:38:40 +0000 (11:38 +0100)]
logrotate: Allow logs to be missing
In particular ovs-brcompatd.log is not present if compatibility mode is
disabled. Without this logrotate attempts to send email to the
administrator.
Ian Campbell [Thu, 1 Oct 2009 16:26:22 +0000 (09:26 -0700)]
xenserver: Fix init script typos that prevented turning brcompatd back on.
Commit
723a8c3ca "xenserver: Disable brcompatd" turned off brcompatd by
default but allowed it to be enabled using an option, but the option
didn't work. This commit fixes that problem.
Ian Campbell [Fri, 26 Mar 2010 20:24:06 +0000 (13:24 -0700)]
xenserver: Disable brcompatd except on XenServer 5.5.0
The compat layer is now unused in the vswitch branch of XenServer.
Based on change originally by Ian Campbell, cherry-picked from
"xs5.7" branch. The original change was not conditional on the
XenServer version.
Ian Campbell [Wed, 14 Oct 2009 10:37:19 +0000 (11:37 +0100)]
Ensure "service vswitch status" returns appropriate error code
This command was returning success when vswitchd was not running.
Our automated test relies on this command to decide if the host uses
vswitch or not.
If vswitchd is not OK then brcompatd is not checked at all. Since the
return codes apparently have specific meanings I couldn't see a sensible
way to combine multiple failure results.
(Cherry-picked from xs5.7 branch by Ben Pfaff but merge conflicts meant
that the whole thing had to be redone.)
Ian Campbell [Fri, 2 Oct 2009 10:32:10 +0000 (11:32 +0100)]
xenserver: Correct "service vswitch status" when brcompatd is disabled
I don't think it makes sense to report brcompatd's status when it is
explicitly disabled. Doing so causes service status to return an error
when brcompatd is deliberately disabled.
Also fix up a tab vs. spaces whitespace snafu.
Justin Pettit [Fri, 26 Mar 2010 05:38:13 +0000 (22:38 -0700)]
Cleanup default file locations and XenServer packaging
This commit cleans up the locations of a number of files and directories
used. These include:
- Config file lives in /etc/openvswitch/conf.db
- Logs go into /var/log/openvswitch
- ovsdb-server socket is /var/run/openvswitch/db.sock
- Schema goes into /usr/share/openvswitch/vswitch.ovsschema
- PID files go in /var/run/openvswitch
For XenServer, these additional changes are made:
- Cores go in /var/xen/openvswitch
- OVS binaries run in /var/xen/openvswitch
In addition, it attempts to cleanup the XenServer packaging. This
includes referring to the project as "openvswitch" as opposed to the
somewhat presumptuous "vswitch".
Note: Changes to the Debian packaging will be forthcoming.
Ian Campbell [Fri, 26 Mar 2010 16:35:32 +0000 (09:35 -0700)]
xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
Otherwise bridges can end up with a generated MAC address using Nicira OID
which has an impact when using DHCP on that devices.
tests/interface-reconfigure.at updated by Ben Pfaff.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Tue, 23 Mar 2010 01:41:44 +0000 (18:41 -0700)]
xenserver: Add ovsdb-server status to xsconsole vswitch overview
Ben Pfaff [Thu, 25 Mar 2010 19:30:05 +0000 (12:30 -0700)]
Merge "citrix" branch into "master".
This merge is long overdue, simply because I forgot that there were
outstanding changes on "citrix" that had not yet been merged.
The important fix here is the addition of mlockall. This fixes some
bugs seen under stressful conditions in XenServer.
Ben Pfaff [Thu, 25 Mar 2010 18:34:01 +0000 (11:34 -0700)]
timeval: Always log true poll interval instead of rounding off.
This code triggers when a trip through the process's main loop takes much
longer than expected. The code for calculating the expected time rounds
down to a maximum of 10000 ms to avoid overflow. But there is no reason
that the correct time should not be displayed in the log message, and
furthermore displaying the correct time may help tracking down the
underlying issue, since it lets the administrator find out exactly when
the trip through the main loop started. So this commit displays the exact
time without rounding down.
Ben Pfaff [Thu, 25 Mar 2010 16:46:31 +0000 (09:46 -0700)]
INSTALL.bridge: Update.
The instructions did not assume the default /usr/local install location,
which is confusing.
Also, the instructions partially replicated those in INSTALL.Linux, but it
seems better to only give the additional steps that are necessary, so do
that too.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Tetsuo NAKAGAWA [Thu, 25 Mar 2010 14:54:15 +0000 (10:54 -0400)]
dpif-linux: Fix file descriptor leak.
get_major() opens /proc/devices to get the openvswitch major number
but never closes the FD.
Ben Pfaff [Fri, 19 Mar 2010 18:44:31 +0000 (11:44 -0700)]
ofproto: Don't optimize out updating flow cookie.
The OFPFC_MODIFY and OFPFC_MODIFY_STRICT optimizes out modifying the
actions if the actions didn't change, but it also skipped updating the
flow cookie in that case, which seems wrong. This commit fixes the
problem.
Ben Pfaff [Wed, 24 Mar 2010 00:20:42 +0000 (17:20 -0700)]
jsonrpc: Fix potential memory leak.
This is unlikely to occur very often in practice, because s->stream
usually gets stuffed into s->rpc before long, but it is still a good idea
to fix it.
Ben Pfaff [Tue, 23 Mar 2010 22:27:44 +0000 (15:27 -0700)]
fatal-signal: Initialize library upon any call to public function.
Not calling fatal_signal_init() means that the signal handlers don't get
registered, so the process won't clean up on fatal signals. Furthermore,
signal_fds[0] is then 0, which means that fatal-signal_wait() waits on
stdin, so if you are testing a program interactively and accidentally type
something on stdin then that program's CPU usage jumps to 100%.
Since poll_block() calls fatal_signal_wait() this seems like the most
reliable solution.
Ben Pfaff [Tue, 23 Mar 2010 22:38:37 +0000 (15:38 -0700)]
ovsdb: Fix ovsdb-server crash when specifying nonexistent file.
ovsdb_file_open__() can call (NULL) in its error exit
path, but ovsdb_schema_destroy() didn't tolerate a null pointer argument.
Bug #2538.
Ben Pfaff [Wed, 24 Mar 2010 20:15:41 +0000 (13:15 -0700)]
stream-ssl: Only re-read certificates and keys if they change.
Commit
415f6c0b1 "stream-ssl: Make no-op reconfiguration cheap" caused
ovsdb-server to re-read its certificates and keys every 60 seconds just
in case they changed. However, doing this causes OpenSSL to drop its
connections. This commit solves the problem by making stream-ssl re-read
certificates and keys only if the files changed.
Bug #2535.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Ben Pfaff [Thu, 18 Mar 2010 16:37:31 +0000 (09:37 -0700)]
vswitchd: Make names of Bridge external_ids generic.
Until now the names of the external_ids keys used for Bridge records have
implied that they are specific to XenServer, because they begin with "xs-".
They are more generic in intent, however, so this commit removes the "xs-"
prefix and explains them more generically.
This finishes the renaming process started in commit
c0f9490 "vswitchd:
Make names of Interface external_ids generic."
CC: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 24 Mar 2010 21:41:32 +0000 (14:41 -0700)]
INSTALL.Linux: Consistently assume installation in /usr/local.
The documentation was inconsistent about assuming whether the installation
was to / or to /usr/local. Since the default is /usr/local, use that.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Ben Pfaff [Wed, 24 Mar 2010 21:42:23 +0000 (14:42 -0700)]
INSTALL.Linux: Document "ovs-vsctl init" step to installation.
If the database is not initialized then other programs will complain.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Ben Pfaff [Tue, 23 Mar 2010 16:27:08 +0000 (09:27 -0700)]
datapath: Support 2.6.33 kernel layout in build system.
The 2.6.33 kernel moves generated header files to include/generated, so
we need to look for autoconf.h there.
Reported-by: Brandon Heller <brandonh@stanford.edu>
Ben Pfaff [Tue, 23 Mar 2010 16:40:26 +0000 (09:40 -0700)]
xenserver: Fix "ovs-vsctl get" call in vswitch-cfg-update.
The ovs-vsctl arguments were being passed as a single string instead of
broken up as if the shell had performed word splitting. This fixes the
problem.
Without this commit, "unknown command 'get Open_vSwitch . managers';
use --help for help" appears in the system log. Adding the commit
suppresses that message.
NIC-72.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 22 Mar 2010 16:40:13 +0000 (09:40 -0700)]
ovsdb-server: Fix build when configuring without --enable-ssl.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Ben Pfaff [Fri, 19 Mar 2010 00:09:42 +0000 (17:09 -0700)]
vswitch: Limit SSL table to a single row.
Only a single row in the SSL can be useful currently. This should help to
prevent confusion since ovsdb-server will choose an SSL configuration
randomly if there is more than one.
Ben Pfaff [Fri, 19 Mar 2010 00:12:02 +0000 (17:12 -0700)]
ovsdb-server: Obtain SSL configuration from database.
ovsdb-server should be able to obtain its SSL configuration from the
database that it is serving out, instead of having to specify it on the
command line. This commit makes it so.
Ben Pfaff [Fri, 19 Mar 2010 00:00:02 +0000 (17:00 -0700)]
docs: Fix ovsdb-server manpage.
The description of --remote=db:table,column got accidentally dropped a
number of commits back, so restore it. Also, document that ovsdb-server
supports SSL bootstrapping.
Ben Pfaff [Thu, 18 Mar 2010 23:59:04 +0000 (16:59 -0700)]
docs: Move PKI section heading into individual manpages.
The ovsdb-server manpage needs a paragraph between the heading and the
first option description, so the heading can't go into the common fragment.
Ben Pfaff [Fri, 19 Mar 2010 00:12:27 +0000 (17:12 -0700)]
docs: Make SSL manpage fragments less specific to OpenFlow.
These manpage fragments are used in OVSDB manpages as well, so their text
should try to avoid referring to OpenFlow-specific concepts.
Ben Pfaff [Thu, 18 Mar 2010 23:40:35 +0000 (16:40 -0700)]
stream-ssl: Make no-op reconfiguration cheap.
Until now, the stream_ssl functions for configuring private keys,
certificates, and CA certificates have always called into OpenSSL to read
a file. This commit instead makes them do that only if the file name
changed (or it has been 60 seconds since we last tried, in case someone
installed the file behind our backs).
This allows us to factor some code out of vswitchd. In an upcoming commit
we will want to do essentially the same thing from ovsdb-server, so this
avoid code redundancy.
Ben Pfaff [Thu, 18 Mar 2010 23:08:32 +0000 (16:08 -0700)]
stream-ssl: Permit race in bootstrapping CA certificate.
If two processes were both configured to bootstrap the CA certificate, then
one of them would succeed in writing it to a file and use it, and the other
one would fail to use it because the file was created behind its back.
This commit fixes the problem by making the bootstrap code accept a CA
certificate file that exists at the time that bootstrapping tries to create
it.
Jesse Gross [Fri, 19 Mar 2010 17:54:36 +0000 (13:54 -0400)]
classifer: Fix test classifier to match real classifier.
The trivial test classifier had the same bug as the real classifier
when replacing matching flows. This caused it to not find the
original bug and then break when the bug was fixed.
Jesse Gross [Fri, 19 Mar 2010 16:08:16 +0000 (12:08 -0400)]
classifier: Check all rules of equal priority when inserting.
When adding a new classifier rule we check if there is a rule
of the same priority first and overwrite it before inserting a
new rule. Previously we would stop looking if we found one rule
in the correct bucket with the same priority, even if it didn't
match. This keeps going until we either find a matching rule or
we run out of equal priority rules.
Reported-by: Tetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>
Justin Pettit [Sat, 13 Mar 2010 14:11:47 +0000 (06:11 -0800)]
xenserver: Make OVS xsconsole plugin configure management channel
Previously, the xsconsole plugin configured a single OpenFlow controller
configuration across all bridges. With the management channel, we can
now have the manager configure the bridges' controllers individually.
This changes the plugin to only set that management IP.
Justin Pettit [Sat, 13 Mar 2010 12:41:20 +0000 (04:41 -0800)]
xenserver: Remove support for setting different controllers for datapaths
A hack was put in a while back to support setting different controllers for
different datapaths by defining a "for-bridges" value in the
"vSwitchController" key. It is no longer necessary to do that with the
management protocol, since the manager can directly set controllers for
each datapath.
Justin Pettit [Sat, 13 Mar 2010 14:24:47 +0000 (06:24 -0800)]
xenserver: Add ovsdb-server logs to xen-bugtool
Ben Pfaff [Wed, 17 Mar 2010 00:09:44 +0000 (17:09 -0700)]
vswitch: Limit Open_vSwitch table to a single record.
This table has always been limited to a single record. This commit makes
the database itself enforce that limit.
Ben Pfaff [Wed, 17 Mar 2010 00:08:06 +0000 (17:08 -0700)]
ovsdb: Allow constraining the number of rows in a table.
Ben Pfaff [Wed, 17 Mar 2010 00:07:22 +0000 (17:07 -0700)]
ovsdb: Fix error message when parsing an operation fails.
Otherwise you get errors with text like "ovsdb operation 2 of 1", which
is confusing.
Ben Pfaff [Thu, 18 Mar 2010 18:24:55 +0000 (11:24 -0700)]
ovsdb: Compact databases online automatically and on-demand.
If the database grows fairly large, and we've written a fair number of
transactions to it, and it's been a while since the database was compacted,
then (after the next commit) compact the database.
Also, compact the database online if the "ovsdb-server/compact" command is
issued via unixctl. I suspect that this feature will rarely if ever be
used in practice, but it's easier to test than compacting automatically.
Bug #2391.