From: Ben Pfaff Date: Wed, 8 Dec 2010 22:24:59 +0000 (-0800) Subject: ovs-vsctl: Fix controller command prerequisites. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e3e7ff9fc4cd9f3dec2b96379feb4ca98deccf8;p=openvswitch ovs-vsctl: Fix controller command prerequisites. The controller commands use the "target" column of the Controller table, but they don't supply it as a prerequisite, which makes those commands hang. This commit fixes the problem. --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 477bdb0c..c55818bd 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -1699,6 +1699,14 @@ verify_controllers(struct ovsrec_bridge *bridge) } } +static void +pre_controller(struct vsctl_context *ctx) +{ + pre_get_info(ctx); + + ovsdb_idl_add_column(ctx->idl, &ovsrec_controller_col_target); +} + static void cmd_get_controller(struct vsctl_context *ctx) { @@ -3266,10 +3274,10 @@ static const struct vsctl_command_syntax all_commands[] = { {"iface-to-br", 1, 1, pre_get_info, cmd_iface_to_br, NULL, "", RO}, /* Controller commands. */ - {"get-controller", 1, 1, pre_get_info, cmd_get_controller, NULL, "", RO}, - {"del-controller", 1, 1, pre_get_info, cmd_del_controller, NULL, "", RW}, - {"set-controller", 1, INT_MAX, pre_get_info, cmd_set_controller, NULL, "", - RW}, + {"get-controller", 1, 1, pre_controller, cmd_get_controller, NULL, "", RO}, + {"del-controller", 1, 1, pre_controller, cmd_del_controller, NULL, "", RW}, + {"set-controller", 1, INT_MAX, pre_controller, cmd_set_controller, NULL, + "", RW}, {"get-fail-mode", 1, 1, pre_get_info, cmd_get_fail_mode, NULL, "", RO}, {"del-fail-mode", 1, 1, pre_get_info, cmd_del_fail_mode, NULL, "", RW}, {"set-fail-mode", 2, 2, pre_get_info, cmd_set_fail_mode, NULL, "", RW},