X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fovs-vswitchd.c;h=cd30c96d309762f96b4afb9c90bff079316181a7;hb=d6da96ce2b32f477a79f9d980a659ba31f71d191;hp=a027b8cfe83d339f6cb7ea23b0c1a826136185cf;hpb=9200fb9ef9a1c55a76e4c4aa789f3fb0a76f0ed1;p=openvswitch diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index a027b8cf..cd30c96d 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -31,6 +31,7 @@ #include "compiler.h" #include "daemon.h" #include "dpif.h" +#include "dummy.h" #include "leak-checker.h" #include "netdev.h" #include "ovsdb-idl.h" @@ -40,15 +41,16 @@ #include "signals.h" #include "stream-ssl.h" #include "stream.h" +#include "stress.h" #include "svec.h" #include "timeval.h" #include "unixctl.h" #include "util.h" #include "vconn.h" +#include "vlog.h" #include "vswitchd/vswitch-idl.h" -#include "vlog.h" -#define THIS_MODULE VLM_vswitchd +VLOG_DEFINE_THIS_MODULE(vswitchd); static unixctl_cb_func ovs_vswitchd_exit; @@ -66,6 +68,7 @@ main(int argc, char *argv[]) proctitle_init(argc, argv); set_program_name(argv[0]); + stress_init_command(); remote = parse_options(argc, argv); signal(SIGPIPE, SIG_IGN); sighup = signal_register(SIGHUP); @@ -99,8 +102,13 @@ main(int argc, char *argv[]) unixctl_server_wait(unixctl); dp_wait(); netdev_wait(); + if (exiting) { + poll_immediate_wake(); + } poll_block(); } + bridge_exit(); + unixctl_server_destroy(unixctl); return 0; } @@ -114,7 +122,8 @@ parse_options(int argc, char *argv[]) OPT_FAKE_PROC_NET, VLOG_OPTION_ENUMS, LEAK_CHECKER_OPTION_ENUMS, - OPT_BOOTSTRAP_CA_CERT + OPT_BOOTSTRAP_CA_CERT, + OPT_ENABLE_DUMMY }; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, @@ -129,6 +138,7 @@ parse_options(int argc, char *argv[]) {"peer-ca-cert", required_argument, 0, OPT_PEER_CA_CERT}, {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT}, #endif + {"enable-dummy", no_argument, 0, OPT_ENABLE_DUMMY}, {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -185,6 +195,10 @@ parse_options(int argc, char *argv[]) break; #endif + case OPT_ENABLE_DUMMY: + dummy_enable(); + break; + case '?': exit(EXIT_FAILURE);