From 53178986d7fc86bcfc2f297b547a97ee71a21bb7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 28 Dec 2017 13:21:11 -0800 Subject: ovsdb: Add support for online schema conversion. With this change, "ovsdb-client convert" can be used to convert a database from one schema to another without taking the database offline. This can be useful to minimize downtime for a database during a software upgrade. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovsdb/monitor.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'ovsdb/monitor.c') diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c index 8c3053722..dd06e265e 100644 --- a/ovsdb/monitor.c +++ b/ovsdb/monitor.c @@ -1612,7 +1612,7 @@ ovsdb_monitors_remove(struct ovsdb *db) /* Delete all front-end monitors. Removing the last front-end monitor * will also destroy the corresponding ovsdb_monitor. */ LIST_FOR_EACH_SAFE (jm, next_jm, node, &m->jsonrpc_monitors) { - ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor); + ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor, false); } } } @@ -1629,3 +1629,19 @@ ovsdb_monitor_get_memory_usage(struct simap *usage) simap_increase(usage, "json-caches", hmap_count(&dbmon->json_cache)); } } + +void +ovsdb_monitor_prereplace_db(struct ovsdb *db) +{ + struct ovsdb_monitor *m, *next_m; + + LIST_FOR_EACH_SAFE (m, next_m, list_node, &db->monitors) { + struct jsonrpc_monitor_node *jm, *next_jm; + + /* Delete all front-end monitors. Removing the last front-end monitor + * will also destroy the corresponding ovsdb_monitor. */ + LIST_FOR_EACH_SAFE (jm, next_jm, node, &m->jsonrpc_monitors) { + ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor, true); + } + } +} -- cgit v1.2.1