return err;
} // VixMsg_ParseGenericRequestMsg
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VixMsg_MallocClientData --
+ *
+ * Allocates the memory needed to copy from a client-provided buffer.
+ *
+ * Results:
+ * Pointer to allocated memory
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void *
+VixMsg_MallocClientData(size_t size) // IN
+{
+ return malloc(size);
+} // VixMsg_MallocClientData
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VixMsg_ReallocClientData --
+ *
+ * Reallocates the memory needed to copy from a client-provided buffer.
+ *
+ * Results:
+ * Pointer to allocated memory
+ *
+ * Side effects:
+ * Frees memory pointed to by ptr.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void *
+VixMsg_ReallocClientData(void *ptr, // IN
+ size_t size) // IN
+{
+ return realloc(ptr, size);
+} // VixMsg_ReallocClientData
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VixMsg_StrdupClientData --
+ *
+ * Allocates memory and copies client-provided string.
+ *
+ * Results:
+ * Pointer to allocated string
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+char *
+VixMsg_StrdupClientData(const char *s, // IN
+ Bool *allocateFailed) // OUT
+{
+ char* newString = NULL;
+
+ ASSERT(allocateFailed);
+ if (NULL == allocateFailed) {
+ goto abort;
+ }
+
+ *allocateFailed = FALSE;
+
+ if (NULL != s) {
+#if defined(_WIN32)
+ newString = _strdup(s);
+#else
+ newString = strdup(s);
+#endif
+ if (NULL == newString) {
+ *allocateFailed = TRUE;
+ }
+ }
+
+abort:
+ return newString;
+} // VixMsg_StrdupClientData
#include "vm_version.h"
#include "util.h"
#include "str.h"
+#include "vixCommands.h"
#include "vixOpenSource.h"
size_t propertyValueLengthSize;
size_t headerSize;
VixPropertyType *propertyTypePtr;
+ Bool allocateFailed;
if ((NULL == propList)
|| (NULL == buffer)) {
goto abort;
}
free(property->value.strValue);
- property->value.strValue = Util_SafeStrdup(strPtr);
+
+ property->value.strValue =
+ VixMsg_StrdupClientData(strPtr, &allocateFailed);
+ if (allocateFailed) {
+ err = VIX_E_OUT_OF_MEMORY;
+ goto abort;
+ }
break;
////////////////////////////////////////////////////////
* pretty easy to handle.
*/
free(property->value.blobValue.blobContents);
- property->value.blobValue.blobContents = malloc(*lengthPtr);
+ property->value.blobValue.blobContents =
+ VixMsg_MallocClientData(*lengthPtr);
if (NULL == property->value.blobValue.blobContents) {
err = VIX_E_OUT_OF_MEMORY;
goto abort;
int *options,
VixPropertyListImpl *propertyList);
+void *VixMsg_MallocClientData(size_t size);
+void *VixMsg_ReallocClientData(void *ptr, size_t size);
+char *VixMsg_StrdupClientData(const char *s, Bool *allocateFailed);
+
#endif // VIX_HIDE_FROM_JAVA
#define VMCI_DEV_QUIESCE 0x03
#define VMCI_DEV_UNQUIESCE 0x04
#define VMCI_DEV_QP_BREAK_SHARING 0x05 // DEPRECATED
+#define VMCI_DEV_RESTORE_SYNC 0x06
/*
typedef struct VMCIHost {
#if defined(VMKERNEL)
- World_ID vmmWorldID;
+ World_ID vmmWorldID[2]; /*
+ * First one is the active one and the second
+ * one is shadow world during FSR.
+ */
#elif defined(linux)
wait_queue_head_t waitQueue;
#elif defined(__APPLE__)
Bool useBH);
#ifdef VMKERNEL
int VMCIHost_ContextToHostVmID(VMCIHost *hostContext, VMCIHostVmID *hostVmID);
+void VMCIHost_SetActiveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
+Bool VMCIHost_RemoveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
+Bool VMCIHost_IsActiveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
+uint32 VMCIHost_NumHnds(VMCIHost *hostContext);
#endif
void *VMCI_AllocKernelMem(size_t size, int flags);
int VMCIContext_SetDomainName(VMCIContext *context, const char *domainName);
int VMCIContext_GetDomainName(VMCIId contextID, char *domainName,
size_t domainNameBufSize);
+void VMCIContext_SetFSRState(VMCIContext *context,
+ Bool isQuiesced,
+ VMCIId migrateCid,
+ uintptr_t eventHnd,
+ Bool isLocked);
+VMCIContext *VMCIContext_FindAndUpdateSrcFSR(VMCIId migrateCid,
+ uintptr_t eventHnd);
+Bool VMCIContext_IsActiveHnd(VMCIContext *context,
+ uintptr_t eventHnd);
+Bool VMCIContext_RemoveHnd(VMCIContext *context,
+ uintptr_t eventHnd,
+ uint32 *numOld,
+ uint32 *numNew);
+void VMCIContext_ClearDatagrams(VMCIContext *context);
+void VMCIContext_SetId(VMCIContext *context, VMCIId cid);
#endif
Bool VMCIContext_SupportsHostQP(VMCIContext *context);
void VMCIContext_ReleaseContext(VMCIContext *context);