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

70 Commits

Author SHA1 Message Date
Ben Pfaff
36a7b32d79 Suppress ovsdb-server log messages about connections from ovs-vsctl.
In the ovsdb-server log there are fairly continuous messages like these:

Apr 26 11:27:55|15254|reconnect|INFO|unix:/tmp/stream-unix.31734.0: connected
Apr 26 11:27:55|15255|reconnect|INFO|unix:/tmp/stream-unix.31734.0: connection dropped
Apr 26 11:28:00|15256|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connecting...
Apr 26 11:28:00|15257|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connected
Apr 26 11:28:00|15258|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connection dropped

These just indicate that ovs-vsctl is connecting to ovsdb-server from,
for example, the "vif" script.  But there's no need to log all that detail;
it's simply not useful.  This commit suppresses it.

Bug #2715.
2010-06-22 11:49:56 -07:00
Ben Pfaff
d1b801a597 jsonrpc: Suppress duplicate logging.
Both jsonrpc and reconnect were logging ordinary connection closure.
There's no need for both to do it.
2010-06-22 11:49:56 -07:00
Ben Pfaff
41630cfbc3 jsonrpc: Propagate error code to reconnect_disconnected().
Always passing 0 to reconnect_disconnected() means that it uses a generic
log message ("connection dropped").  By passing the error code, as done by
this commit, reconnect_disconnected() can log a more specific message.
2010-06-22 11:49:56 -07:00
Ben Pfaff
1e3c004749 Diagnose attempts to connect the wrong protocol to a network port.
Sometimes, when a user asks me to help debug a problem, it turns out that
an SSL connection was being made on a TCP port, or vice versa, or that an
OpenFlow connection was being made on a JSON-RPC port, or vice versa, and
so on.  This commit adds log messages that diagnose this kind of problem,
e.g. "tcp:127.0.0.1:6633: received JSON-RPC data on OpenFlow channel".
2010-05-11 11:50:45 -07:00
Ben Pfaff
b302749b70 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.
2010-04-13 09:30:32 -07:00
Ben Pfaff
0d11f523a3 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.
2010-04-12 11:15:15 -07:00
Ben Pfaff
c9f3f37a9d 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.
2010-04-12 11:03:32 -07:00
Ben Pfaff
7c88a5dc3a 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.
2010-03-24 16:52:07 -07:00
Ben Pfaff
36d802ae1f json: New function json_to_ds().
Some upcoming code wants to serialize JSON into a "struct ds" dynamic
string buffer, so expose an interface to do this.

This commit doesn't change much, but it renames some functions internal
to json.c to make the naming more consistent.

Also, make jsonrpc_log_msg() use this new function, since it is a more
straightforward way to do what it wants.
2010-01-26 09:49:30 -08:00
Ben Pfaff
7b8dbc8d8f jsonrpc: Fix memory leak in jsonrpc_session_send() when not connected.
Partial fix for bug #2373.
2010-01-12 14:28:00 -08:00
Ben Pfaff
f3d00a23ad jsonrpc: Check RPC status after trying to send, not before.
This usually prevented JSON-RPC over SSL from working.

Reported-by: Jeremy Stribling <strib@nicira.com>
2010-01-11 13:06:42 -08:00
Ben Pfaff
a1ae9a4316 jsonrpc: Properly implement connection timeout.
jsonrpc_session_connect() indirectly called reconnect_disconnected(), which
told the reconnect object that the connection had failed, before it told it
that the connection attempt had started.  When the connection didn't
complete immediately, this caused the connection to time out immediately,
without any backoff.

Reported by Jeremy Stribling.
2010-01-08 15:36:06 -08:00
Ben Pfaff
108496163d stream: Remove spurious #includes from header file. 2010-01-06 14:32:22 -08:00
Ben Pfaff
539e96f623 stream: Add stream_run(), stream_run_wait() functions.
SSL, which will be added in an upcoming commit, requires some background
processing, which is best done in a "run" function in our architecture.
This commit adds stream_run() and stream_run_wait() and calls to them from
the places where they will be required.
2010-01-06 14:26:48 -08:00
Ben Pfaff
4931f33ad9 ovsdb-server: Factor out complication by using jsonrpc_session. 2010-01-04 09:47:01 -08:00
Ben Pfaff
20bed8be25 jsonrpc: Make it easy to get a new JSON-RPC request's id. 2009-12-02 11:19:08 -08:00
Ben Pfaff
dcbb691b00 jsonrpc: New type "jsonrpc_session", which automatically reconnects. 2009-12-02 11:19:03 -08:00
Ben Pfaff
1fd13cde12 jsonrpc: Add logging for messages sent and received, at DBG level.
This made it much easier to see problems while developing some
ovsdb-server features.
2009-11-17 16:02:46 -08:00
Ben Pfaff
d0632593fe ovsdb: Add new ovsdb-client program. 2009-11-06 15:35:34 -08:00
Ben Pfaff
f212909325 Implement JSON-RPC protocol. 2009-11-04 15:24:40 -08:00