/*********************************************************
- * Copyright (C) 2011-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2020 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
VMTools_SetupVmxGuestLog(gboolean refreshRpcChannel, GKeyFile *cfg,
const gchar *level);
+void
+VMTools_TeardownVmxGuestLog(void);
+
typedef enum {
TO_HOST,
IN_GUEST
/*********************************************************
- * Copyright (C) 2008-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2020 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
}
+/*
+ *******************************************************************************
+ * VMTools_TeardownVmxGuestLog -- */ /**
+ *
+ * Destroy the dedicated RPCI channel set up for the Vmx Guest Logging.
+ * This function is called from the tools process exit code path.
+ *
+ *******************************************************************************
+ */
+
+void
+VMTools_TeardownVmxGuestLog(void)
+{
+ /*
+ * In case VMTools_UseVmxGuestLog() is never called.
+ */
+ if (!gUseVmxGuestLog) {
+ return;
+ }
+
+ /*
+ * Acquire the same locks as VMTools_SetupVmxGuestLog.
+ */
+ VMTools_AcquireLogStateLock();
+
+ g_rec_mutex_lock(&gVmxGuestLogMutex);
+
+ DestroyRpcChannel();
+
+ g_rec_mutex_unlock(&gVmxGuestLogMutex);
+
+ VMTools_ReleaseLogStateLock();
+}
+
+
/**
* Helper function to return the matching LogHandler for a domain name
*
/*********************************************************
- * Copyright (C) 2008-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2020 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
setlocale(LC_ALL, "");
+ i = atexit(VMTools_TeardownVmxGuestLog);
+ ASSERT(i == 0);
VMTools_UseVmxGuestLog(VMTOOLS_APP_NAME);
VMTools_ConfigLogging(G_LOG_DOMAIN, NULL, TRUE, FALSE);
VMTools_SetupVmxGuestLog(FALSE, NULL, NULL);