bridge: Fix high cpu utilization.

When there are more than one ovs-vswitchd processes started,
only one process is enabled.  The disabled processes should
just sleep.  However, a bug in ovs makes the disabled processes
keep waking up on global connectivity sequence number which is
never sync'ed.  Consequently, those processes use 100% cpu.

This commit fixes the bug by always sync up the connectivity
sequence number for disabled processes.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
ovs-vswitchd.at: Fix "start additional ovs-vswitchd process" test

NetBSD implementation of wc command outputs extra whitespaces
like the following.  Tweak the test to success on such environments.

    % echo hoge|wc -l|hexdump -C
    00000000  20 20 20 20 20 20 20 31  0a                       |       1.|
    00000009
    %

The failing test was introduced by
commit 6bef3c7ca859f208239ca61ec3b25c09a3571553
("bridge: Fix high cpu utilization.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Joe Stringer <joestringer@nicira.com>
ovs-vswitchd.at: Add test for switch over to another ovs-vswitchd.

Test the switch over to inactive ovs-vswitchd process when user
kill the currently active ovs-vswitchd.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
ovs-vswitchd.at: Port tests to run successfully on Windows.

It is a little tricky to implement "$!" with unit tests on Windows.
This commit changes the tests so that it works both on Windows
and Linux.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
ovs-vswitchd: Fix high cpu utilization when acquire idl lock fails.

When ovs-vswitchd fails to acquire the ovsdb idl lock (either due to
contention or due to invalid database path), ovs-vswitchd will spin
on the global connectivity sequence number and consume 100% cpu.
This is in that the local copy is different to the global sequence
number and never updated when ovsdb idl is not locked.

To fix this issue, this commit makes ovs-vswitchd not checking the
global connectivity sequence number in that situation.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>