X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fovsdb-idl.c;h=116aa86c444f40678e1731b69ea3d4f206088a90;hb=fba6bd1d3f5891471daea8bf5da22303c2d889df;hp=0c644a56091d267e4434bb7e885ca23a7e624184;hpb=fe19569ac50a7d398e0e44a00fd22b323748de06;p=sliver-openvswitch.git diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 0c644a560..116aa86c4 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -157,6 +157,9 @@ static void ovsdb_idl_parse_lock_notify(struct ovsdb_idl *, * 'class'. (Ordinarily 'class' is compiled from an OVSDB schema automatically * by ovsdb-idlc.) * + * Passes 'retry' to jsonrpc_session_open(). See that function for + * documentation. + * * If 'monitor_everything_by_default' is true, then everything in the remote * database will be replicated by default. ovsdb_idl_omit() and * ovsdb_idl_omit_alert() may be used to selectively drop some columns from @@ -168,7 +171,7 @@ static void ovsdb_idl_parse_lock_notify(struct ovsdb_idl *, */ struct ovsdb_idl * ovsdb_idl_create(const char *remote, const struct ovsdb_idl_class *class, - bool monitor_everything_by_default) + bool monitor_everything_by_default, bool retry) { struct ovsdb_idl *idl; uint8_t default_mode; @@ -180,7 +183,7 @@ ovsdb_idl_create(const char *remote, const struct ovsdb_idl_class *class, idl = xzalloc(sizeof *idl); idl->class = class; - idl->session = jsonrpc_session_open(remote); + idl->session = jsonrpc_session_open(remote, retry); shash_init(&idl->table_by_name); idl->tables = xmalloc(class->n_tables * sizeof *idl->tables); for (i = 0; i < class->n_tables; i++) { @@ -412,6 +415,18 @@ ovsdb_idl_verify_write_only(struct ovsdb_idl *idl) { idl->verify_write_only = true; } + +bool +ovsdb_idl_is_alive(const struct ovsdb_idl *idl) +{ + return jsonrpc_session_is_alive(idl->session); +} + +int +ovsdb_idl_get_last_error(const struct ovsdb_idl *idl) +{ + return jsonrpc_session_get_last_error(idl->session); +} static unsigned char * ovsdb_idl_get_mode(struct ovsdb_idl *idl,