X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-vsctl.c;h=c2c67ad8b0bde4fbad1518251d649a596cd8b8a1;hb=ea7bd5973fb426f3a6ea66b0953c6000980e77ec;hp=ec1cfb3f03d99a47bae8e99368dc5c08809d2403;hpb=e5e12280e1b6dbad79742ce43e9bb10545281f5e;p=openvswitch diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index ec1cfb3f..c2c67ad8 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -531,7 +531,7 @@ default_db(void) { static char *def; if (!def) { - def = xasprintf("unix:%s/db.sock", ovs_rundir); + def = xasprintf("unix:%s/db.sock", ovs_rundir()); } return def; } @@ -981,6 +981,7 @@ pre_cmd_emer_reset(struct vsctl_context *ctx) ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_ssl); ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_controller); + ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_fail_mode); ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_mirrors); ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_netflow); ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_sflow); @@ -1018,6 +1019,7 @@ cmd_emer_reset(struct vsctl_context *ctx) char *hw_val = NULL; ovsrec_bridge_set_controller(br, NULL, 0); + ovsrec_bridge_set_fail_mode(br, NULL); ovsrec_bridge_set_mirrors(br, NULL, 0); ovsrec_bridge_set_netflow(br, NULL); ovsrec_bridge_set_sflow(br, NULL); @@ -1699,6 +1701,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) { @@ -1973,6 +1983,16 @@ static const struct vsctl_table_class tables[] = { {{&ovsrec_table_port, &ovsrec_port_col_name, &ovsrec_port_col_qos}, {NULL, NULL, NULL}}}, + {&ovsrec_table_monitor, + {{&ovsrec_table_interface, + &ovsrec_interface_col_name, + &ovsrec_interface_col_monitor}, + {NULL, NULL, NULL}}}, + + {&ovsrec_table_maintenance_point, + {{NULL, NULL, NULL}, + {NULL, NULL, NULL}}}, + {&ovsrec_table_queue, {{NULL, NULL, NULL}, {NULL, NULL, NULL}}}, @@ -3042,6 +3062,9 @@ run_prerequisites(struct vsctl_command *commands, size_t n_commands, struct vsctl_command *c; ovsdb_idl_add_table(idl, &ovsrec_table_open_vswitch); + if (wait_for_reload) { + ovsdb_idl_add_column(idl, &ovsrec_open_vswitch_col_cur_cfg); + } for (c = commands; c < &commands[n_commands]; c++) { if (c->syntax->prerequisites) { struct vsctl_context ctx; @@ -3157,7 +3180,6 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, for (c = commands; c < &commands[n_commands]; c++) { struct ds *ds = &c->output; - struct shash_node *node; if (oneline) { size_t j; @@ -3184,10 +3206,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, } ds_destroy(&c->output); - SHASH_FOR_EACH (node, &c->options) { - free(node->data); - } - shash_destroy(&c->options); + smap_destroy(&c->options); } free(commands); @@ -3233,8 +3252,8 @@ static const struct vsctl_command_syntax all_commands[] = { {"br-exists", 1, 1, pre_get_info, cmd_br_exists, NULL, "", RO}, {"br-to-vlan", 1, 1, pre_get_info, cmd_br_to_vlan, NULL, "", RO}, {"br-to-parent", 1, 1, pre_get_info, cmd_br_to_parent, NULL, "", RO}, - {"br-set-external-id", 2, 3, pre_get_info, cmd_br_set_external_id, NULL, - "", RW}, + {"br-set-external-id", 2, 3, pre_cmd_br_set_external_id, + cmd_br_set_external_id, NULL, "", RW}, {"br-get-external-id", 1, 2, pre_cmd_br_get_external_id, cmd_br_get_external_id, NULL, "", RO}, @@ -3253,10 +3272,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},