+ovsdb_server_add_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[], void *aux_)
+{
+ struct add_remote_aux *aux = aux_;
+ const char *remote = argv[1];
+
+ const struct ovsdb_column *column;
+ const struct ovsdb_table *table;
+ const struct db *db;
+ char *retval;
+
+ retval = (strncmp("db:", remote, 3)
+ ? NULL
+ : parse_db_column(aux->dbs, aux->n_dbs, remote,
+ &db, &table, &column));
+ if (!retval) {
+ if (sset_add(aux->remotes, remote)) {
+ save_config(aux->config_tmpfile, aux->remotes);
+ }
+ unixctl_command_reply(conn, NULL);
+ } else {
+ unixctl_command_reply_error(conn, retval);
+ free(retval);
+ }
+}
+
+/* "ovsdb-server/remove-remote REMOTE": removes REMOTE frmo the set of remotes
+ * that ovsdb-server services. */
+static void
+ovsdb_server_remove_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[], void *aux_)
+{
+ struct remove_remote_aux *aux = aux_;
+ struct sset_node *node;
+
+ node = sset_find(aux->remotes, argv[1]);
+ if (node) {
+ sset_delete(aux->remotes, node);
+ save_config(aux->config_tmpfile, aux->remotes);
+ unixctl_command_reply(conn, NULL);
+ } else {
+ unixctl_command_reply_error(conn, "no such remote");
+ }
+}
+
+/* "ovsdb-server/list-remotes": outputs a list of configured rmeotes. */
+static void
+ovsdb_server_list_remotes(struct unixctl_conn *conn, int argc OVS_UNUSED,
+ const char *argv[] OVS_UNUSED, void *remotes_)
+{
+ struct sset *remotes = remotes_;
+ const char **list, **p;
+ struct ds s;
+
+ ds_init(&s);
+
+ list = sset_sort(remotes);
+ for (p = list; *p; p++) {
+ ds_put_format(&s, "%s\n", *p);
+ }
+ free(list);
+
+ unixctl_command_reply(conn, ds_cstr(&s));
+ ds_destroy(&s);
+}
+
+static void
+parse_options(int *argcp, char **argvp[],
+ struct sset *remotes, char **unixctl_pathp, char **run_command)