]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Thu, 6 Apr 2023 18:27:41 +0000 (11:27 -0700)
committerKaty Feng <fkaty@vmware.com>
Thu, 6 Apr 2023 18:27:41 +0000 (11:27 -0700)
open-vm-tools/services/plugins/componentMgr/componentMgrInstallAction.c
open-vm-tools/services/plugins/componentMgr/componentMgrPlugin.h

index 7f2f52970d2aff1f9c64c1918211fbe30dacc76d..fa4f7068147e932bc8003bc7330b7fd93ade9fd9 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * 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;
 
 
@@ -214,7 +223,7 @@ ComponentMgr_IsAsyncProcessRunning(int componentIndex) // IN
  * 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.
  *
@@ -410,13 +419,13 @@ ComponentMgrCustomizeSaltAddAction()
  * <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.
@@ -1178,7 +1187,7 @@ ComponentMgr_UpdateComponentStatus(ToolsAppCtx *ctx) // IN
       size_t replylen;
       gchar *msg;
 
-     /*
+      /*
        * Proceed only if the component script is installed and
        * the component is enabled by the plugin.
        */
index b6621b069dae3e1fc516fea80b2cd43558d04133..a59757e9026b69a5896943958899b85b39c0e494 100644 (file)
 #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.
  */
@@ -190,7 +190,8 @@ typedef enum InstallStatus
 {
    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. */
@@ -198,8 +199,9 @@ typedef enum InstallStatus
                              */
    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.
                              */
@@ -216,7 +218,8 @@ typedef enum Action
    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;
 
@@ -228,15 +231,18 @@ typedef enum 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;
 
@@ -252,15 +258,17 @@ typedef struct ComponentInfo
    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;