From: Oliver Kurth Date: Fri, 6 Jul 2018 22:02:36 +0000 (-0700) Subject: Add SnowMotion-specific SuperFGets logging X-Git-Tag: stable-11.0.0~535 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26a7bbaa1dfad5411b804829988cdf0ce4127b49;p=thirdparty%2Fopen-vm-tools.git Add SnowMotion-specific SuperFGets logging Prior logging suggests vmx-side corruption prior to VM powerOn, so add logging closer to the source to try to isolate the cause. This includes a toggle that will be triggered in main and unset on VM powerOn. --- diff --git a/open-vm-tools/lib/include/vmstdio.h b/open-vm-tools/lib/include/vmstdio.h index 944ddebb7..84131e87b 100644 --- a/open-vm-tools/lib/include/vmstdio.h +++ b/open-vm-tools/lib/include/vmstdio.h @@ -37,6 +37,8 @@ typedef enum { StdIO_Success, } StdIO_Status; +void +StdIO_ToggleSnowMotionLogging(Bool setting); StdIO_Status StdIO_ReadNextLine(FILE *stream, // IN diff --git a/open-vm-tools/lib/misc/vmstdio.c b/open-vm-tools/lib/misc/vmstdio.c index 5a04d7397..86af54771 100644 --- a/open-vm-tools/lib/misc/vmstdio.c +++ b/open-vm-tools/lib/misc/vmstdio.c @@ -30,6 +30,36 @@ #include "vmware.h" #include "dynbuf.h" #include "vmstdio.h" +#include "posixInt.h" + + +static Bool SnowMotionLogging; + +/* + *----------------------------------------------------------------------------- + * + * StdIO_ToggleSnowMotionLogging -- + * + * SnowMotion-specific log toggling - as per PR#2121674 and 2108730, vmx + * corruption appears to occur at some arbitrary point prior to VM powerOn, + * but only in CAT - it has not been reproducible locally or via manually + * triggered Nimbus testruns. + * + * To try to isolate the corruption point, add a toggled logging mechanism + * that will dump the results of SuperFGets for the interval between + * main initializing and VM powerOn. + * + * This is a strictly temporary mechanism to provide the necessary logging + * to debug this issue. + * + *----------------------------------------------------------------------------- + */ + +void +StdIO_ToggleSnowMotionLogging(Bool setting) // IN: +{ + SnowMotionLogging = setting; +} /* @@ -135,6 +165,10 @@ SuperFgets(FILE *stream, // IN: *count = size; + if (SnowMotionLogging) { + Log("%s: Parsed line %s", __FUNCTION__, buf); + } + return buf; }