+static bool
+ovsdb_jsonrpc_monitor_needs_flush(struct ovsdb_jsonrpc_session *s)
+{
+ struct ovsdb_jsonrpc_monitor *m;
+
+ HMAP_FOR_EACH (m, node, &s->monitors) {
+ struct shash_node *node;
+
+ SHASH_FOR_EACH (node, &m->tables) {
+ struct ovsdb_jsonrpc_monitor_table *mt = node->data;
+
+ if (!hmap_is_empty(&mt->changes)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+static void
+ovsdb_jsonrpc_monitor_flush_all(struct ovsdb_jsonrpc_session *s)
+{
+ struct ovsdb_jsonrpc_monitor *m;
+
+ HMAP_FOR_EACH (m, node, &s->monitors) {
+ struct json *json;
+
+ json = ovsdb_jsonrpc_monitor_compose_table_update(m, false);
+ if (json) {
+ struct jsonrpc_msg *msg;
+ struct json *params;
+
+ params = json_array_create_2(json_clone(m->monitor_id), json);
+ msg = jsonrpc_create_notify("update", params);
+ jsonrpc_session_send(s->js, msg);
+ }
+ }
+}
+