/*********************************************************
- * Copyright (C) 2021-2022 VMware, Inc. All rights reserved.
+ * Copyright (C) 2021-2023 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
typedef struct ComponentAction {
const char *componentName; /* The name of the enabled
- component. */
+ * component.
+ */
const char *scriptName; /* The default script to be invoked
- to take actions for a particular
- component */
+ * to take actions for a particular
+ * component
+ */
const char *addActionArguments; /* Default arguments to the script
- to execute present action towards
- the component in the guest OS. */
+ * to execute present action towards
+ * the component in the guest OS.
+ */
const char *removeActionArguments; /* Default arguments to the script
- to execute absent action towards
- the component in the guest OS. */
+ * to execute absent action towards
+ * the component in the guest OS.
+ */
const char *checkStatusActionArguments; /* Default arguments to the script
- to execute checkstatus towards
- the component in the guest OS. */
+ * to execute checkstatus towards
+ * the component in the guest OS.
+ */
const char* mandatoryParameters; /* Arguments that are mandatory to
- be passed to script. */
+ * be passed to script.
+ */
const char *componentDirectory; /* The name of directory in which
- scripts will be installed.*/
+ * scripts will be installed.
+ */
char* (*customizeRemoveAction)(); /* A custom callback function
- to customize arguments for
- absent action on the component
- script. */
+ * to customize arguments for
+ * absent action on the component
+ * script.
+ */
char* (*customizeAddAction)(); /* A custom callback function
- to customize arguments for
- present action on the component
- script. */
+ * to customize arguments for
+ * present action on the component
+ * script.
+ */
} ComponentAction;
* component.
*
* @param[in] asyncProcInfo An asyncProcInfo object of the currently running
- async process.
+ * async process.
* @param[in] componentIndex Index of the component in the global array of
* components.
*
* <path to component script> <args to component script>
*
* The linux counterpart is constructed as:
- * <path to component script> <argumnets to the script>
+ * <path to component script> <arguments to the script>
*
* @param[in] scriptName Name of the component script.
* @param[in] defaultArguments Default arguments to the component script.
* @param[in] mandatoryParams mandatory params to the component script.
* @param[in] customizeAction A callback function to customize the arguments
- for the component script.
+ * for the component script.
*
* @return
* A commandline to be directly run as an async process.
size_t replylen;
gchar *msg;
- /*
+ /*
* Proceed only if the component script is installed and
* the component is enabled by the plugin.
*/
#define COMPONENTMGR_ASYNC_CHECK_STATUS_TERMINATE_PERIOD 15
/*
- * Poll interval for waiting on the async process runnning the action for a
+ * Poll interval for waiting on the async process running the action for a
* component in seconds.
*/
#define COMPONENTMGR_ASYNCPROCESS_POLL_INTERVAL 5
/*
- * The wait period after which the async proces needs to be killed for a
+ * The wait period after which the async process needs to be killed for a
* component in seconds.
*/
#define COMPONENTMGR_ASYNCPROCESS_TERMINATE_PERIOD 600
/*
* The amount of times the check status operation needs to wait before any
- * change in the guetsVar to trigger another checkstatus opeartion.
+ * change in the guetsVar to trigger another checkstatus operation.
*/
#define COMPONENTMGR_CHECK_STATUS_COUNT_DOWN 10
#define COMPONENTMGR_ALLCOMPONENTS "all"
/*
- * The included param in the tools.conf contains comma seperated list
+ * The included param in the tools.conf contains comma separated list
* of components and can have special values.
* Defines various special values present in the included tools.conf param.
*/
{
INSTALLED = 100, /* The component is installed on the guest OS. */
INSTALLING, /* The component is being installed on the guest
- OS. */
+ * OS.
+ */
NOTINSTALLED, /* The component is not installed on the guest OS.
*/
INSTALLFAILED, /* The component install failed on the guest OS. */
*/
REMOVEFAILED, /* The component remove failed on the guest OS. */
UNMANAGED, /* The component is installed on the guest OS, but
- is not managed (or manageable), through the
- component manager plugin. */
+ * is not managed (or manageable), through the
+ * component manager plugin.
+ */
SCRIPTFAILED = 126, /* The component script failed for some reason. */
SCRIPTTERMINATED = 130 /* The component script terminated for some reason.
*/
PRESENT, /* The action adds/installs the components on the guest. */
ABSENT, /* The action removes/uninstalls the components on the guest.*/
CHECKSTATUS, /* The action calls the preconfigured script to check the
- current status of the component. */
+ * current status of the component.
+ */
INVALIDACTION /* Action not recognised by the plugin. */
} Action;
typedef struct AsyncProcessInfo {
ProcMgr_AsyncProc *asyncProc; /* ProcMgr_AsyncProc structure consisting of
- the process data running an action on the
- component. */
+ * the process data running an action on the
+ * component.
+ */
ToolsAppCtx *ctx; /* Tools application context. */
int backoffTimer; /* Backoff timer to wait until timeout
- to kill the asynchronous process. */
+ * to kill the asynchronous process.
+ */
int componentIndex; /* The index of the component in the global
- array of components. */
+ * array of components.
+ */
void (*callbackFunction)(int componentIndex); /* A callback function to
- sequence a new operation
+ * sequence a new operation
*/
} AsyncProcessInfo;
gboolean isEnabled; /* Component enabled/disabled by the plugin. */
InstallStatus status; /* Contains current status of the component. */
GSource *sourceTimer; /* A GSource timer for async process monitoring running
- an operation for a component. */
+ * an operation for a component.
+ */
AsyncProcessInfo *procInfo; /* A structure to store information about the
* current running async process for a component.
*/
int statuscount; /* A counter value to store max number of times to
- wait before starting another checkstatus operation
+ * wait before starting another checkstatus operation
*/
Action action; /* Contains information about the action to be
- performed on a component. */
+ * performed on a component.
+ */
} ComponentInfo;