void
BackdoorHbIn(Backdoor_proto_hb *myBp) // IN/OUT
{
- uint32 dummy;
+ uint64 dummy;
__asm__ __volatile__(
"pushq %%rbp" "\n\t"
Bool ret;
Bool duringRename;
- if (FileRename(oldFile, newFile) == 0) {
+ if (File_Rename(oldFile, newFile) == 0) {
duringRename = TRUE;
ret = TRUE;
Err_SetErrno(0);
return FALSE;
}
- if (FileRename(srcName, dstName) == 0) {
+ if (File_Rename(srcName, dstName) == 0) {
ret = TRUE;
} else {
struct stat statbuf;
free(baseName);
}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * File_GetFSMountInfo --
+ *
+ * Platform-independent wrapper around File_GetVMFSMountInfo
+ *
+ * Results:
+ * On failure return -1. Otherwise, return fsType, version,
+ * remoteIP, remoteMountPoint, and localMountPoint.
+ *
+ * Side effects:
+ * None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+int
+File_GetFSMountInfo(ConstUnicode pathName,
+ char **fsType,
+ uint32 *version,
+ char **remoteIP,
+ char **remoteMountPoint,
+ char **localMountPoint)
+{
+#if defined VMX86_SERVER
+ return File_GetVMFSMountInfo(pathName, fsType, version,
+ remoteIP, remoteMountPoint,
+ localMountPoint);
+#else
+ return -1;
+#endif
+}
+
+
}
+/*
+ *----------------------------------------------------------------------
+ *
+ * FileIO_CloseAndUnlink
+ *
+ * Closes and unlinks the file associated with a FileIODescriptor.
+ *
+ * Results:
+ * TRUE: An error occurred.
+ * FALSE: The file was closed and unlinked.
+ *
+ * Side effects:
+ * File is probably closed and unlinked.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Bool
+FileIO_CloseAndUnlink(FileIODescriptor *fd) // IN:
+{
+ Unicode path;
+ Bool ret;
+
+ ASSERT(fd);
+
+ path = Unicode_Duplicate(fd->fileName);
+ ret = FileIO_Close(fd) || File_Unlink(path);
+ Unicode_Free(path);
+
+ return ret;
+}
+
+
#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) || \
defined(__FreeBSD__) || defined(sun)
/*
uint32 msecMaxWaitTime,
FileData *fileData);
-int FileRenameRetry(ConstUnicode fromPath,
- ConstUnicode toPath,
- uint32 msecMaxWaitTime);
-
int FileDeletionRetry(ConstUnicode pathName,
Bool handleLink,
uint32 msecMaxWaitTime);
Unicode **ids);
#define FileAttributes(a, b) FileAttributesRetry((a), 0, (b))
-#define FileRename(a, b) FileRenameRetry((a), (b), 0)
#define FileDeletion(a, b) FileDeletionRetry((a), (b), 0)
#define FileCreateDirectory(a, b) FileCreateDirectoryRetry((a), (b), 0)
#define FileRemoveDirectory(a) FileRemoveDirectoryRetry((a), 0)
#define FileAttributesRobust(a, b) \
FileAttributesRetry((a), FILE_MAX_WAIT_TIME_MS, (b))
#define FileRenameRobust(a, b) \
- FileRenameRetry((a), (b), FILE_MAX_WAIT_TIME_MS)
+ File_RenameRetry((a), (b), FILE_MAX_WAIT_TIME_MS)
#define FileDeletionRobust(a, b) \
FileDeletionRetry((a), (b), FILE_MAX_WAIT_TIME_MS)
#define FileCreateDirectoryRobust(a, b) \
int FileAttributes(ConstUnicode pathName,
FileData *fileData);
-int FileRename(ConstUnicode fromPath,
- ConstUnicode toPath);
-
int FileDeletion(ConstUnicode pathName,
Bool handleLink);
#define FileListDirectoryRobust(a, b) File_ListDirectory((a), (b))
#define FileAttributesRobust(a, b) FileAttributes((a), (b))
-#define FileRenameRobust(a, b) FileRename((a), (b))
+#define FileRenameRobust(a, b) File_Rename((a), (b))
#define FileDeletionRobust(a, b) FileDeletion((a), (b))
#define FileCreateDirectoryRobust(a, b) FileCreateDirectory((a), (b))
#define FileRemoveDirectoryRobust(a) FileRemoveDirectory((a))
return EIO;
}
- err = FileRename(entryFilePath, memberFilePath);
+ err = File_Rename(entryFilePath, memberFilePath);
if (err != 0) {
Warning(LGPFX" %s FileRename of '%s' to '%s' failed: %s\n",
#if defined(__FreeBSD__)
# include <sys/param.h>
+# include <sys/mount.h>
#else
# if !defined(__APPLE__)
# include <sys/vfs.h>
/*
*-----------------------------------------------------------------------------
*
- * FileRename --
+ * File_Rename --
*
* Rename a file.
*
*/
int
-FileRename(ConstUnicode oldName, // IN:
- ConstUnicode newName) // IN:
+File_Rename(ConstUnicode oldName, // IN:
+ ConstUnicode newName) // IN:
{
return (Posix_Rename(oldName, newName) == -1) ? errno : 0;
}
+int
+File_RenameRetry(ConstUnicode oldFile, // IN:
+ ConstUnicode newFile, // IN:
+ uint32 msecMaxWaitTime) // IN: Unused.
+{
+ return File_Rename(oldFile, newFile);
+}
+
+
/*
*----------------------------------------------------------------------
*
}
+#endif /* !FreeBSD && !sun */
+
+
/*
*----------------------------------------------------------------------------
*
{
struct stat st1;
struct stat st2;
+#if !defined(sun) // Solaris does not have statfs
struct statfs stfs1;
struct statfs stfs2;
+#endif
ASSERT(path1);
ASSERT(path2);
return TRUE;
}
+#if !defined(sun) // Solaris does not have statfs
if (Posix_Statfs(path1, &stfs1) != 0) {
return FALSE;
}
return FALSE;
}
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__FreeBSD__)
if ((stfs1.f_flags & MNT_LOCAL) && (stfs2.f_flags & MNT_LOCAL)) {
return TRUE;
}
(stfs2.f_type != NFS_SUPER_MAGIC)) {
return TRUE;
}
+#endif
#endif
/*
}
-#endif /* !FreeBSD && !sun */
-
-
/*
*-----------------------------------------------------------------------------
*
Bool FileMacos_IsSliceDevice(char const *bsdDev);
char *FileMacos_DiskDevToUserFriendlyName(char const *bsdDiskDev);
+char *FileMacos_DiskDevToVolumeName(char const *bsdDiskDev);
char *FileMacos_DiskDeviceToUniqueID(char const *bsdPath);
char *FileMacos_UniqueIDToDiskDevice(char const *identifier);
Bool File_Replace(ConstUnicode oldFile,
ConstUnicode newFile);
+int File_Rename(ConstUnicode oldFile,
+ ConstUnicode newFile);
+
+int File_RenameRetry(ConstUnicode oldFile,
+ ConstUnicode newFile,
+ uint32 msecMaxWaitTime);
+
Bool File_Move(ConstUnicode oldFile,
ConstUnicode newFile,
Bool *asRename);
Bool noRename,
char **newFileName);
+int File_GetFSMountInfo(ConstUnicode pathName,
+ char **fsType,
+ uint32 *version,
+ char **remoteIP,
+ char **remoteMountPoint,
+ char **localMountPoint);
+
/* Get size only for regular file. */
int64 File_GetSize(ConstUnicode pathName);
Bool FileIO_Close(FileIODescriptor *file);
+Bool FileIO_CloseAndUnlink(FileIODescriptor *file);
+
uint32 FileIO_GetFlags(FileIODescriptor *file);
Bool FileIO_GetVolumeSectorSize(const char *name,
#define VMSERVER_VERSION "e.x.p"
#define WORKSTATION_VERSION_NUMBER "8.0.0" /* this version number should always match real WS version number */
#define WORKSTATION_VERSION "e.x.p"
+#define WORKSTATION_RELEASE_DESCRIPTION ""
#define WORKSTATION_ENTERPRISE_VERSION "e.x.p"
#define ACE_MANAGEMENT_SERVER_VERSION "e.x.p"
#define MUI_VERSION "4.1.0"
#define USB_ARBITRATOR_VERSION_MAJOR 9
#define USB_ARBITRATOR_VERSION_MINOR 0
-#define USB_ARBITRATOR_VERSION_Z 38
+#define USB_ARBITRATOR_VERSION_Z 44
#define USB_ARBITRATOR_VERSION_BASE USB_ARBITRATOR_VERSION_MAJOR.\
USB_ARBITRATOR_VERSION_MINOR
* USB Arbitrator Component version. This version is used by the linux
* installer. See USB_ARBITRATOR_COMPONENT_VERSION_NUMBER in mk/defs-onetime.mk
*/
-#define USB_ARBITRATOR_COMPONENT_VERSION_NUMBER "9.0.38"
+#define USB_ARBITRATOR_COMPONENT_VERSION_NUMBER "9.0.44"
#ifdef VMX86_VPX
#define VIM_API_TYPE "VirtualCenter"
#define VMCI_QUEUEPAIR_ALLOC 10
#define VMCI_QUEUEPAIR_DETACH 11
-/* VMCI reserved host datagram resource IDs */
-/* vsock control channel has resource id 1 */
-#define VMCI_DVFILTER_DATA_CHANNEL 2
-
/*
* VMCI_VSOCK_VMX_LOOKUP was assigned to 12 for Fusion 3.0/3.1,
* WS 7.0/7.1 and ESX 4.1
#define VMCI_QUEUEPAIR_ALLOC 10
#define VMCI_QUEUEPAIR_DETACH 11
-/* VMCI reserved host datagram resource IDs */
-/* vsock control channel has resource id 1 */
-#define VMCI_DVFILTER_DATA_CHANNEL 2
-
/*
* VMCI_VSOCK_VMX_LOOKUP was assigned to 12 for Fusion 3.0/3.1,
* WS 7.0/7.1 and ESX 4.1
uint8 eventPayload[sizeof(VMCIEventData_Max)];
} VMCIDelayedEventInfo;
+typedef struct VMCIEventRef {
+ VMCISubscription *sub;
+ VMCIListItem listItem;
+} VMCIEventRef;
/*
*----------------------------------------------------------------------
VMCIListItem *iter;
VMCILockFlags flags;
+ VMCIList noDelayList;
+ VMCIList_Init(&noDelayList);
+
ASSERT(eventMsg);
VMCI_GrabLock_BH(&subscriberLock, &flags);
VMCIList_Scan(iter, &subscriberArray[eventMsg->eventData.event]) {
- VMCI_EventData *ed;
VMCISubscription *cur = VMCIList_Entry(iter, VMCISubscription,
subscriberListItem);
ASSERT(cur && cur->event == eventMsg->eventData.event);
}
} else {
+ VMCIEventRef *eventRef;
+
+ /*
+ * To avoid possible lock rank voilation when holding
+ * subscriberLock, we construct a local list of
+ * subscribers and release subscriberLock before
+ * invokes the callbacks. This is similar to delayed
+ * callbacks, but callbacks is invoked right away here.
+ */
+ if ((eventRef = VMCI_AllocKernelMem(sizeof *eventRef,
+ (VMCI_MEMORY_ATOMIC |
+ VMCI_MEMORY_NONPAGED))) == NULL) {
+ err = VMCI_ERROR_NO_MEM;
+ goto out;
+ }
+
+ VMCIEventGet(cur);
+ eventRef->sub = cur;
+ VMCIList_InitEntry(&eventRef->listItem);
+ VMCIList_Insert(&eventRef->listItem, &noDelayList);
+ }
+ }
+
+out:
+ VMCI_ReleaseLock_BH(&subscriberLock, flags);
+
+ if (!VMCIList_Empty(&noDelayList)) {
+ VMCI_EventData *ed;
+ VMCIListItem *iter2;
+
+ VMCIList_ScanSafe(iter, iter2, &noDelayList) {
+ VMCIEventRef *eventRef = VMCIList_Entry(iter, VMCIEventRef,
+ listItem);
+ VMCISubscription *cur = eventRef->sub;
uint8 eventPayload[sizeof(VMCIEventData_Max)];
/* We set event data before each callback to ensure isolation. */
(size_t)eventMsg->hdr.payloadSize);
ed = (VMCI_EventData *)eventPayload;
cur->callback(cur->id, ed, cur->callbackData);
+
+ VMCI_GrabLock_BH(&subscriberLock, &flags);
+ VMCIEventRelease(cur);
+ VMCI_ReleaseLock_BH(&subscriberLock, flags);
+ VMCI_FreeKernelMem(eventRef, sizeof *eventRef);
}
}
-out:
- VMCI_ReleaseLock_BH(&subscriberLock, flags);
-
return err;
}
ETH_VMWARE_FRAME_TYPE_INVALID = 0,
ETH_VMWARE_FRAME_TYPE_BEACON = 1,
ETH_VMWARE_FRAME_TYPE_COLOR = 2,
- ETH_VMWARE_FRAME_TYPE_HEARTBEAT = 3,
+ ETH_VMWARE_FRAME_TYPE_ECHO = 3,
};
typedef