[ovs-dev] ovsdb idl: API to get the idl session

Message ID CAOgUkSVasPd51CrQ-fa4_KnSP5wd5zhH+ETocBM0g7zBykyd3A@mail.gmail.com
State Not Applicable
Headers show
Series
  • [ovs-dev] ovsdb idl: API to get the idl session
Related show

Commit Message

Arunkumar Rg Oct. 9, 2018, 7:26 a.m.
Added an API in ovsdb-idl to get the idl->session. This API is useful in
the
ovsdb client code as the session information returned by this API would be
used to get the details about the remote session.

Signed-off-by: Arunkumar R G <arunkumar.rg@gmail.com>

---
 lib/ovsdb-idl.c | 6 ++++++
 lib/ovsdb-idl.h | 3 +++
 2 files changed, 9 insertions(+)

 void ovsdb_idl_force_reconnect(struct ovsdb_idl *);
--
1.8.3.1

Comments

Ben Pfaff Oct. 11, 2018, 10:10 p.m. | #1
On Tue, Oct 09, 2018 at 12:56:37PM +0530, Arunkumar Rg wrote:
> Added an API in ovsdb-idl to get the idl->session. This API is useful in
> the
> ovsdb client code as the session information returned by this API would be
> used to get the details about the remote session.
> 
> Signed-off-by: Arunkumar R G <arunkumar.rg@gmail.com>

Thanks for the patch.

"git am" says:

    Applying: ovsdb idl: API to get the idl session
    error: corrupt patch at line 21
    Patch failed at 0001 ovsdb idl: API to get the idl session
    The copy of the patch that failed is found in: /home/blp/nicira/ovs.git/worktrees/ovs/rebase-apply/patch
    When you have resolved this problem, run "git am --continue".
    If you prefer to skip this patch, run "git am --skip" instead.
    To restore the original branch and stop patching, run "git am --abort".

The problem is that the patch is wordwrapped.  You should resend the
patch without wordwrapping.

Patch

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 6a19b07..01e00f2 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -976,6 +976,12 @@  ovsdb_idl_is_connected(const struct ovsdb_idl *idl)
     return idl->session && jsonrpc_session_is_connected(idl->session);
 }

+struct jsonrpc_session *
+ovsdb_idl_get_session(const struct ovsdb_idl *idl)
+{
+    return idl->session;
+}
+
 /* Returns the last error reported on a connection by 'idl'.  The return
value
  * is 0 only if no connection made by 'idl' has ever encountered an error
and
  * a negative response to a schema request has never been received. See
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 8a168eb..201ba1e 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -55,6 +55,7 @@  struct ovsdb_idl_row;
 struct ovsdb_idl_column;
 struct ovsdb_idl_table_class;
 struct uuid;
+struct jsonrpc_session;

 struct ovsdb_idl *ovsdb_idl_create(const char *remote,
                                    const struct ovsdb_idl_class *,
@@ -76,6 +77,8 @@  bool ovsdb_idl_is_lock_contended(const struct ovsdb_idl
*);

 const struct uuid  * ovsdb_idl_get_monitor_id(const struct ovsdb_idl *);
 unsigned int ovsdb_idl_get_seqno(const struct ovsdb_idl *);
+struct jsonrpc_session *ovsdb_idl_get_session(const struct ovsdb_idl *);
+
 bool ovsdb_idl_has_ever_connected(const struct ovsdb_idl *);
 void ovsdb_idl_enable_reconnect(struct ovsdb_idl *);