It's convenient to have the OVS version directly in the logs so one
doesn't have to go digging through ovs-bugtool output to find it.
This patch also makes the version string fit entirely on one line.

Signed-off-by: Ethan Jackson <[email protected]>
---
 lib/util.c              | 8 ++++----
 ovsdb/ovsdb-server.c    | 2 ++
 vswitchd/ovs-vswitchd.c | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/util.c b/lib/util.c
index de3cf3c..b88cca1 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -304,13 +304,13 @@ set_program_name__(const char *argv0, const char 
*version, const char *date,
     free(program_version);
 
     if (!strcmp(version, VERSION)) {
-        program_version = xasprintf("%s (Open vSwitch) "VERSION"\n"
-                                    "Compiled %s %s\n",
+        program_version = xasprintf("%s (Open vSwitch) "VERSION
+                                    " Compiled %s %s\n",
                                     program_name, date, time);
     } else {
         program_version = xasprintf("%s %s\n"
-                                    "Open vSwitch Library "VERSION"\n"
-                                    "Compiled %s %s\n",
+                                    "Open vSwitch Library "VERSION
+                                    " Compiled %s %s\n",
                                     program_name, version, date, time);
     }
 }
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 7f53e17..15b8c02 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -105,6 +105,8 @@ main(int argc, char *argv[])
 
     daemonize_start();
 
+    VLOG_INFO("%s", get_program_version());
+
     error = ovsdb_file_open(file_name, false, &db, &file);
     if (error) {
         ovs_fatal(0, "%s", ovsdb_error_to_string(error));
diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c
index 6062a40..6348b44 100644
--- a/vswitchd/ovs-vswitchd.c
+++ b/vswitchd/ovs-vswitchd.c
@@ -85,6 +85,8 @@ main(int argc, char *argv[])
 
     daemonize_start();
 
+    VLOG_INFO("%s", get_program_version());
+
     if (want_mlockall) {
 #ifdef HAVE_MLOCKALL
         if (mlockall(MCL_CURRENT | MCL_FUTURE)) {
-- 
1.7.11.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to