Unicode dirPath = NULL;
Unicode canonPath = NULL; /* result */
+ /*
+ * The very first thing that we do is to open the VVol control node.
+ * This will fail if the VVol module is not loaded. In that case we
+ * short circuit to the failure case. This helps systems which do not
+ * use VVols, as we avoid the extra file opens (by File_IsDirectory
+ * and File_GetVMFSFSType) in those cases.
+ * Note that file opens are especially expensive on NFS.
+ * See PR 1007403.
+ */
+ ctrlfd = Posix_Open(VVOL_NAMESPACE_CONTROL_NODE, O_RDONLY);
+ if (ctrlfd < 0) {
+ goto use_same_path;
+ }
+
/*
* absVMDirName should start with /vmfs/volumes/.
*/
goto use_same_path;
}
- /*
- * The most likely reason this will fail is if the VVol control node is
- * not present which means VVol module is not loaded. We can not translate
- * the pathname in that case.
- */
- ctrlfd = Posix_Open(VVOL_NAMESPACE_CONTROL_NODE, O_RDONLY);
- if (ctrlfd < 0) {
- goto use_same_path;
- }
-
/*
* VM directory is on an NFS fileystem. It could be a regular NFS filesystem
* backed storage or an NFS config VVol. We need to check.
#define BDOOR_CMD_SET_PCI_HOLE 77 /* CPL 0 only */
#define BDOOR_CMD_GET_PCI_HOLE 78 /* CPL 0 only */
#define BDOOR_CMD_GET_PCI_BAR 79 /* CPL 0 only */
-#define BDOOR_CMD_MAX 80
+#define BDOOR_CMD_SHOULD_GENERATE_SYSTEMID 80 /* CPL 0 only */
+#define BDOOR_CMD_MAX 81
/*
int CodeSet_LengthInCodePoints(const char *utf8);
+int CodeSet_CodePointOffsetToByteOffset(const char *utf8,
+ int codePointOffset);
+
int CodeSet_GetUtf8(const char *string,
const char *end,
uint32 *uchar);
* put a NUL terminator.
*
* Results:
- *
+ *
* Returns the offset of the byte immediately following the last
* complete UTF-8 code point in buf that is entirely within the
* range [0, offset-1]. Note that if the final UTF-8 code point
* put a NUL terminator.
*
* Results:
- *
+ *
* Returns the offset of the byte immediately following the last
* complete UTF-16 code point in buf that is entirely within the
* range [0, offset-1]. Note that if the final UTF-16 code point
#endif
#undef INCLUDE_ALLOW_VMIROM
-#if defined INCLUDE_ALLOW_MKS && \
- !(defined LOCALMKS || defined REMOTEMKS || \
- defined SERVERMKS || defined CLIENTMKS)
+#if defined INCLUDE_ALLOW_MKS && !(defined COREMKS)
#error "The surrounding include file is not allowed outside of the MKS."
#endif
#undef INCLUDE_ALLOW_MKS
LOGLEVEL_VAR(mksGLShader), \
LOGLEVEL_VAR(mksGLState), \
LOGLEVEL_VAR(mksGLWindow), \
+ LOGLEVEL_VAR(mksGLContextMux), \
LOGLEVEL_VAR(mksWinBSOD), \
LOGLEVEL_VAR(vdpPlugin), \
\
#define POLL_CS_MAIN PollClassSet_Singleton(POLL_CLASS_MAIN)
#define POLL_CS_PAUSE PollClassSet_Union(POLL_CS_MAIN, \
PollClassSet_Singleton(POLL_CLASS_PAUSE))
-#define POLL_CS_IPC PollClassSet_Union(POLL_CS_PAUSE, \
- PollClassSet_Singleton(POLL_CLASS_IPC))
-#define POLL_CS_CPT PollClassSet_Union(POLL_CS_IPC, \
+#define POLL_CS_CPT PollClassSet_Union(POLL_CS_PAUSE, \
PollClassSet_Singleton(POLL_CLASS_CPT))
+#define POLL_CS_IPC PollClassSet_Union(POLL_CS_CPT, \
+ PollClassSet_Singleton(POLL_CLASS_IPC))
#define POLL_CS_VMDB POLL_CS_PAUSE /* POLL_CLASS_VMDB is retired */
#define POLL_CS_MKS PollClassSet_Singleton(POLL_CLASS_MKS)
/*
* POLL_CS_CPT
* - Only for callbacks which can trigger intermediate Checkpoint
* transitions.
- * The ONLY such callbacks are CrossUserRPC and VMotion.
+ * The ONLY such callback is Migrate.
* POLL_CS_IPC
* - Only for callbacks which can contain Msg_(Post|Hint|Question)
* responses, and for signal handlers (why)?
- * IPC, VMDB, and Foundry can contain Msg_* responses.
+ * Vigor, VMDB, and Foundry can contain Msg_* responses.
* POLL_CS_MKS
* - Callback runs in MKS thread.
* POLL_CS_ALWAYS
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
- #define DEPRECATED(_fix) DO_ONCE( \
- Warning("%s:%d: %s is DEPRECATED; %s\n", \
- __FILE__, __LINE__, __FUNCTION__, \
- _fix))
+ #define DEPRECATED(_fix) DO_ONCE( \
+ Warning("%s:%d: %s is DEPRECATED. %s\n", \
+ __FILE__, __LINE__, __FUNCTION__, \
+ _fix))
#else
#define DEPRECATED(_fix) do {} while (0)
#endif
int
CodeSet_GetUtf8(const char *string, // IN: string
const char *end, // IN: end of string
- uint32 *uchar) // OUT: the Unicode character
+ uint32 *uchar) // OUT/OPT: the Unicode character
{
uint8 *p = (uint8 *) string;
uint8 *e;
end = p + strlen(utf8);
while (p < end) {
- uint32 utf32;
- uint32 len = CodeSet_GetUtf8(p, end, &utf32);
+ uint32 len = CodeSet_GetUtf8(p, end, NULL);
if (len == 0) {
return -1;
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * CodeSet_CodePointOffsetToByteOffset --
+ *
+ * Return the byte offset of the character at the given codepoint
+ * offset.
+ *
+ * Results:
+ * -1 on error
+ *
+ * Side effects:
+ * None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+int
+CodeSet_CodePointOffsetToByteOffset(const char *utf8, // IN
+ int codePointOffset) // IN
+{
+ const char *p;
+ const char *end;
+
+ ASSERT(utf8);
+
+ p = utf8;
+ end = p + strlen(utf8);
+
+ while (p < end && codePointOffset > 0) {
+ uint32 utf32;
+ uint32 len = CodeSet_GetUtf8(p, end, &utf32);
+
+ if (len == 0) {
+ return -1;
+ }
+
+ p += len;
+ codePointOffset--;
+ }
+
+ if (codePointOffset == 0) {
+ return p - utf8;
+ } else {
+ return -1;
+ }
+}
+
+
/*
*-----------------------------------------------------------------------------
*