]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
hostinfoPosix: remove NOT_IMPLEMENTED() when NO_IOPL
authorJohn Wolfe <jwolfe@vmware.com>
Tue, 21 Jul 2020 18:53:00 +0000 (11:53 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Tue, 21 Jul 2020 18:53:00 +0000 (11:53 -0700)
When running "vmtoolsd -b pidfile" on Linux arm64, we hit this error:

   [error] [vmsvc] NOT_IMPLEMENTED hostinfoPosix.c:2526

Linux arm64 does not implement iopl() and the Hostinfo_ResetProcessState()
is raising a NOT_IMPLEMENTED() because of that.  However if there's no iopl(),
there is no reason to drop IO privileges, so we can just skip that code.

This change also restores usage of getloadavg() for non Android arm64
platforms: ESX vmx and tools for Linux arm64.

open-vm-tools/lib/misc/hostinfoPosix.c

index fbccdf39c50c8d05e567a6c2e20405e1152cf117..700bf3d9ec19f664b5156e33e1d9365109753861 100644 (file)
@@ -245,12 +245,18 @@ DetailedDataField detailedDataFields[] = {
 
 #if defined __ANDROID__ || defined __aarch64__
 /*
- * Android doesn't support getloadavg() or iopl().
+ * Android and arm64 do not support iopl().
  */
-#define NO_GETLOADAVG
 #define NO_IOPL
 #endif
 
+#if defined __ANDROID__
+/*
+ * Android doesn't support getloadavg().
+ */
+#define NO_GETLOADAVG
+#endif
+
 
 /*
  *----------------------------------------------------------------------
@@ -2526,6 +2532,7 @@ Hostinfo_ResetProcessState(const int *keepFds, // IN:
    }
 
 #ifdef __linux__
+#ifndef NO_IOPL
    /*
     * Drop iopl to its default value.
     * iopl() is not implemented in userworlds
@@ -2539,16 +2546,12 @@ Hostinfo_ResetProcessState(const int *keepFds, // IN:
          privileges --hpreg */
       ASSERT(euid != 0 || getuid() == 0);
       Id_SetEUid(0);
-#if defined NO_IOPL
-      NOT_IMPLEMENTED();
-      errno = ENOSYS;
-#else
       err = iopl(0);
-#endif
       Id_SetEUid(euid);
       VERIFY(err == 0);
    }
 #endif
+#endif
 }