\fBovs\-appctl\fR(8) can send commands to a running
\fBovs\-openflowd\fR process. The currently supported commands are
described below.
+.SS "OVS\-OPENFLOWD COMMANDS"
+These commands are specific to \fBovs\-openflowd\fR.
+.IP "\fBexit\fR"
+Causes \fBovs\-openflowd\fR to gracefully terminate.
.so lib/vlog-unixctl.man
.
.SH "SEE ALSO"
struct svec netflow; /* NetFlow targets. */
};
+static unixctl_cb_func ovs_openflowd_exit;
+
static void parse_options(int argc, char *argv[], struct ofsettings *);
static void usage(void) NO_RETURN;
int error;
struct dpif *dpif;
struct netflow_options nf_options;
+ bool exiting;
proctitle_init(argc, argv);
set_program_name(argv[0]);
exit(EXIT_FAILURE);
}
+ unixctl_command_register("exit", ovs_openflowd_exit, &exiting);
+
VLOG_INFO("Open vSwitch version %s", VERSION BUILDNR);
VLOG_INFO("OpenFlow protocol version 0x%02x", OFP_VERSION);
daemonize_complete();
- while (s.run_forever || ofproto_is_alive(ofproto)) {
+ exiting = false;
+ while (!exiting && (s.run_forever || ofproto_is_alive(ofproto))) {
error = ofproto_run(ofproto);
if (error) {
ovs_fatal(error, "unrecoverable datapath error");
unixctl_server_wait(unixctl);
dp_wait();
netdev_wait();
+ if (exiting) {
+ poll_immediate_wake();
+ }
poll_block();
}
return 0;
}
+
+static void
+ovs_openflowd_exit(struct unixctl_conn *conn, const char *args OVS_UNUSED,
+ void *exiting_)
+{
+ bool *exiting = exiting_;
+ *exiting = true;
+ unixctl_command_reply(conn, 200, NULL);
+}
\f
/* User interface. */