-/* Copyright (c) 2009, 2010, 2011 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "jsonrpc-server.h"
#include "leak-checker.h"
#include "list.h"
+#include "memory.h"
#include "ovsdb.h"
#include "ovsdb-data.h"
#include "ovsdb-types.h"
#include "poll-loop.h"
#include "process.h"
#include "row.h"
+#include "simap.h"
#include "stream-ssl.h"
#include "stream.h"
#include "stress.h"
daemonize_complete();
+ if (!run_command) {
+ /* ovsdb-server is usually a long-running process, in which case it
+ * makes plenty of sense to log the version, but --run makes
+ * ovsdb-server more like a command-line tool, so skip it. */
+ VLOG_INFO("%s (Open vSwitch) %s", program_name, VERSION);
+ }
+
unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
unixctl_command_register("ovsdb-server/compact", "", 0, 0,
ovsdb_server_compact, file);
exiting = false;
while (!exiting) {
+ memory_run();
+ if (memory_should_report()) {
+ struct simap usage;
+
+ simap_init(&usage);
+ ovsdb_jsonrpc_server_get_memory_usage(jsonrpc, &usage);
+ ovsdb_get_memory_usage(db, &usage);
+ memory_report(&usage);
+ simap_destroy(&usage);
+ }
+
reconfigure_from_db(jsonrpc, db, &remotes);
ovsdb_jsonrpc_server_run(jsonrpc);
unixctl_server_run(unixctl);
update_remote_status(jsonrpc, &remotes, db);
}
+ memory_wait();
ovsdb_jsonrpc_server_wait(jsonrpc);
unixctl_server_wait(unixctl);
ovsdb_trigger_wait(db, time_msec());