X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-server.c;h=8d44d84857ca866ec8a736b6d0e956dd99ea338a;hb=48cad9dc53a7c63eadf1b480a5a9412d76666c21;hp=79fc8f933ca57e8f12773eb5135c2e8c6cc8d4ed;hpb=a02f82862e2d6794d090284806fb79b5a77c20ae;p=openvswitch diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 79fc8f93..8d44d848 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -171,7 +171,7 @@ main(int argc, char *argv[]) } ovsdb_jsonrpc_server_destroy(jsonrpc); ovsdb_destroy(db); - shash_destroy(&remotes); + shash_destroy_free_data(&remotes); unixctl_server_destroy(unixctl); if (run_process && process_exited(run_process)) { @@ -469,7 +469,7 @@ update_remote_row(const struct ovsdb_row *row, struct ovsdb_txn *txn, struct ovsdb_row *rw_row; const char *target; const struct ovsdb_jsonrpc_remote_status *status; - char *keys[3], *values[3]; + char *keys[4], *values[4]; size_t n = 0; /* Get the "target" (protocol/host/port) spec. */ @@ -495,8 +495,14 @@ update_remote_row(const struct ovsdb_row *row, struct ovsdb_txn *txn, keys[n] = xstrdup("state"); values[n++] = xstrdup(status->state); - keys[n] = xstrdup("time_in_state"); - values[n++] = xasprintf("%u", status->state_elapsed); + if (status->sec_since_connect != UINT_MAX) { + keys[n] = xstrdup("sec_since_connect"); + values[n++] = xasprintf("%u", status->sec_since_connect); + } + if (status->sec_since_disconnect != UINT_MAX) { + keys[n] = xstrdup("sec_since_disconnect"); + values[n++] = xasprintf("%u", status->sec_since_disconnect); + } if (status->last_error) { keys[n] = xstrdup("last_error"); values[n++] = @@ -593,7 +599,7 @@ reconfigure_from_db(struct ovsdb_jsonrpc_server *jsonrpc, } } ovsdb_jsonrpc_server_set_remotes(jsonrpc, &resolved_remotes); - shash_destroy(&resolved_remotes); + shash_destroy_free_data(&resolved_remotes); #if HAVE_OPENSSL /* Configure SSL. */