From: John Wolfe Date: Wed, 30 Jun 2021 18:37:26 +0000 (-0700) Subject: Add a header to the vmsvc log file. X-Git-Tag: stable-12.0.0~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3ad5e62cb9892e28486839aba19116aaadd76ef;p=thirdparty%2Fopen-vm-tools.git Add a header to the vmsvc log file. Add a log entry at the start of the vmsvc log file that includes the tools version, build number, and guest OS details. --- diff --git a/open-vm-tools/libvmtools/vmtoolsLog.c b/open-vm-tools/libvmtools/vmtoolsLog.c index 2162efd6f..944ea0e42 100644 --- a/open-vm-tools/libvmtools/vmtoolsLog.c +++ b/open-vm-tools/libvmtools/vmtoolsLog.c @@ -59,6 +59,10 @@ #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) { diff --git a/open-vm-tools/services/vmtoolsd/mainLoop.c b/open-vm-tools/services/vmtoolsd/mainLoop.c index 119f974d6..e16e6e43b 100644 --- a/open-vm-tools/services/vmtoolsd/mainLoop.c +++ b/open-vm-tools/services/vmtoolsd/mainLoop.c @@ -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;