X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-vsctl.c;h=21ac777e2407fc49a001eea467bded3ac16e102f;hb=7685b7a9e5b3f6db6832e52e111000ff36d3acb4;hp=528b40c67bf9445306d0349941b037e11223e343;hpb=428b2eddc9c47d8306252f0fc5218839d2ff017c;p=sliver-openvswitch.git diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 528b40c67..21ac777e2 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -31,6 +31,7 @@ #include "compiler.h" #include "dirs.h" #include "dynamic-string.h" +#include "fatal-signal.h" #include "hash.h" #include "json.h" #include "ovsdb-data.h" @@ -176,7 +177,7 @@ main(int argc, char *argv[]) char *args; set_program_name(argv[0]); - signal(SIGPIPE, SIG_IGN); + fatal_ignore_sigpipe(); vlog_set_levels(NULL, VLF_CONSOLE, VLL_WARN); vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_WARN); ovsrec_init(); @@ -391,6 +392,7 @@ parse_options(int argc, char *argv[], struct shash *local_options) case 'V': ovs_print_version(0, 0); + printf("DB Schema %s\n", ovsrec_get_db_version()); exit(EXIT_SUCCESS); case 't': @@ -3352,6 +3354,7 @@ set_column(const struct vsctl_table_class *table, ovsdb_datum_union(&datum, ovsdb_idl_read(row, column), &column->type, false); + ovsdb_idl_txn_verify(row, column); ovsdb_idl_txn_write(row, column, &datum); } else { struct ovsdb_datum datum; @@ -4122,6 +4125,11 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, free(commands); if (wait_for_reload && status != TXN_UNCHANGED) { + /* Even, if --retry flag was not specified, ovs-vsctl still + * has to retry to establish OVSDB connection, if wait_for_reload + * was set. Otherwise, ovs-vsctl would end up waiting forever + * until cur_cfg would be updated. */ + ovsdb_idl_enable_reconnect(idl); for (;;) { ovsdb_idl_run(idl); OVSREC_OPEN_VSWITCH_FOR_EACH (ovs, idl) {