From: Oliver Kurth Date: Fri, 2 Aug 2019 18:07:21 +0000 (-0700) Subject: Changes to common source files not directly applicable to open-vm-tools. X-Git-Tag: stable-11.1.0~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c5c5d17f5b03adb0c8d7bdf8001a466959c0ba1;p=thirdparty%2Fopen-vm-tools.git Changes to common source files not directly applicable to open-vm-tools. Backout previous changes to these files. --- diff --git a/open-vm-tools/lib/include/hgfs.h b/open-vm-tools/lib/include/hgfs.h index ca97444fa..df658bb87 100644 --- a/open-vm-tools/lib/include/hgfs.h +++ b/open-vm-tools/lib/include/hgfs.h @@ -45,17 +45,12 @@ #ifndef _HGFS_H_ -#define _HGFS_H_ +# define _HGFS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #include "includeCheck.h" -#ifdef VMX86_TOOLS -# include "rpcvmx.h" -#else -# include "config.h" -#endif #include "vm_assert.h" /* Page size for HGFS packet (4K). */ @@ -70,7 +65,7 @@ * Maximum number of pages to transfer to/from the HGFS server for V3 protocol * operations that support large requests/replies, e.g. reads and writes. */ -#define HGFS_LARGE_IO_MAX_PAGES 127 +#define HGFS_LARGE_IO_MAX_PAGES 15 /* Maximum number of bytes to read or write to a hgfs server in a single packet. */ #define HGFS_IO_MAX HGFS_PAGE_SIZE @@ -92,18 +87,6 @@ */ #define HGFS_LARGE_PACKET_MAX (HGFS_LARGE_IO_MAX + HGFS_HEADER_SIZE_MAX) -/* - * Legacy definitions for HGFS_LARGE_IO_MAX_PAGES, HGFS_LARGE_IO_MAX and - * HGFS_LARGE_PACKET_MAX. They are used both in Windows client and hgFileCopy - * library for performing vmrun CopyFileFromHostToGuest/GuestToHost. - */ -#define HGFS_LEGACY_LARGE_IO_MAX_PAGES 15 -#define HGFS_LEGACY_LARGE_IO_MAX (HGFS_PAGE_SIZE * HGFS_LEGACY_LARGE_IO_MAX_PAGES) -#define HGFS_LEGACY_LARGE_PACKET_MAX (HGFS_LEGACY_LARGE_IO_MAX + HGFS_HEADER_SIZE_MAX) - -static size_t gHgfsLargeIoMax = 0; -static size_t gHgfsLargePacketMax = 0; - /* *----------------------------------------------------------------------------- * @@ -128,21 +111,9 @@ static size_t gHgfsLargePacketMax = 0; static INLINE size_t HgfsLargeIoMax(Bool useLegacy) // IN { if (useLegacy) { - return HGFS_LEGACY_LARGE_IO_MAX; + // TODO: Return the legacy value } - if (gHgfsLargeIoMax > 0) { - return gHgfsLargeIoMax; - } -#ifdef VMX86_TOOLS - if (!RpcVMX_ConfigGetBool(FALSE, "hgfs.packetSize.large")) { -#else - if (!Config_GetBool(FALSE, "hgfs.packetSize.large")) { -#endif - gHgfsLargeIoMax = HGFS_LEGACY_LARGE_IO_MAX; - } else { - gHgfsLargeIoMax = HGFS_LARGE_IO_MAX; - } - return gHgfsLargeIoMax; + return HGFS_LARGE_IO_MAX; } /* @@ -169,21 +140,9 @@ static INLINE size_t HgfsLargeIoMax(Bool useLegacy) // IN static INLINE size_t HgfsLargePacketMax(Bool useLegacy) // IN { if (useLegacy) { - return HGFS_LEGACY_LARGE_PACKET_MAX; - } - if (gHgfsLargePacketMax > 0) { - return gHgfsLargePacketMax; - } -#ifdef VMX86_TOOLS - if (!RpcVMX_ConfigGetBool(FALSE, "hgfs.packetSize.large")) { -#else - if (!Config_GetBool(FALSE, "hgfs.packetSize.large")) { -#endif - gHgfsLargePacketMax = HGFS_LEGACY_LARGE_PACKET_MAX; - } else { - gHgfsLargePacketMax = HGFS_LARGE_PACKET_MAX; + // TODO: Return the legacy value } - return gHgfsLargePacketMax; + return HGFS_LARGE_PACKET_MAX; } /* diff --git a/open-vm-tools/lib/rpcVmx/rpcvmx.c b/open-vm-tools/lib/rpcVmx/rpcvmx.c index 98642a794..c820c4832 100644 --- a/open-vm-tools/lib/rpcVmx/rpcvmx.c +++ b/open-vm-tools/lib/rpcVmx/rpcvmx.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2018,2019 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -16,20 +16,16 @@ * *********************************************************/ -#if defined(__KERNEL__) || defined(_KERNEL) || defined(KERNEL) -# include "kernelStubs.h" -#else -# include -# include -# include -# include -# include "str.h" -#endif +#include +#include +#include +#include #include "guest_msg_def.h" #include "message.h" #include "rpcout.h" #include "rpcvmx.h" +#include "str.h" typedef struct { @@ -216,15 +212,7 @@ RpcVMX_ConfigGetString(const char *defval, const char *var) * We have to dup the default, because of our contract: values we * return must always be freed by the caller. */ -#if defined(__KERNEL__) || defined(_KERNEL) || defined(KERNEL) -# ifdef __APPLE__ - value = STRDUP(defval, M_TEMP); -# else value = strdup(defval); -# endif -#else - value = strdup(defval); -#endif } } diff --git a/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h b/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h index 4c7b6a2fb..188c2576b 100644 --- a/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h +++ b/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h @@ -158,13 +158,6 @@ char *strdup(const char *source); # endif -# ifdef __APPLE__ /* if (__APPLE__) { */ -# define Str_Strcasecmp(s1, s2) strcasecmp(s1, s2) -# define M_TEMP 80 /* misc temporary data buffers */ -char *STRDUP(const char *, int); -int atoi(const char *); -#endif - /* Shared between Linux and Apple kernel stubs. */ void *malloc(size_t size); void free(void *mem); diff --git a/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h b/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h index 6baf61b78..deb56c666 100644 --- a/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h +++ b/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h @@ -117,13 +117,6 @@ char *strdup(const char *source); # endif -# ifdef __APPLE__ /* if (__APPLE__) { */ -# define Str_Strcasecmp(s1, s2) strcasecmp(s1, s2) -# define M_TEMP 80 /* misc temporary data buffers */ -char *STRDUP(const char *, int); -int atoi(const char *); -#endif - /* Shared between Linux and Apple kernel stubs. */ void *malloc(size_t size); void free(void *mem); diff --git a/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h b/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h index dc4961bf0..030b6916a 100644 --- a/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h +++ b/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h @@ -25,8 +25,8 @@ #ifndef _VMHGFS_VERSION_H_ #define _VMHGFS_VERSION_H_ -#define VMHGFS_DRIVER_VERSION 1.6.11.0 -#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,11,0 -#define VMHGFS_DRIVER_VERSION_STRING "1.6.11.0" +#define VMHGFS_DRIVER_VERSION 1.6.10.0 +#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,10,0 +#define VMHGFS_DRIVER_VERSION_STRING "1.6.10.0" #endif /* _VMHGFS_VERSION_H_ */