[ovs-dev] [PATCH] ofproto: Store time since last connect and disconnect in Controller table.

Ben Pfaff blp at nicira.com
Mon Mar 14 17:33:42 UTC 2011


On Sun, Mar 13, 2011 at 11:40:47PM -0700, Andrew Evans wrote:
> ovs-vswitchd writes only the duration of its connection to or disconnection
> from each controller to the database. This changes that behavior to write the
> time since both the last connection and disconnection events regardless of
> connection state. This mirrors the new behavior for reporting database manager
> connection status.
> 
> Requested-by: Peter Balland <peter at nicira.com>
> Bug #4833.

In disconnect() you can use the value of 'now' that has already been
initialized two lines up instead of calling time_now() again.

In the two instances of expressions like
	xasprintf("%ld", time_now() - rconn_get_last_connection(rconn))
I would advise adding a cast to "long int" since there is no guarantee
that time_t is compatible with long int.  It is probably int or long
int, but it might be long long int or even short, and it's better not
to guess.

As with the other patch I'm surprised to see an empty value in place
of an omitted key-value pair.



More information about the dev mailing list