diff options
author | VMware, Inc <> | 2013-09-17 20:39:53 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-09-22 22:26:43 -0700 |
commit | 1b62c3e36a56980733f7aaacb1c6b741f5c8670d (patch) | |
tree | 27c869ec239bdc93155bacedfe54662282511260 | |
parent | a9635c0923caeef61b51afc5580b51ccb65fd7f5 (diff) |
Report correct OS name for ESXi guests
Prior to this change, vi client would say that the Guest OS was
"Other (32 bit)" whenever Tools were running in an ESXi guest.
Now, the Guest OS is reported as "VMware ESXi 5.x."
Note that Tools do not run in ESXi 4.x guests.
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
-rw-r--r-- | open-vm-tools/lib/misc/hostinfoPosix.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 0fe00339..27a903b8 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -453,7 +453,7 @@ Hostinfo_GetSystemBitness(void) } -#if !defined __APPLE__ +#if !defined __APPLE__ && !defined USERWORLD /* *----------------------------------------------------------------------------- * @@ -744,6 +744,7 @@ out: #endif +#ifndef USERWORLD /* *---------------------------------------------------------------------- * @@ -829,6 +830,7 @@ HostinfoGetCmdOutput(const char *cmd) // IN: } return out; } +#endif /* @@ -877,7 +879,15 @@ HostinfoOSData(void) Str_Sprintf(osNameFull, sizeof osNameFull, "%s %s", buf.sysname, buf.release); -#if defined __APPLE__ +#if defined USERWORLD + if (buf.release[0] <= '4') { + Str_Strcpy(osName, "vmkernel", sizeof osName); + } else { + Str_Strcpy(osName, "vmkernel5", sizeof osName); + } + Str_Snprintf(osNameFull, sizeof osNameFull, "VMware ESXi %c.x", + buf.release[0]); +#elif defined __APPLE__ { /* * The easiest way is to invoke "system_profiler" and hope that the @@ -1052,6 +1062,7 @@ HostinfoOSData(void) } #endif +#ifndef USERWORLD if (Hostinfo_GetSystemBitness() == 64) { if (strlen(osName) + sizeof STR_OS_64BIT_SUFFIX > sizeof osName) { Warning("%s: Error: buffer too small\n", __FUNCTION__); @@ -1060,6 +1071,7 @@ HostinfoOSData(void) } Str_Strcat(osName, STR_OS_64BIT_SUFFIX, sizeof osName); } +#endif /* * Before returning, truncate the \n character at the end of the full name. |