+static void
+do_list_dbs(int argc UNUSED, char *argv[])
+{
+ struct jsonrpc_msg *request, *reply;
+ struct jsonrpc *rpc;
+ int error;
+ size_t i;
+
+ rpc = open_jsonrpc(argv[1]);
+ request = jsonrpc_create_request("list_dbs", json_array_create_empty(),
+ NULL);
+ error = jsonrpc_transact_block(rpc, request, &reply);
+ if (error) {
+ ovs_fatal(error, "transaction failed");
+ }
+
+ if (reply->result->type != JSON_ARRAY) {
+ ovs_fatal(0, "list_dbs response is not array");
+ }
+
+ for (i = 0; i < reply->result->u.array.n; i++) {
+ const struct json *name = reply->result->u.array.elems[i];
+
+ if (name->type != JSON_STRING) {
+ ovs_fatal(0, "list_dbs response %zu is not string", i);
+ }
+ puts(name->u.string);
+ }
+ jsonrpc_msg_destroy(reply);
+}
+