X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fovsdb-idl.c;h=7556b7f390122ed6b6eab4611572be6025d2d1ad;hb=HEAD;hp=463129148dec2cc46b06cffb29395e24d0a964b0;hpb=0141e875a14cc30fe9c207a83616861055531d4d;p=sliver-openvswitch.git diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 463129148..7556b7f39 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -332,9 +332,6 @@ ovsdb_idl_run(struct ovsdb_idl *idl) && !strcmp(msg->method, "stolen")) { /* Someone else stole our lock. */ ovsdb_idl_parse_lock_notify(idl, msg->params, false); - } else if (msg->type == JSONRPC_REPLY && msg->id->type == JSON_STRING - && !strcmp(msg->id->u.string, "echo")) { - /* Reply to our echo request. Ignore it. */ } else if ((msg->type == JSONRPC_ERROR || msg->type == JSONRPC_REPLY) && ovsdb_idl_txn_process_reply(idl, msg)) { @@ -397,6 +394,14 @@ ovsdb_idl_has_ever_connected(const struct ovsdb_idl *idl) return ovsdb_idl_get_seqno(idl) != 0; } +/* Reconfigures 'idl' so that it would reconnect to the database, if + * connection was dropped. */ +void +ovsdb_idl_enable_reconnect(struct ovsdb_idl *idl) +{ + jsonrpc_session_enable_reconnect(idl->session); +} + /* Forces 'idl' to drop its connection to the database and reconnect. In the * meantime, the contents of 'idl' will not change. */ void @@ -444,7 +449,7 @@ ovsdb_idl_get_mode(struct ovsdb_idl *idl, } } - NOT_REACHED(); + OVS_NOT_REACHED(); } static void @@ -508,7 +513,7 @@ ovsdb_idl_add_table(struct ovsdb_idl *idl, } } - NOT_REACHED(); + OVS_NOT_REACHED(); } /* Turns off OVSDB_IDL_ALERT for 'column' in 'idl'. @@ -2108,7 +2113,7 @@ ovsdb_idl_txn_process_inc_reply(struct ovsdb_idl_txn *txn, if (txn->inc_index + 2 > results->n) { VLOG_WARN_RL(&syntax_rl, "reply does not contain enough operations " - "for increment (has %zu, needs %u)", + "for increment (has %"PRIuSIZE", needs %u)", results->n, txn->inc_index + 2); return false; } @@ -2133,7 +2138,7 @@ ovsdb_idl_txn_process_inc_reply(struct ovsdb_idl_txn *txn, return false; } if (rows->u.array.n != 1) { - VLOG_WARN_RL(&syntax_rl, "\"select\" reply \"rows\" has %zu elements " + VLOG_WARN_RL(&syntax_rl, "\"select\" reply \"rows\" has %"PRIuSIZE" elements " "instead of 1", rows->u.array.n); return false; @@ -2163,7 +2168,7 @@ ovsdb_idl_txn_process_insert_reply(struct ovsdb_idl_txn_insert *insert, if (insert->op_index >= results->n) { VLOG_WARN_RL(&syntax_rl, "reply does not contain enough operations " - "for insert (has %zu, needs %u)", + "for insert (has %"PRIuSIZE", needs %u)", results->n, insert->op_index); return false; }