diff options
author | Andy Zhou <azhou@nicira.com> | 2015-03-16 03:03:20 -0700 |
---|---|---|
committer | Andy Zhou <azhou@nicira.com> | 2015-06-08 14:28:23 -0700 |
commit | 6e5a9216f3a16c2de508dbaf960c643219d45fa6 (patch) | |
tree | ab0acb1aae650a519da9af5027a750aff4f7a097 /ovsdb/monitor.h | |
parent | 36247a75e9990a7f7ee3c5124852395f33ba1d38 (diff) | |
download | openvswitch-6e5a9216f3a16c2de508dbaf960c643219d45fa6.tar.gz |
ovsdb-monitor: allow multiple jsonrpc monitors to share a single ovsdb
monitor
Store ovsdb monitor in a global hmap. If a newly created ovsdb monitor
object monitors the same tables and columns as an existing one, the
existing monitor will be reused.
With this patch, jsonrpc monitor and ovsdb monitor now have N:1 mapping.
The goals are to:
1) Reduce the cost of maintaining duplicated monitors.
2) Allow for create Json cache for the same updates. Json cache will be
introduced in the following patch.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ovsdb/monitor.h')
-rw-r--r-- | ovsdb/monitor.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ovsdb/monitor.h b/ovsdb/monitor.h index 5fcb346e0..dc2fc1af6 100644 --- a/ovsdb/monitor.h +++ b/ovsdb/monitor.h @@ -28,7 +28,15 @@ enum ovsdb_monitor_selection { struct ovsdb_monitor *ovsdb_monitor_create(struct ovsdb *db, - struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +struct ovsdb_monitor *ovsdb_monitor_add(struct ovsdb_monitor *dbmon); + +void ovsdb_monitor_add_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); + +void ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *dbmon, + struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); void ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *dbmon, struct ovsdb_jsonrpc_monitor *jsonrpc_monitor); |