From: Ben Pfaff <blp@nicira.com>
Date: Fri, 6 Nov 2009 21:36:17 +0000 (-0800)
Subject: ovsdb-server: Remove unixctl transaction support.
X-Git-Tag: v1.0.0~259^2~517
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=434910dd2329aa16581532902ea494e5213a74bb;p=sliver-openvswitch.git

ovsdb-server: Remove unixctl transaction support.

Executing transactions over JSON-RPC makes more sense, now that it is
supported, so remove the older support for unixctl.
---

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 17a9970ea..908042d77 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -48,8 +48,6 @@ static void parse_options(int argc, char *argv[], char **file_namep,
                           struct svec *active, struct svec *passive);
 static void usage(void) NO_RETURN;
 
-static void ovsdb_transact(struct unixctl_conn *, const char *args, void *db);
-
 int
 main(int argc, char *argv[])
 {
@@ -90,8 +88,6 @@ main(int argc, char *argv[])
         ovs_fatal(retval, "could not listen for control connections");
     }
 
-    unixctl_command_register("ovsdb/transact", ovsdb_transact, db);
-
     for (;;) {
         ovsdb_jsonrpc_server_run(jsonrpc);
         unixctl_server_run(unixctl);
@@ -198,26 +194,3 @@ usage(void)
     leak_checker_usage();
     exit(EXIT_SUCCESS);
 }
-
-static void
-ovsdb_transact(struct unixctl_conn *conn, const char *args, void *db_)
-{
-    struct ovsdb *db = db_;
-    struct json *request, *reply;
-    char *reply_string;
-
-    /* Parse JSON. */
-    request = json_from_string(args);
-    if (request->type == JSON_STRING) {
-        unixctl_command_reply(conn, 501, request->u.string);
-        json_destroy(request);
-        return;
-    }
-
-    /* Execute command. */
-    reply = ovsdb_execute(db, request, 0, NULL);
-    reply_string = json_to_string(reply, 0);
-    unixctl_command_reply(conn, 200, reply_string);
-    free(reply_string);
-    json_destroy(reply);
-}