diff mbox series

[ovs-dev,v2,13/17] ovsdb-cs: Add function to set all jsonrpc session options.

Message ID 20240109225142.1987981-14-i.maximets@ovn.org
State Accepted
Commit dd0947b871327de9083727e17e41f45bf3dcd82d
Delegated to: Ilya Maximets
Headers show
Series ovsdb-server: Configuration via config-file. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Ilya Maximets Jan. 9, 2024, 10:49 p.m. UTC
Allow setting all the options for the source connection, not only the
inactivity probe interval.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 lib/ovsdb-cs.c | 10 ++++++++++
 lib/ovsdb-cs.h |  3 +++
 2 files changed, 13 insertions(+)

Comments

Dumitru Ceara Jan. 12, 2024, 8:47 p.m. UTC | #1
On 1/9/24 23:49, Ilya Maximets wrote:
> Allow setting all the options for the source connection, not only the
> inactivity probe interval.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Acked-by: Dumitru Ceara <dceara@redhat.com>
diff mbox series

Patch

diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index c7c147cc0..b5eda88ad 100644
--- a/lib/ovsdb-cs.c
+++ b/lib/ovsdb-cs.c
@@ -791,6 +791,16 @@  ovsdb_cs_get_last_error(const struct ovsdb_cs *cs)
     }
 }
 
+/* Sets all the JSON-RPC session 'options' for 'cs''s current session. */
+void
+ovsdb_cs_set_jsonrpc_options(const struct ovsdb_cs *cs,
+                             const struct jsonrpc_session_options *options)
+{
+    if (cs->session) {
+        jsonrpc_session_set_options(cs->session, options);
+    }
+}
+
 /* Sets the "probe interval" for 'cs''s current session to 'probe_interval', in
  * milliseconds. */
 void
diff --git a/lib/ovsdb-cs.h b/lib/ovsdb-cs.h
index 4cf9ca2b9..bcc3dcd71 100644
--- a/lib/ovsdb-cs.h
+++ b/lib/ovsdb-cs.h
@@ -32,6 +32,7 @@ 
 #include "openvswitch/uuid.h"
 
 struct json;
+struct jsonrpc_session_options;
 struct ovsdb_cs;
 
 struct ovsdb_cs_ops {
@@ -131,6 +132,8 @@  bool ovsdb_cs_is_alive(const struct ovsdb_cs *);
 bool ovsdb_cs_is_connected(const struct ovsdb_cs *);
 int ovsdb_cs_get_last_error(const struct ovsdb_cs *);
 
+void ovsdb_cs_set_jsonrpc_options(const struct ovsdb_cs *,
+                                  const struct jsonrpc_session_options *);
 void ovsdb_cs_set_probe_interval(const struct ovsdb_cs *, int probe_interval);
 
 /* Conditional monitoring (specifying that only rows matching particular