]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Tools Hgfs Transport Logging: Migrate the to common tools conf logging
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:30 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:30 +0000 (11:23 -0700)
Migrate the tools implementations of the HGFS policy, server manager
and transport channels to use the common tools conf logging with the
"hgfsd" domain setting.

This allows the HGFS server core and the server managerand transport
components to be independently logged.

Changes are:
- Move the logging definitions into the server manager lib common header
- Add some log statements into the server manager public APIs
- Redefine the policy manager (share handling) logging to the general tools
logging.

open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c
open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c
open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuestInt.h
open-vm-tools/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c
open-vm-tools/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c

index 0b709d7f6ee16d7b72da2a10cd38c52cd15f63c8..baf2c0ae825466d7d0efc1ac1e692d3c1f19f957 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2010-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
 #include "vm_assert.h"
 #include "vm_atomic.h"
 #include "util.h"
-#if defined(VMTOOLS_USE_GLIB)
-#define G_LOG_DOMAIN "hgfsd"
-#define Debug                 g_debug
-#define Warning               g_warning
-#include "vmware/tools/guestrpc.h"
-#include "vmware/tools/utils.h"
-// #include <glib.h>
-#else
-#include "debug.h"
-#endif
 #include "hgfsChannelGuestInt.h"
 #include "hgfsServer.h"
 #include "hgfsServerManager.h"
index 601d3e9a4567bf73a846294d6cc12ba84b6776ea..a9399f51cc160bf68256c2e0e22a318ee18a9efb 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2010-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -28,7 +28,6 @@
 #include "vm_assert.h"
 #include "vm_atomic.h"
 #include "util.h"
-#include "debug.h"
 #include "hgfsChannelGuestInt.h"
 #include "hgfsServer.h"
 #include "hgfsServerManager.h"
index b47235cb93de4e9415a11dda702285d666b8483d..6bf9a8a4363c194378c229ee4c93747db3a8fb95 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
 #ifndef _HGFSCHANNELGUESTINT_H_
 #define _HGFSCHANNELGUESTINT_H_
 
+#if defined(VMTOOLS_USE_GLIB)
+#define G_LOG_DOMAIN          "hgfsd"
+#define Debug                 g_debug
+#define Warning               g_warning
+#else
+#include "debug.h"
+#endif
 #include "hgfsServer.h"
 #include "hgfsServerManager.h"
 
index 029222877403a628b43eebff794e862aebfcf5ec..033614e2d696f62376a3c4b4b1329448620d7c48 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2006,2014-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006,2014-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -66,6 +66,7 @@ Bool HgfsServerManager_ProcessPacket(HgfsServerMgrData *mgrData,  // IN: hgfs mg
                                      char *packetOut,             // OUT: rep
                                      size_t *packetOutSize)       // IN/OUT: rep buf/data size
 {
+   Debug("%s: Processing Packet for %s.\n", __FUNCTION__, mgrData->appName);
    /* Pass to the channel to handle processing and the server. */
    return HgfsChannelGuest_Receive(mgrData,
                                    packetIn,
@@ -98,6 +99,8 @@ HgfsServerManager_Register(HgfsServerMgrData *data)   // IN: RpcIn channel
    ASSERT(data);
    ASSERT(data->appName);
 
+   Debug("%s: Register %s.\n", __FUNCTION__, data->appName);
+
    /*
     * Passing NULL here is safe because the shares maintained by the guest
     * policy server never change, invalidating the need for an invalidate
@@ -141,6 +144,8 @@ HgfsServerManager_InvalidateInactiveSessions(HgfsServerMgrData *mgrData)  // IN:
 {
    ASSERT(mgrData);
 
+   Debug("%s: Invalidate Inactive Sessions for %s.\n", __FUNCTION__,
+         mgrData->appName);
    return HgfsChannelGuest_InvalidateInactiveSessions(mgrData);
 }
 
@@ -165,10 +170,11 @@ void
 HgfsServerManager_Unregister(HgfsServerMgrData *data)         // IN: RpcIn channel
 
 {
-
    ASSERT(data);
    ASSERT(data->appName != NULL);
 
+   Debug("%s: Unregister %s.\n", __FUNCTION__, data->appName);
+
    HgfsChannelGuest_Exit(data);
    HgfsServerPolicy_Cleanup();
    memset(&gHgfsServerManagerGuestData, 0, sizeof gHgfsServerManagerGuestData);
index 2fe3fdd7b064a693067a3fbe75a829b24886a549..c9ddde9074b3f47dffc8580ebee8e3c31a8bf849 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
 #   include <stdlib.h>
 #endif
 
+#undef LOG
+
+#define LGLEVEL         (10)
+#define LGPFX_FMT       "%s:%s:"
+#define LGPFX           "hgfsd"
+
+#if defined VMTOOLS_USE_GLIB
+#define G_LOG_DOMAIN          LGPFX
+#define Debug                 g_debug
+#define Warning               g_warning
+#else
+#include "debug.h"
+#endif
+
+#define DOLOG(_min)     ((_min) <= LGLEVEL)
+
+#define LOG(_level, args)                                  \
+   do {                                                    \
+      if (DOLOG(_level)) {                                 \
+         Debug(LGPFX_FMT, LGPFX, __FUNCTION__);            \
+         Debug args;                                       \
+      }                                                    \
+   } while (0)
+
+
 #include "vmware.h"
 #include "hgfsServerPolicy.h"
 
-/*
- * XXX: Transitioning over to the general tools logging mechanism.
- */
-#undef LOG
-#define LOG(level, args)
-
 
 typedef struct HgfsServerPolicyState {
    /*