+ json_object_put(monitor_requests, table->name, monitor_request_array);
+}
+
+static void
+do_monitor(struct jsonrpc *rpc, const char *database,
+ int argc, char *argv[])
+{
+ const char *server = jsonrpc_get_name(rpc);
+ const char *table_name = argv[0];
+ struct unixctl_server *unixctl;
+ struct ovsdb_schema *schema;
+ struct jsonrpc_msg *request;
+ struct json *monitor, *monitor_requests, *request_id;
+ bool exiting = false;
+ bool blocked = false;
+
+ struct monitored_table *mts;
+ size_t n_mts, allocated_mts;
+
+ daemon_save_fd(STDOUT_FILENO);
+ daemonize_start();
+ if (get_detach()) {
+ int error;
+
+ error = unixctl_server_create(NULL, &unixctl);
+ if (error) {
+ ovs_fatal(error, "failed to create unixctl server");
+ }
+
+ unixctl_command_register("exit", "", 0, 0,
+ ovsdb_client_exit, &exiting);
+ unixctl_command_register("ovsdb-client/block", "", 0, 0,
+ ovsdb_client_block, &blocked);
+ unixctl_command_register("ovsdb-client/unblock", "", 0, 0,
+ ovsdb_client_unblock, &blocked);
+ } else {
+ unixctl = NULL;
+ }
+
+ schema = fetch_schema(rpc, database);
+