[ovs-dev] [PATCH monitor_cond V2 09/12] ovsdb: look for monitor id on all jsonrpc monitor sessions

Liran Schour LIRANS at il.ibm.com
Fri Jan 22 10:02:36 UTC 2016


Andy Zhou <azhou at ovn.org> wrote on 22/01/2016 05:33:49 AM:

> On Sat, Jan 16, 2016 at 12:16 AM, Liran Schour <lirans at il.ibm.com> 
wrote:
> That will be used later to issue "monitor_cond_change" command.

> This commit message is the same as the last patch.  I don't think it
> explains the reason for this patch. 
> Signed-off-by: Liran Schour <lirans at il.ibm.com>
> ---
>  ovsdb/jsonrpc-server.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)

> I don't get the reason for this change. Why existing code is not 
sufficient? 
> Please explain.
>

If cond_update is being sent from the existing JSONRPC session, we do not 
need this change. Will remove it.
 
> Tab are used for indenting in this file. Please use space instead.
>  
> diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
> index 3d898bb..c5aad17 100644
> --- a/ovsdb/jsonrpc-server.c
> +++ b/ovsdb/jsonrpc-server.c
> @@ -1070,12 +1070,21 @@ static struct ovsdb_jsonrpc_monitor *
>  ovsdb_jsonrpc_monitor_find(struct ovsdb_jsonrpc_session *s,
>                             const struct json *monitor_id)
>  {
> +    struct ovsdb_jsonrpc_server *svr = s->remote->server;
>      struct ovsdb_jsonrpc_monitor *m;
> +    struct shash_node *node;
> 
> -    HMAP_FOR_EACH_WITH_HASH (m, node, json_hash(monitor_id, 0), 
> &s->monitors) {
> -        if (json_equal(m->monitor_id, monitor_id)) {
> -            return m;
> -        }
> +    SHASH_FOR_EACH (node, &svr->remotes) {
> +        struct ovsdb_jsonrpc_remote *remote = node->data;
> +
> +       LIST_FOR_EACH (s, node, &remote->sessions) {
> +           HMAP_FOR_EACH_WITH_HASH (m, node,
> +                                     json_hash(monitor_id, 0), 
> &s->monitors) {
> +               if (json_equal(m->monitor_id, monitor_id)) {
> +                   return m;
> +               }
> +           }
> +       }
>      }
> 
>      return NULL;
> --
> 2.1.4
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list