VirtualBox

Ignore:
Timestamp:
Nov 16, 2013 6:42:31 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90686
Message:

Introduce option "--need-main(-M) on|off" in network services to emphosize whether network service need to establish connection with Main (by default this optiois off).

Location:
trunk/src/VBox/NetworkServices/NetLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp

    r49492 r49516  
    8686    { "--netmask",        'm',   RTGETOPT_REQ_IPV4ADDR },
    8787    { "--verbose",        'v',   RTGETOPT_REQ_NOTHING },
     88    { "--need-main",      'M',   RTGETOPT_REQ_BOOL },
    8889};
    8990
     
    102103    m_Name                  = "VBoxNetNAT";
    103104    m_Network               = "intnet";
     105    m_fNeedMain             = false;
    104106
    105107    for(unsigned int i = 0; i < RT_ELEMENTS(g_aGetOptDef); ++i)
    106108        m_vecOptionDefs.push_back(&g_aGetOptDef[i]);
    107 
    108     HRESULT hrc = virtualbox.createLocalObject(CLSID_VirtualBox);
    109     if (FAILED(hrc))
    110         RTMsgError("Failed to create the VirtualBox object!");
    111109}
    112110
     
    140138int VBoxNetBaseService::init()
    141139{
     140    if (m_fNeedMain)
     141    {
     142        HRESULT hrc = com::Initialize();
     143        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
     144
     145        hrc = virtualbox.createLocalObject(CLSID_VirtualBox);
     146        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
     147    }
     148
    142149    return VINF_SUCCESS;
    143150}
     
    223230                return 1;
    224231
     232            case 'M': // --need-main
     233                m_fNeedMain = true;
     234                break;
     235
    225236            case 'h': // --help (missed)
    226237                RTPrintf("%s Version %sr%u\n"
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.h

    r47019 r49516  
    8383    PINTNETBUF          m_pIfBuf;       /**< Interface buffer. */
    8484    std::vector<PRTGETOPTDEF> m_vecOptionDefs;
     85    bool                m_fNeedMain;
    8586    /** @} */
    8687    /** @name Debug stuff
Note: See TracChangeset for help on using the changeset viewer.

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