From: VMware, Inc <> Date: Thu, 17 Jun 2010 22:12:29 +0000 (-0700) Subject: Unification of VMCI host and guest kernel API (1/5) X-Git-Tag: 2010.06.16-268169~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=782f6091e354cc62d659bcad263f73aea39a5d87;p=thirdparty%2Fopen-vm-tools.git Unification of VMCI host and guest kernel API (1/5) The VMCI kernel API should be the same for both host and guest. Currently, that is not the case. The unification will consist of the following five changes - this change is step 1: 1) Make the functions available by the host kernel API a superset of the functions supported by the guest kernel API. This consists of adding VMCI_DeviceGet, VMCI_DeviceRelease, VMCI_GetContextID, VMCI_Version and VMCI_DsLookup. 2) Make the functions available by the guest kernel API the same as the functions available by the host kernel API. This means adding VMCI_ContextID2HostVmID and defining doorbell API on all platforms. These functions return VMCI_ERROR_UNAVAILABLE either because they don't make sense (the first one or because they aren't implemented yet). The unified header file will make clear what is supported where. 3) Integrate vmciHostKernelAPI.h to vmciKernelAPI.h. 4) Edit vmciKernelAPI.h to not refer to vmciHostKernelAPI.h and integrate the VMCIQPair.h definitions into the header file. 5) Delete old vmci*KernelAPI.h and VMCIQPair.h files, and make all host and guest references to a kernel API header file refer to the new unified header file. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h b/open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h index e71511d36..b9188a7ad 100644 --- a/open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h +++ b/open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h @@ -34,9 +34,6 @@ #include "includeCheck.h" -/* VMCI host kernel API version number. */ -#define VMCI_HOST_KERNEL_API_VERSION 1 - /* Macros to operate on the driver version number. */ #define VMCI_MAJOR_VERSION(v) (((v) >> 16) & 0xffff) #define VMCI_MINOR_VERSION(v) ((v) & 0xffff) @@ -44,24 +41,14 @@ #include "vmci_defs.h" #include "vmci_call_defs.h" -#include "vmciQueue.h" - /* PUBLIC: VMCI Device Usage API. */ -#if defined(_WIN32) Bool VMCI_DeviceGet(void); void VMCI_DeviceRelease(void); -#else // _WIN32 -# define VMCI_DeviceGet() TRUE -# define VMCI_DeviceRelease() -#endif // _WIN32 /* PUBLIC: VMCI Datagram API. */ -int VMCIHost_DatagramCreateHnd(VMCIId resourceID, uint32 flags, - VMCIDatagramRecvCB recvCB, void *clientData, - VMCIHandle *outHandle); int VMCIDatagram_CreateHnd(VMCIId resourceID, uint32 flags, VMCIDatagramRecvCB recvCB, void *clientData, VMCIHandle *outHandle); @@ -74,12 +61,12 @@ int VMCIDatagram_Send(VMCIDatagram *msg); /* VMCI Utility API. */ -#if defined(VMKERNEL) +VMCIId VMCI_GetContextID(void); +uint32 VMCI_Version(void); int VMCI_ContextID2HostVmID(VMCIId contextID, void *hostVmID, size_t hostVmIDLen); -#endif -/* VMCI Event API */ +/* VMCI Event API. */ typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed, void *clientData); @@ -92,6 +79,10 @@ int VMCIEvent_Unsubscribe(VMCIId subID); VMCIPrivilegeFlags VMCIContext_GetPrivFlags(VMCIId contextID); +/* VMCI Discovery Service API. */ + +int VMCIDs_Lookup(const char *name, VMCIHandle *out); + /* VMCI Doorbell API. */ #define VMCI_FLAG_DELAYED_CB 0x01