]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unification of VMCI host and guest kernel API (1/5)
authorVMware, Inc <>
Thu, 17 Jun 2010 22:12:29 +0000 (15:12 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 22:12:29 +0000 (15:12 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h

index e71511d36a3529d491d92fc401012fb6d4b141d5..b9188a7adbcecd45b3d97e8df8e8b63781418f67 100644 (file)
@@ -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)
 #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