From 87824b0bfa2daf4a1b1949a96feaeb0d5710fb38 Mon Sep 17 00:00:00 2001
From: Andrew Evans <aevans@nicira.com>
Date: Wed, 2 Feb 2011 00:08:12 -0800
Subject: [PATCH] ovs-vsctl: Clear manager_options column and delete Manager
 rows on emer-reset.

---
 utilities/ovs-vsctl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index c2c67ad8b..fd9f8f4ab 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -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);
     }
-- 
2.47.0