ovs-vsctl: Clear manager_options column and delete Manager rows on emer-reset.
authorAndrew Evans <aevans@nicira.com>
Wed, 2 Feb 2011 08:08:12 +0000 (00:08 -0800)
committerAndrew Evans <aevans@nicira.com>
Thu, 3 Feb 2011 22:20:38 +0000 (14:20 -0800)
utilities/ovs-vsctl.c

index c2c67ad8b0bde4fbad1518251d649a596cd8b8a1..fd9f8f4aba9600c7c8aff3279b32695076d1737b 100644 (file)
@@ -978,6 +978,7 @@ static void
 pre_cmd_emer_reset(struct vsctl_context *ctx)
 {
     ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_managers);
+    ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_manager_options);
     ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_ssl);
 
     ovsdb_idl_add_column(ctx->idl, &ovsrec_bridge_col_controller);
@@ -1005,12 +1006,14 @@ cmd_emer_reset(struct vsctl_context *ctx)
     const struct ovsrec_interface *iface;
     const struct ovsrec_mirror *mirror, *next_mirror;
     const struct ovsrec_controller *ctrl, *next_ctrl;
+    const struct ovsrec_manager *mgr, *next_mgr;
     const struct ovsrec_netflow *nf, *next_nf;
     const struct ovsrec_ssl *ssl, *next_ssl;
     const struct ovsrec_sflow *sflow, *next_sflow;
 
     /* Reset the Open_vSwitch table. */
     ovsrec_open_vswitch_set_managers(ctx->ovs, NULL, 0);
+    ovsrec_open_vswitch_set_manager_options(ctx->ovs, NULL, 0);
     ovsrec_open_vswitch_set_ssl(ctx->ovs, NULL);
 
     OVSREC_BRIDGE_FOR_EACH (br, idl) {
@@ -1060,6 +1063,10 @@ cmd_emer_reset(struct vsctl_context *ctx)
         ovsrec_controller_delete(ctrl);
     }
 
+    OVSREC_MANAGER_FOR_EACH_SAFE (mgr, next_mgr, idl) {
+        ovsrec_manager_delete(mgr);
+    }
+
     OVSREC_NETFLOW_FOR_EACH_SAFE (nf, next_nf, idl) {
         ovsrec_netflow_delete(nf);
     }