From: Oliver Kurth Date: Thu, 13 Feb 2020 00:49:09 +0000 (-0800) Subject: Common source file changes not directly applicable to open-vm-tools. X-Git-Tag: stable-11.1.0~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a3d12b2ea0e53227a437aafa3bb827e2ddac8e1;p=thirdparty%2Fopen-vm-tools.git Common source file changes not directly applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/hgfsServer/Makefile.am b/open-vm-tools/lib/hgfsServer/Makefile.am index 07150816a..9936a56ec 100644 --- a/open-vm-tools/lib/hgfsServer/Makefile.am +++ b/open-vm-tools/lib/hgfsServer/Makefile.am @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2007-2016 VMware, Inc. All rights reserved. +### Copyright (C) 2007-2016, 2020 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -25,6 +25,7 @@ libHgfsServer_la_SOURCES += hgfsDirNotifyStub.c libHgfsServer_la_SOURCES += hgfsServerParameters.c libHgfsServer_la_SOURCES += hgfsServerOplock.c libHgfsServer_la_SOURCES += hgfsServerOplockLinux.c +libHgfsServer_la_SOURCES += hgfsThreadpoolStub.c AM_CFLAGS = AM_CFLAGS += -DVMTOOLS_USE_GLIB diff --git a/open-vm-tools/lib/hgfsServer/hgfsThreadpool.h b/open-vm-tools/lib/hgfsServer/hgfsThreadpool.h new file mode 100644 index 000000000..a3ef53c01 --- /dev/null +++ b/open-vm-tools/lib/hgfsServer/hgfsThreadpool.h @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2020 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 + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +#ifndef _HGFS_THREADPOOL_H +#define _HGFS_THREADPOOL_H + +/* + * hgfsThreadpool.h -- + * + * Function definitions for threadpool. + */ + +#include "hgfsUtil.h" // for HgfsInternalStatus +#include "hgfsServerInt.h" // for HgfsSessionInfo + +/* + * The maximum count of thread in threadpool. + * For Windows 10 guest, the file explorer issues 8 asynchronous request + * at one time. + * Please keep this value same with the PHYSMEM_HGFS_WORKER_THREADS + */ +#define HGFS_THREADPOOL_MAX_COUNT 10 + +typedef void(*HgfsThreadpoolWorkItem)(void *data); + +HgfsInternalStatus HgfsThreadpool_Init(void); + +Bool HgfsThreadpool_Activate(void); +void HgfsThreadpool_Deactivate(void); + +void HgfsThreadpool_Exit(void); +Bool HgfsThreadpool_QueueWorkItem(HgfsThreadpoolWorkItem workItem, void *data); + +#endif // _HGFS_THREADPOOL_H diff --git a/open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c b/open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c new file mode 100644 index 000000000..90735279d --- /dev/null +++ b/open-vm-tools/lib/hgfsServer/hgfsThreadpoolStub.c @@ -0,0 +1,146 @@ +/********************************************************* + * Copyright (C) 2020 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 + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +/* + * hgfsThreadPoolStub.c -- + * + * Stubs for threadpool support, used to build guest components. + */ + +#include "vmware.h" +#include "vm_basic_types.h" +#include "util.h" + +#include "hgfsProto.h" +#include "hgfsServer.h" +#include "hgfsThreadpool.h" + +/* + *----------------------------------------------------------------------------- + * + * HgfsThreadpool_Init -- + * + * Initialization of the threadpool component. + * + * Results: + * 0 if success, error code otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +HgfsInternalStatus +HgfsThreadpool_Init(void) +{ + return HGFS_ERROR_NOT_SUPPORTED; +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsThreadpool_Activate -- + * + * Activate the threadpool. + * + * Results: + * Always return FALSE. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +HgfsThreadpool_Activate(void) +{ + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsThreadpool_Deactivate -- + * + * Deactivate the threadpool. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +HgfsThreadpool_Deactivate(void) +{ +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsThreadpool_Exit -- + * + * Exit for the threadpool component. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +HgfsThreadpool_Exit(void) +{ +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsThreadpool_QueueWorkItem -- + * + * Execute a work item. + * + * Results: + * TRUE if the work item is queued successfully, + * FALSE if the work item is not queued. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +HgfsThreadpool_QueueWorkItem(HgfsThreadpoolWorkItem workItem, // IN + void *data) // IN +{ + return FALSE; +} + diff --git a/open-vm-tools/lib/include/hgfsServer.h b/open-vm-tools/lib/include/hgfsServer.h index 4b1a5d2d7..da3510f7c 100644 --- a/open-vm-tools/lib/include/hgfsServer.h +++ b/open-vm-tools/lib/include/hgfsServer.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2019 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2020 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 @@ -125,6 +125,7 @@ typedef uint32 HgfsConfigFlags; #define HGFS_CONFIG_VOL_INFO_MIN (1 << 2) #define HGFS_CONFIG_OPLOCK_ENABLED (1 << 3) #define HGFS_CONFIG_SHARE_ALL_HOST_DRIVES_ENABLED (1 << 4) +#define HGFS_CONFIG_THREADPOOL_ENABLED (1 << 5) typedef struct HgfsServerConfig { HgfsConfigFlags flags; @@ -167,6 +168,7 @@ typedef struct HgfsServerMgrCallbacks { } HgfsServerMgrCallbacks; typedef enum { + HGFS_QUIESCE_CHANNEL_FREEZE, /*Op sent before the channel device quiesce*/ HGFS_QUIESCE_FREEZE, HGFS_QUIESCE_THAW, } HgfsQuiesceOp; diff --git a/open-vm-tools/lib/include/mutexRankLib.h b/open-vm-tools/lib/include/mutexRankLib.h index 3ce0d7165..ddf0bd1f4 100644 --- a/open-vm-tools/lib/include/mutexRankLib.h +++ b/open-vm-tools/lib/include/mutexRankLib.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2020 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 @@ -63,6 +63,8 @@ extern "C" { #define RANK_hgfsFileIOLock (RANK_libLockBase + 0x4050) #define RANK_hgfsSearchArrayLock (RANK_libLockBase + 0x4060) #define RANK_hgfsNodeArrayLock (RANK_libLockBase + 0x4070) +#define RANK_hgfsActivateLock (RANK_libLockBase + 0x4080) +#define RANK_hgfsThreadpoolLock (RANK_libLockBase + 0x4090) /* * vigor (must be < VMDB range and < disklib, see bug 741290)