daemonize_complete();
- unixctl_command_register("exit", ovsdb_server_exit, &exiting);
- unixctl_command_register("ovsdb-server/compact", ovsdb_server_compact,
- file);
- unixctl_command_register("ovsdb-server/reconnect", ovsdb_server_reconnect,
- jsonrpc);
+ unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
+ unixctl_command_register("ovsdb-server/compact", "", 0, 0,
+ ovsdb_server_compact, file);
+ unixctl_command_register("ovsdb-server/reconnect", "", 0, 0,
+ ovsdb_server_reconnect, jsonrpc);
exiting = false;
while (!exiting) {
}
static void
-ovsdb_server_exit(struct unixctl_conn *conn, const char *args OVS_UNUSED,
+ovsdb_server_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[] OVS_UNUSED,
void *exiting_)
{
bool *exiting = exiting_;
*exiting = true;
- unixctl_command_reply(conn, 200, NULL);
+ unixctl_command_reply(conn, NULL);
}
static void
-ovsdb_server_compact(struct unixctl_conn *conn, const char *args OVS_UNUSED,
- void *file_)
+ovsdb_server_compact(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[] OVS_UNUSED, void *file_)
{
struct ovsdb_file *file = file_;
struct ovsdb_error *error;
VLOG_INFO("compacting database by user request");
error = ovsdb_file_compact(file);
if (!error) {
- unixctl_command_reply(conn, 200, NULL);
+ unixctl_command_reply(conn, NULL);
} else {
char *s = ovsdb_error_to_string(error);
ovsdb_error_destroy(error);
- unixctl_command_reply(conn, 503, s);
+ unixctl_command_reply_error(conn, s);
free(s);
}
}
/* "ovsdb-server/reconnect": makes ovsdb-server drop all of its JSON-RPC
* connections and reconnect. */
static void
-ovsdb_server_reconnect(struct unixctl_conn *conn, const char *args OVS_UNUSED,
- void *jsonrpc_)
+ovsdb_server_reconnect(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[] OVS_UNUSED, void *jsonrpc_)
{
struct ovsdb_jsonrpc_server *jsonrpc = jsonrpc_;
ovsdb_jsonrpc_server_reconnect(jsonrpc);
- unixctl_command_reply(conn, 200, NULL);
+ unixctl_command_reply(conn, NULL);
}
static void
usage();
case 'V':
- OVS_PRINT_VERSION(0, 0);
+ ovs_print_version(0, 0);
exit(EXIT_SUCCESS);
VLOG_OPTION_HANDLERS