]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add a header to the vmsvc log file.
authorJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:26 +0000 (11:37 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:26 +0000 (11:37 -0700)
Add a log entry at the start of the vmsvc log file that includes the tools
version, build number, and guest OS details.

open-vm-tools/libvmtools/vmtoolsLog.c
open-vm-tools/services/vmtoolsd/mainLoop.c

index 2162efd6f35529e06443d710467b0d0480db05f3..944ea0e424fb814e2d3e5553362be1d25821913b 100644 (file)
 #include "err.h"
 #include "logToHost.h"
 #include "vthreadBase.h"
+#include "hostinfo.h"
+#include "vm_tools_version.h"
+#include "buildNumber.h"
+#include "vm_product.h"
 
 #define LOGGING_GROUP         "logging"
 
@@ -1416,6 +1420,7 @@ VMToolsConfigLoggingInt(const gchar *defaultDomain,
    GPtrArray *oldDomains = NULL;
    LogHandler *oldDefault = NULL;
    GError *err = NULL;
+   char *gosDetails;
 
    g_return_if_fail(defaultDomain != NULL);
 
@@ -1489,6 +1494,17 @@ VMToolsConfigLoggingInt(const gchar *defaultDomain,
    gLogEnabled |= force;
    MarkLogInitialized();
 
+   /*
+    * Log Tools version, build information and guest OS details.
+    */
+   g_message("%s Version: %s (%s)", VMWARE_TOOLS_SHORT_NAME,
+             TOOLS_VERSION_EXT_CURRENT_STR, BUILD_NUMBER);
+   gosDetails = Hostinfo_GetOSDetailedData();
+   if (gosDetails != NULL) {
+      g_message("Guest OS details: %s", gosDetails);
+      free(gosDetails);
+   }
+
    gMaxCacheEntries = g_key_file_get_integer(cfg, LOGGING_GROUP,
                                              "maxCacheEntries", &err);
    if (err != NULL || gMaxCacheEntries < 0) {
index 119f974d6f7fb64d744a22ce293c5e87d808004c..e16e6e43b27b9d5890b9f499757546655c35becf 100644 (file)
@@ -1182,11 +1182,6 @@ ToolsCore_Setup(ToolsServiceState *state)
    GMainContext *gctx;
    ToolsServiceProperty ctxProp = { TOOLS_CORE_PROP_CTX };
 
-   /*
-    * Useful for debugging purposes. Log the vesion and build information.
-    */
-   g_message("Tools Version: %s (%s)\n", TOOLS_VERSION_EXT_CURRENT_STR, BUILD_NUMBER);
-
    /* Initializes the app context. */
    gctx = g_main_context_default();
    state->ctx.version = TOOLS_CORE_API_V1;