VirtualBox

Changeset 51564 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 6, 2014 8:34:30 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94222
Message:

Additions/common/VBoxService: revert r94117.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r51503 r51564  
    490490        if (!g_aServices[j].fPreInited)
    491491        {
    492             if (g_aServices[j].pDesc->pfnPreInit != NULL)
    493             {
    494                 int rc = g_aServices[j].pDesc->pfnPreInit();
    495                 if (RT_FAILURE(rc))
    496                     return VBoxServiceError("Service '%s' failed pre-init: %Rrc\n",
    497                                             g_aServices[j].pDesc->pszName, rc);
    498             }
     492            int rc = g_aServices[j].pDesc->pfnPreInit();
     493            if (RT_FAILURE(rc))
     494                return VBoxServiceError("Service '%s' failed pre-init: %Rrc\n", g_aServices[j].pDesc->pszName, rc);
    499495            g_aServices[j].fPreInited = true;
    500496        }
     
    560556    VBoxServiceVerbose(2, "Initializing services ...\n");
    561557    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    562         if (g_aServices[j].fEnabled && g_aServices[j].pDesc->pfnInit != NULL)
     558        if (g_aServices[j].fEnabled)
    563559        {
    564560            rc = g_aServices[j].pDesc->pfnInit();
     
    605601         * to exit the loop before we skipped the fShutdown check
    606602         * below the service will fail to start! */
    607         /** @todo This presumably means either a one-shot service or that
    608          * something has gone wrong.  In the second case treating it as failure
    609          * to start is probably right, so we need a way to signal the first. */
    610603        RTThreadUserWait(g_aServices[j].Thread, 60 * 1000);
    611604        if (g_aServices[j].fShutdown)
     
    647640     */
    648641    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    649         if (g_aServices[j].fStarted && g_aServices[j].pDesc->pfnStop != NULL)
     642        if (g_aServices[j].fStarted)
    650643        {
    651644            VBoxServiceVerbose(3, "Calling stop function for service '%s' ...\n", g_aServices[j].pDesc->pszName);
     
    663656        if (!g_aServices[j].fEnabled) /* Only stop services which were started before. */
    664657            continue;
    665         if (   g_aServices[j].Thread != NIL_RTTHREAD
    666             && g_aServices[j].pDesc->pfnStop != NULL)
     658        if (g_aServices[j].Thread != NIL_RTTHREAD)
    667659        {
    668660            VBoxServiceVerbose(2, "Waiting for service '%s' to stop ...\n", g_aServices[j].pDesc->pszName);
     
    684676            }
    685677        }
    686         if (g_aServices[j].pDesc->pfnTerm != NULL)
    687         {
    688             VBoxServiceVerbose(3, "Terminating service '%s' (%d) ...\n",
    689                                g_aServices[j].pDesc->pszName, j);
    690             g_aServices[j].pDesc->pfnTerm();
    691         }
     678        VBoxServiceVerbose(3, "Terminating service '%s' (%d) ...\n", g_aServices[j].pDesc->pszName, j);
     679        g_aServices[j].pDesc->pfnTerm();
    692680    }
    693681
     
    918906                    for (unsigned j = 0; !fFound && j < RT_ELEMENTS(g_aServices); j++)
    919907                    {
    920                         if (g_aServices[j].pDesc->pfnOption == NULL)
    921                             continue;
    922908                        rc = g_aServices[j].pDesc->pfnOption(NULL, argc, argv, &i);
    923909                        fFound = rc == VINF_SUCCESS;
     
    991977                    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    992978                    {
    993                         if (g_aServices[j].pDesc->pfnOption == NULL)
    994                             continue;
    995979                        rc = g_aServices[j].pDesc->pfnOption(&psz, argc, argv, &i);
    996980                        fFound = rc == VINF_SUCCESS;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp

    r51503 r51564  
    6868/** The Shared Folders service client ID. */
    6969static uint32_t         g_SharedFoldersSvcClientID = 0;
     70
     71/** @copydoc VBOXSERVICE::pfnPreInit */
     72static DECLCALLBACK(int) VBoxServiceAutoMountPreInit(void)
     73{
     74    return VINF_SUCCESS;
     75}
     76
     77
     78/** @copydoc VBOXSERVICE::pfnOption */
     79static DECLCALLBACK(int) VBoxServiceAutoMountOption(const char **ppszShort, int argc, char **argv, int *pi)
     80{
     81    NOREF(ppszShort);
     82    NOREF(argc);
     83    NOREF(argv);
     84    NOREF(pi);
     85
     86    return -1;
     87}
     88
    7089
    7190/** @copydoc VBOXSERVICE::pfnInit */
     
    599618    NULL,
    600619    /* methods */
    601     /* pfnPreInit */
    602     NULL,
    603     /* pfnOption */
    604     NULL,
     620    VBoxServiceAutoMountPreInit,
     621    VBoxServiceAutoMountOption,
    605622    VBoxServiceAutoMountInit,
    606623    VBoxServiceAutoMountWorker,
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp

    r51503 r51564  
    224224
    225225    return VINF_SUCCESS;
     226}
     227
     228
     229/** @copydoc VBOXSERVICE::pfnPreInit */
     230static DECLCALLBACK(int) VBoxServiceBalloonPreInit(void)
     231{
     232    return VINF_SUCCESS;
     233}
     234
     235
     236/** @copydoc VBOXSERVICE::pfnOption */
     237static DECLCALLBACK(int) VBoxServiceBalloonOption(const char **ppszShort, int argc, char **argv, int *pi)
     238{
     239    NOREF(ppszShort);
     240    NOREF(argc);
     241    NOREF(argv);
     242    NOREF(pi);
     243
     244    return -1;
    226245}
    227246
     
    377396}
    378397
     398/** @copydoc VBOXSERVICE::pfnTerm */
     399static DECLCALLBACK(void) VBoxServiceBalloonTerm(void)
     400{
     401    VBoxServiceVerbose(3, "VBoxServiceBalloonTerm\n");
     402    return;
     403}
     404
    379405
    380406/** @copydoc VBOXSERVICE::pfnStop */
     
    399425    NULL,
    400426    /* methods */
    401     /* pfnPreInit */
    402     NULL,
    403     /* pfnOption */
    404     NULL,
     427    VBoxServiceBalloonPreInit,
     428    VBoxServiceBalloonOption,
    405429    VBoxServiceBalloonInit,
    406430    VBoxServiceBalloonWorker,
    407431    VBoxServiceBalloonStop,
    408     /* pfnTerm */
    409     NULL
     432    VBoxServiceBalloonTerm
    410433};
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp

    r51503 r51564  
    395395}
    396396#endif /* RT_OS_LINUX */
     397
     398
     399/** @copydoc VBOXSERVICE::pfnPreInit */
     400static DECLCALLBACK(int) VBoxServiceCpuHotPlugPreInit(void)
     401{
     402    return VINF_SUCCESS;
     403}
     404
     405
     406/** @copydoc VBOXSERVICE::pfnOption */
     407static DECLCALLBACK(int) VBoxServiceCpuHotPlugOption(const char **ppszShort, int argc, char **argv, int *pi)
     408{
     409    NOREF(ppszShort);
     410    NOREF(argc);
     411    NOREF(argv);
     412    NOREF(pi);
     413
     414    return -1;
     415}
     416
     417
     418/** @copydoc VBOXSERVICE::pfnInit */
     419static DECLCALLBACK(int) VBoxServiceCpuHotPlugInit(void)
     420{
     421    return VINF_SUCCESS;
     422}
    397423
    398424
     
    594620
    595621
     622/** @copydoc VBOXSERVICE::pfnTerm */
     623static DECLCALLBACK(void) VBoxServiceCpuHotPlugTerm(void)
     624{
     625    return;
     626}
     627
     628
    596629/**
    597630 * The 'timesync' service description.
     
    608641    NULL,
    609642    /* methods */
    610     /* pfnPreInit */
    611     NULL,
    612     /* pfnOption */
    613     NULL,
    614     /* pnfInit */
    615     NULL,
     643    VBoxServiceCpuHotPlugPreInit,
     644    VBoxServiceCpuHotPlugOption,
     645    VBoxServiceCpuHotPlugInit,
    616646    VBoxServiceCpuHotPlugWorker,
    617647    VBoxServiceCpuHotPlugStop,
    618     /* pfnTerm */
    619     NULL
     648    VBoxServiceCpuHotPlugTerm
    620649};
    621650
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h

    r51503 r51564  
    4646
    4747    /**
    48      * Called before parsing arguments.  Optional.
     48     * Called before parsing arguments.
    4949     * @returns VBox status code.
    5050     */
     
    5252
    5353    /**
    54      * Tries to parse the given command line option.  Optional.
     54     * Tries to parse the given command line option.
    5555     *
    5656     * @returns 0 if we parsed, -1 if it didn't and anything else means exit.
     
    6464
    6565    /**
    66      * Called before parsing arguments.  Optional.
     66     * Called before parsing arguments.
    6767     * @returns VBox status code.
    6868     */
     
    7979
    8080    /**
    81      * Stop an service.  If the service can safely be stopped at any time this
    82      * may be left NULL.
     81     * Stop an service.
    8382     */
    8483    DECLCALLBACKMEMBER(void, pfnStop)(void);
    8584
    8685    /**
    87      * Does termination cleanups.  Optional.
     86     * Does termination cleanups.
    8887     *
    8988     * @remarks This may be called even if pfnInit hasn't been called!
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp

    r51503 r51564  
    525525#endif
    526526
     527/** @copydoc VBOXSERVICE::pfnPreInit */
     528static DECLCALLBACK(int) VBoxServicePageSharingPreInit(void)
     529{
     530    return VINF_SUCCESS;
     531}
     532
     533
     534/** @copydoc VBOXSERVICE::pfnOption */
     535static DECLCALLBACK(int) VBoxServicePageSharingOption(const char **ppszShort, int argc, char **argv, int *pi)
     536{
     537    NOREF(ppszShort);
     538    NOREF(argc);
     539    NOREF(argv);
     540    NOREF(pi);
     541
     542    return -1;
     543}
     544
     545
    527546/** @copydoc VBOXSERVICE::pfnInit */
    528547static DECLCALLBACK(int) VBoxServicePageSharingInit(void)
     
    712731#endif /* RT_OS_WINDOWS */
    713732
     733/** @copydoc VBOXSERVICE::pfnTerm */
     734static DECLCALLBACK(void) VBoxServicePageSharingTerm(void)
     735{
     736    VBoxServiceVerbose(3, "VBoxServicePageSharingTerm\n");
     737}
     738
     739
    714740/** @copydoc VBOXSERVICE::pfnStop */
    715741static DECLCALLBACK(void) VBoxServicePageSharingStop(void)
     
    733759    NULL,
    734760    /* methods */
    735     /* pfnPreInit */
    736     NULL,
    737     /* pfnOption */
    738     NULL,
     761    VBoxServicePageSharingPreInit,
     762    VBoxServicePageSharingOption,
    739763    VBoxServicePageSharingInit,
    740764#ifdef RT_OS_WINDOWS
     
    744768#endif
    745769    VBoxServicePageSharingStop,
    746     /* pfnTerm */
    747     NULL
     770    VBoxServicePageSharingTerm
    748771};
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp

    r51503 r51564  
    8383/** The semaphore we're blocking on. */
    8484static RTSEMEVENTMULTI  g_VMStatEvent = NIL_RTSEMEVENTMULTI;
     85
     86
     87/** @copydoc VBOXSERVICE::pfnPreInit */
     88static DECLCALLBACK(int) VBoxServiceVMStatsPreInit(void)
     89{
     90    return VINF_SUCCESS;
     91}
     92
     93
     94/** @copydoc VBOXSERVICE::pfnOption */
     95static DECLCALLBACK(int) VBoxServiceVMStatsOption(const char **ppszShort, int argc, char **argv, int *pi)
     96{
     97    NOREF(ppszShort);
     98    NOREF(argc);
     99    NOREF(argv);
     100    NOREF(pi);
     101
     102    return -1;
     103}
    85104
    86105
     
    662681
    663682
     683/** @copydoc VBOXSERVICE::pfnTerm */
     684static DECLCALLBACK(void) VBoxServiceVMStatsTerm(void)
     685{
     686    VBoxServiceVerbose(3, "VBoxServiceVMStatsTerm\n");
     687    return;
     688}
     689
     690
    664691/** @copydoc VBOXSERVICE::pfnStop */
    665692static DECLCALLBACK(void) VBoxServiceVMStatsStop(void)
     
    683710    NULL,
    684711    /* methods */
    685     /* pfnPreInit */
    686     NULL,
    687     /* pfnOption */
    688     NULL,
     712    VBoxServiceVMStatsPreInit,
     713    VBoxServiceVMStatsOption,
    689714    VBoxServiceVMStatsInit,
    690715    VBoxServiceVMStatsWorker,
    691716    VBoxServiceVMStatsStop,
    692     /* pfnTerm */
    693     NULL
     717    VBoxServiceVMStatsTerm
    694718};
    695719
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r51523 r51564  
    155155
    156156
     157/** @copydoc VBOXSERVICE::pfnPreInit */
     158static DECLCALLBACK(int) VBoxServiceVMInfoPreInit(void)
     159{
     160    return VINF_SUCCESS;
     161}
     162
     163
    157164/** @copydoc VBOXSERVICE::pfnOption */
    158165static DECLCALLBACK(int) VBoxServiceVMInfoOption(const char **ppszShort, int argc, char **argv, int *pi)
     
    15911598    ,
    15921599    /* methods */
    1593     /* pfnPreInit */
    1594     NULL,
     1600    VBoxServiceVMInfoPreInit,
    15951601    VBoxServiceVMInfoOption,
    15961602    VBoxServiceVMInfoInit,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette