#endif // _WIN32
#define HGFS_PARENT_DIR_LEN 3
-#define LOGLEVEL_MODULE hgfs
-#include "loglevel_user.h"
-
/*
* Define this to enable an ASSERT on HGFS_STATUS_PROTOCOL_ERROR.
static HgfsServerMgrCallbacks *gHgfsMgrData = NULL;
+
/*
* Session usage and locking.
*
}
HgfsPlatformDestroy();
+
/*
* Reset the server manager callbacks.
*/
#include "userlock.h"
#include "hgfsServer.h" // for the server public types
+
+#ifndef VMX86_TOOLS
+
+#define LOGLEVEL_MODULE hgfsServer
+#include "loglevel_user.h"
+
+#else // VMX86_TOOLS
+
+#undef DOLOG
+#undef LOG
+
+/*
+ * Map all LOG statements to a Debug or g_debug tools log.
+ * Set the level to a default log level of 10 so that we will
+ * capture everything if tools logging is set to debug.
+ *
+ * Note, for future work would be to go through the log
+ * statements and set the levels correctly so that we can
+ * map to info, error and warnings.
+*/
+#define LGLEVEL (10)
+#define LGPFX_FMT "%s:%s:"
+#define LGPFX "hgfsServer"
+
+#if defined VMTOOLS_USE_GLIB
+#define Debug g_debug
+#define Warning g_warning
+
+#define G_LOG_DOMAIN LGPFX
+
+#include "vmware/tools/utils.h"
+#include "vmware/tools/log.h"
+
+#else // VMTOOLS_USE_GLIB
+
+#include "debug.h"
+
+#endif // VMTOOLS_USE_GLIB
+
+#define DOLOG(_min) ((_min) <= LGLEVEL)
+
+#define LOG(_level, args) \
+ do { \
+ if (DOLOG(_level)) { \
+ Debug(LGPFX_FMT, LGPFX, __FUNCTION__); \
+ Debug args; \
+ } \
+ } while (0)
+
+#endif // VNMX86_TOOLS
+
#define HGFS_DEBUG_ASYNC (0)
typedef struct HgfsTransportSessionInfo HgfsTransportSessionInfo;
# include "config.h"
#endif
-#define LOGLEVEL_MODULE hgfs
-#include "loglevel_user.h"
-
#if defined(__APPLE__)
#include <CoreServices/CoreServices.h> // for the alias manager
#include <CoreFoundation/CoreFoundation.h> // for CFString and CFURL
#include "hgfsServerInt.h"
#include "util.h"
-#define LOGLEVEL_MODULE hgfs
-#include "loglevel_user.h"
-
static void *HSPUGetBuf(HgfsServerChannelCallbacks *chanCb,
MappingType mappingType,
HgfsVmxIov *iov,
#include "vm_basic_asm.h"
#include "hgfsServerParameters.h"
-#define LOGLEVEL_MODULE hgfs
-#include "loglevel_user.h"
-
#ifdef _WIN32
#define HGFS_REQUEST_WIN32_SUPPORTED HGFS_REQUEST_SUPPORTED
#define HGFS_REQUEST_POSIX_SUPPORTED HGFS_REQUEST_NOT_SUPPORTED
#include "vmware.h"
#include "hgfsServerPolicy.h"
-#define LOGLEVEL_MODULE hgfs
-#include "loglevel_user.h"
+/*
+ * XXX: Transitioning over to the general tools logging mechanism.
+ */
+#undef LOG
+#define LOG(level, args)
typedef struct HgfsServerPolicyState {
LOGLEVEL_VAR(backdoor), \
LOGLEVEL_VAR(buslogicMdev), \
LOGLEVEL_VAR(hgfs), \
+ LOGLEVEL_VAR(hgfsServer), \
LOGLEVEL_VAR(memspace), \
LOGLEVEL_VAR(dnd), \
LOGLEVEL_VAR(appstate), \