VirtualBox

Changeset 606 in vbox for trunk


Ignore:
Timestamp:
Feb 4, 2007 7:19:30 PM (18 years ago)
Author:
vboxsync
Message:

Initial darwin port. (Not tested on linux yet.)

Location:
trunk
Files:
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r604 r606  
    14111411        /DISALLOWLIB:libcmt.lib
    14121412 TEMPLATE_VBOXMAINEXE_LIBS               = \
     1413        $(LIB_RUNTIME) \
    14131414        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
    14141415        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
     
    14291430TEMPLATE_VBOXMAINEXE_LIBS                = pthread m $(LIB_UUID) rt
    14301431 else ifeq ($(BUILD_TARGET),l4)
    1431 TEMPLATE_VBOXMAINEXE_LIBS                =
     1432TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
    14321433# no libs as yet in l4 target - must be added later
    14331434 else ifeq ($(BUILD_TARGET),os2)
    14341435TEMPLATE_VBOXMAINEXE_TOOL                = GCC3OMF
    1435 TEMPLATE_VBOXMAINEXE_LIBS                =
     1436TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
    14361437 else ifeq ($(BUILD_TARGET),darwin)
    14371438TEMPLATE_VBOXMAINEXE_TOOL                = GCC4MACHO
    1438 TEMPLATE_VBOXMAINEXE_LIBS                =
     1439TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
    14391440TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin      = -bind_at_load -framework Carbon
    14401441 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
    14411442TEMPLATE_VBOXMAINEXE_TOOL                = GCC3
    1442 TEMPLATE_VBOXMAINEXE_LIBS                =
     1443TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
    14431444 else ifeq ($(BUILD_TARGET),solaris)
    14441445$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
    14451446TEMPLATE_VBOXMAINEXE_TOOL                = GCC3PLAIN
    1446 TEMPLATE_VBOXMAINEXE_LIBS                = rt
     1447TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) rt
    14471448 else
    14481449$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r514 r606  
    214214    memset(mapNetworkLeds, 0, sizeof(mapNetworkLeds));
    215215
    216 #ifdef __LINUX__
     216#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    217217    Assert(ELEMENTS(maTapFD) == ELEMENTS(maTAPDeviceName));
    218218    Assert(ELEMENTS(maTapFD) >= SchemaDefs::NetworkAdapterCount);
     
    261261    rc = mMachine->COMGETTER(VRDPServer) (unconst (mVRDPServer).asOutParam());
    262262    AssertComRCReturn (rc, rc);
    263 #endif   
     263#endif
    264264
    265265    rc = mMachine->COMGETTER(DVDDrive) (unconst (mDVDDrive).asOutParam());
     
    295295    unconst (mConsoleVRDPServer) = new ConsoleVRDPServer (this);
    296296    AssertReturn (mConsoleVRDPServer, E_FAIL);
    297    
     297
    298298#ifdef VRDP_MC
    299299    m_cAudioRefs = 0;
     
    662662    {
    663663        console->m_cAudioRefs--;
    664        
     664
    665665        if (console->m_cAudioRefs <= 0)
    666666        {
     
    718718#ifdef VRDP_MC
    719719    console->m_cAudioRefs++;
    720        
     720
    721721    if (console->m_cAudioRefs == 1)
    722722    {
     
    27742774                break;
    27752775        }
    2776    
     2776
    27772777        if (VBOX_FAILURE (rc))
    27782778        {
     
    33193319    AutoReaderLock alock (this);
    33203320
    3321     /** @todo Use the On-Screen Display feature to report the fact. 
     3321    /** @todo Use the On-Screen Display feature to report the fact.
    33223322     *  The user should be told to install additions that are
    33233323     *  provided with the current VBox build:
     
    40584058
    40594059    AssertReturn (that && aConfig && aUuid, VERR_INVALID_PARAMETER);
    4060    
     4060
    40614061#ifdef VRDP_MC
    40624062    if (aRemote)
     
    40644064        /* @todo aRemoteBackend input parameter is not needed. */
    40654065        Assert (aRemoteBackend == NULL);
    4066        
     4066
    40674067        RemoteUSBDevice *pRemoteUSBDevice = static_cast <RemoteUSBDevice *> (aHostDevice);
    4068        
     4068
    40694069        Guid guid (*aUuid);
    40704070
    40714071        aRemoteBackend = that->consoleVRDPServer ()->USBBackendRequestPointer (pRemoteUSBDevice->clientId (), &guid);
    4072        
     4072
    40734073        if (aRemoteBackend == NULL)
    40744074        {
     
    42934293    rc = CFGMR3InsertNode(pPDM,     "Drivers", &pDrivers);                             RC_CHECK();
    42944294    rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod);                                   RC_CHECK();
    4295 #ifdef __LINUX__
     4295#ifdef VBOX_WITH_XPCOM
    42964296    // VBoxC is located in the components subdirectory
    42974297    char szPathProgram[RTPATH_MAX + sizeof("/components/VBoxC")];
     
    50045004                if (SUCCEEDED(hrc))
    50055005                {
    5006 #ifdef __LINUX__
     5006#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    50075007                    Assert (pConsole->maTapFD[ulInstance] >= 0);
    50085008                    if (pConsole->maTapFD[ulInstance] >= 0)
     
    50205020                        rc = CFGMR3InsertInteger(pCfg, "FileHandle", pConsole->maTapFD[ulInstance]); RC_CHECK();
    50215021                    }
    5022 #else /* !__LINUX__ */
     5022#elif defined(__WIN__)
    50235023                    if (fSniffer)
    50245024                    {
     
    50545054                        rc = CFGMR3InsertBytes(pCfg, "GUID", szDriverGUID, sizeof(szDriverGUID)); RC_CHECK();
    50555055                    }
    5056 #endif /* !__LINUX__ */
     5056#else
     5057# error "Port me"
     5058#endif
    50575059                }
    50585060                else
     
    51805182                break;
    51815183            }
    5182 #else /* !__WIN__ */
     5184#endif /* !__LINUX__ */
     5185#ifdef __LINUX__
    51835186            case AudioDriverType_OSSAudioDriver:
    51845187            {
     
    51935196            }
    51945197#endif
    5195 #endif /* !__WIN__ */
     5198#endif /* __LINUX__ */
    51965199        }
    51975200    }
     
    53385341            *pszCFGMValueName = '\0';
    53395342            pszCFGMValueName++;
    5340    
     5343
    53415344            /* does the node already exist? */
    53425345            pNode = CFGMR3GetChild(pRoot, pszExtraDataKey);
     
    54335436    HRESULT rc = S_OK;
    54345437
    5435 #ifdef __LINUX__
     5438#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    54365439    ULONG slot = 0;
    54375440    rc = networkAdapter->COMGETTER(Slot)(&slot);
     
    54595462    }
    54605463    else
    5461 #endif /* __LINUX */
     5464#endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */
    54625465    {
    54635466        /*
     
    55445547            }
    55455548        }
    5546 #elif
    5547 #error "Unknown host OS"
     5549#elif defined(__DARWIN__)
     5550        /** @todo Implement tap networking for Darwin. */
     5551        int rcVBox = VERR_NOT_IMPLEMENTED;
     5552#elif defined(VBOX_WITH_UNIXY_TAP_NETWORKING)
     5553# error "PORTME: Implement OS specific TAP interface open/creation."
     5554#else
     5555# error "Unknown host OS"
    55485556#endif
    55495557        /* in case of failure, cleanup. */
     
    55535561        }
    55545562    }
    5555 #ifdef __LINUX__
     5563#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    55565564    if (SUCCEEDED(rc))
    55575565    {
     
    56195627        }
    56205628    }
    5621 #endif /* __LINUX__ */
     5629#endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */
    56225630    return rc;
    56235631}
     
    56445652#endif /* DEBUG */
    56455653
    5646 #ifdef __LINUX__
     5654#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    56475655
    56485656    ULONG slot = 0;
     
    58275835             fFatal, pszErrorID, message.raw()));
    58285836
    5829     that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message)); 
     5837    that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message));
    58305838
    58315839    LogFlowFuncLeave();
  • trunk/src/VBox/Main/HostImpl.cpp

    r259 r606  
    183183    while (*p);
    184184    delete[] hostDrives;
    185 #else
     185#elif defined(__LINUX__)
    186186    // On Linux, the situation is much more complex. There is no simple API so
    187187    // we will take a more creative approach. As there is only a heuristical
     
    226226        parseMountTable((char*)"/etc/fstab", list);
    227227    }
     228#else
     229    /* PORTME */
    228230#endif
    229231
     
    270272    while (*p);
    271273    delete[] hostDrives;
    272 #else
     274#elif defined(__LINUX__)
    273275    // As with the CDROMs, on Linux we have to take a multi-level approach
    274276    // involving parsing the mount tables. As this is not bulletproof, we'll
     
    310312        }
    311313    }
     314#else
     315    /* PORTME */
    312316#endif
    313317
     
    670674    /* create the networkInterfaceHelperClient() argument */
    671675    std::auto_ptr <NetworkInterfaceHelperClientData>
    672         d (new NetworkInterfaceHelperClientData());   
     676        d (new NetworkInterfaceHelperClientData());
    673677    AssertReturn (d.get(), E_OUTOFMEMORY);
    674    
     678
    675679    d->msgCode = SVCHlpMsg::CreateHostNetworkInterface;
    676680    d->name = aName;
     
    682686        static_cast <void *> (d.get()),
    683687        progress);
    684    
     688
    685689    if (SUCCEEDED (rc))
    686690    {
     
    733737    /* create the networkInterfaceHelperClient() argument */
    734738    std::auto_ptr <NetworkInterfaceHelperClientData>
    735         d (new NetworkInterfaceHelperClientData());   
     739        d (new NetworkInterfaceHelperClientData());
    736740    AssertReturn (d.get(), E_OUTOFMEMORY);
    737    
     741
    738742    d->msgCode = SVCHlpMsg::RemoveHostNetworkInterface;
    739743    d->guid = aId;
     
    744748        static_cast <void *> (d.get()),
    745749        progress);
    746    
     750
    747751    if (SUCCEEDED (rc))
    748752    {
     
    16951699    LogFlowFunc (("Network connection name = '%s'\n", aName.raw()));
    16961700
    1697     AssertReturn (aClient, VERR_INVALID_POINTER); 
    1698     AssertReturn (!aName.isNull(), VERR_INVALID_PARAMETER); 
     1701    AssertReturn (aClient, VERR_INVALID_POINTER);
     1702    AssertReturn (!aName.isNull(), VERR_INVALID_PARAMETER);
    16991703
    17001704    int vrc = VINF_SUCCESS;
     
    17191723        /* for our purposes, 2k buffer is more
    17201724         * than enough to obtain the hardware ID
    1721          * of the VBoxTAP driver. */   
     1725         * of the VBoxTAP driver. */
    17221726        DWORD detailBuf [2048];
    1723    
     1727
    17241728        HKEY hkey = NULL;
    17251729        DWORD cbSize;
    17261730        DWORD dwValueType;
    1727    
     1731
    17281732        /* initialize the structure size */
    17291733        DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
    17301734        DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA);
    1731    
     1735
    17321736        /* copy the net class GUID */
    17331737        memcpy(&netGuid, &GUID_DEVCLASS_NET, sizeof(GUID_DEVCLASS_NET));
    1734    
     1738
    17351739        /* create an empty device info set associated with the net class GUID */
    17361740        hDeviceInfo = SetupDiCreateDeviceInfoList (&netGuid, NULL);
     
    17661770            SetErrBreak (("SetupDiBuildDriverInfoList failed (0x%08X)",
    17671771                          GetLastError()));
    1768    
     1772
    17691773        destroyList = TRUE;
    17701774
     
    17731777        {
    17741778            BOOL ret;
    1775    
     1779
    17761780            ret = SetupDiEnumDriverInfo (hDeviceInfo, &DeviceInfoData,
    17771781                                         SPDIT_CLASSDRIVER, index, &DriverInfoData);
    1778    
     1782
    17791783            /* if the function failed and GetLastError() returned
    17801784             * ERROR_NO_MORE_ITEMS, then we have reached the end of the
     
    17911795                }
    17921796            }
    1793    
     1797
    17941798            pDriverInfoDetail = (PSP_DRVINFO_DETAIL_DATA) detailBuf;
    17951799            pDriverInfoDetail->cbSize = sizeof(SP_DRVINFO_DETAIL_DATA);
    1796    
     1800
    17971801            /* if we successfully find the hardware ID and it turns out to
    17981802             * be the one for the loopback driver, then we are done. */
     
    18051809            {
    18061810                TCHAR * t;
    1807    
     1811
    18081812                /* pDriverInfoDetail->HardwareID is a MULTISZ string.  Go through the
    18091813                 * whole list and see if there is a match somewhere. */
     
    18131817                    if (!_tcsicmp(t, DRIVERHWID))
    18141818                        break;
    1815    
     1819
    18161820                    t += _tcslen(t) + 1;
    18171821                }
    1818    
     1822
    18191823                if (t && *t && t < (TCHAR *) &detailBuf [sizeof(detailBuf) / sizeof (detailBuf[0])])
    18201824                {
     
    18231827                }
    18241828            }
    1825    
     1829
    18261830            index ++;
    18271831        }
     
    18371841            SetErrBreak (("SetupDiSetSelectedDriver failed (0x%08X)",
    18381842                          GetLastError()));
    1839    
     1843
    18401844        /* register the phantom device to prepare for install */
    18411845        ok = SetupDiCallClassInstaller (DIF_REGISTERDEVICE, hDeviceInfo,
     
    18441848            SetErrBreak (("SetupDiCallClassInstaller failed (0x%08X)",
    18451849                          GetLastError()));
    1846    
     1850
    18471851        /* registered, but remove if errors occur in the following code */
    18481852        registered = TRUE;
    1849    
     1853
    18501854        /* ask the installer if we can install the device */
    18511855        ok = SetupDiCallClassInstaller (DIF_ALLOW_INSTALL, hDeviceInfo,
     
    18651869            SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLDEVICEFILES) failed (0x%08X)",
    18661870                          GetLastError()));
    1867    
     1871
    18681872        /* get the device install parameters and disable filecopy */
    18691873        DeviceInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
     
    18831887         * Register any device-specific co-installers for this device,
    18841888         */
    1885    
     1889
    18861890        ok = SetupDiCallClassInstaller (DIF_REGISTER_COINSTALLERS,
    18871891                                        hDeviceInfo,
     
    18901894            SetErrBreak (("SetupDiCallClassInstaller (DIF_REGISTER_COINSTALLERS) failed (0x%08X)",
    18911895                          GetLastError()));
    1892    
     1896
    18931897        /*
    18941898         * install any  installer-specified interfaces.
     
    19011905            SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLINTERFACES) failed (0x%08X)",
    19021906                          GetLastError()));
    1903    
     1907
    19041908        ok = SetupDiCallClassInstaller (DIF_INSTALLDEVICE,
    19051909                                        hDeviceInfo,
     
    19191923            SetErrBreak (("SetupDiOpenDevRegKey failed (0x%08X)",
    19201924                          GetLastError()));
    1921    
     1925
    19221926        cbSize = sizeof (pCfgGuidString);
    19231927        DWORD ret;
     
    19251929                               &dwValueType, (LPBYTE) pCfgGuidString, &cbSize);
    19261930        RegCloseKey (hkey);
    1927    
     1931
    19281932        ret = RenameConnection (pCfgGuidString, Bstr (aName));
    19291933        if (FAILED (ret))
     
    19331937    }
    19341938    while (0);
    1935    
     1939
    19361940    /*
    19371941     * cleanup
     
    19431947        if (ret != 0 && registered)
    19441948            SetupDiCallClassInstaller (DIF_REMOVE, hDeviceInfo, &DeviceInfoData);
    1945    
     1949
    19461950        found = SetupDiDeleteDeviceInfo (hDeviceInfo, &DeviceInfoData);
    1947    
     1951
    19481952        /* destroy the driver info list */
    19491953        if (destroyList)
     
    19791983    LogFlowFunc (("Network connection GUID = {%Vuuid}\n", aGUID.raw()));
    19801984
    1981     AssertReturn (aClient, VERR_INVALID_POINTER); 
    1982     AssertReturn (!aGUID.isEmpty(), VERR_INVALID_PARAMETER); 
     1985    AssertReturn (aClient, VERR_INVALID_POINTER);
     1986    AssertReturn (!aGUID.isEmpty(), VERR_INVALID_PARAMETER);
    19831987
    19841988    int vrc = VINF_SUCCESS;
     
    20072011                    tr ("Host interface network is not found in registry (%s) [1]"),
    20082012                    strRegLocation));
    2009    
     2013
    20102014            status = RegOpenKeyExA (hkeyNetwork, "Connection", 0,
    20112015                                    KEY_READ, &hkeyConnection);
     
    20142018                    tr ("Host interface network is not found in registry (%s) [2]"),
    20152019                    strRegLocation));
    2016    
     2020
    20172021            DWORD len = sizeof (lszPnPInstanceId);
    20182022            DWORD dwKeyType;
     
    20402044
    20412045        HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE;
    2042        
     2046
    20432047        do
    20442048        {
     
    20502054            BOOL found = FALSE;
    20512055            DWORD size = 0;
    2052    
     2056
    20532057            /* initialize the structure size */
    20542058            DeviceInfoData.cbSize = sizeof (SP_DEVINFO_DATA);
    2055        
     2059
    20562060            /* copy the net class GUID */
    20572061            memcpy (&netGuid, &GUID_DEVCLASS_NET, sizeof (GUID_DEVCLASS_NET));
    2058        
     2062
    20592063            /* return a device info set contains all installed devices of the Net class */
    20602064            hDeviceInfo = SetupDiGetClassDevs (&netGuid, NULL, NULL, DIGCF_PRESENT);
    2061        
     2065
    20622066            if (hDeviceInfo == INVALID_HANDLE_VALUE)
    20632067                SetErrBreak (("SetupDiGetClassDevs failed (0x%08X)", GetLastError()));
    2064        
     2068
    20652069            /* enumerate the driver info list */
    20662070            while (TRUE)
    20672071            {
    20682072                TCHAR *deviceHwid;
    2069        
     2073
    20702074                ok = SetupDiEnumDeviceInfo (hDeviceInfo, index, &DeviceInfoData);
    2071        
     2075
    20722076                if (!ok)
    20732077                {
     
    20802084                    }
    20812085                }
    2082        
     2086
    20832087                /* try to get the hardware ID registry property */
    20842088                ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo,
     
    20962100                        continue;
    20972101                    }
    2098        
     2102
    20992103                    deviceHwid = (TCHAR *) malloc (size);
    21002104                    ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo,
     
    21192123                    continue;
    21202124                }
    2121        
     2125
    21222126                for (TCHAR *t = deviceHwid;
    21232127                     t && *t && t < &deviceHwid[size / sizeof(TCHAR)];
     
    21402144                    }
    21412145                }
    2142        
     2146
    21432147                if (deviceHwid)
    21442148                {
     
    21462150                    deviceHwid = NULL;
    21472151                }
    2148        
     2152
    21492153                if (found)
    21502154                    break;
    2151        
     2155
    21522156                index++;
    21532157            }
    2154        
     2158
    21552159            if (found == FALSE)
    21562160                SetErrBreak ((tr ("Host Interface Network driver not found (0x%08X)"),
    21572161                              GetLastError()));
    2158        
     2162
    21592163            ok = SetupDiSetSelectedDevice (hDeviceInfo, &DeviceInfoData);
    21602164            if (!ok)
    21612165                SetErrBreak (("SetupDiSetSelectedDevice failed (0x%08X)",
    21622166                              GetLastError()));
    2163        
     2167
    21642168            ok = SetupDiCallClassInstaller (DIF_REMOVE, hDeviceInfo, &DeviceInfoData);
    21652169            if (!ok)
     
    21962200    AssertReturn ((aClient == NULL && aProgress == NULL && aVrc == NULL) ||
    21972201                  (aClient != NULL && aProgress != NULL && aVrc != NULL),
    2198                   E_POINTER); 
     2202                  E_POINTER);
    21992203    AssertReturn (aUser, E_POINTER);
    22002204
    22012205    std::auto_ptr <NetworkInterfaceHelperClientData>
    22022206        d (static_cast <NetworkInterfaceHelperClientData *> (aUser));
    2203        
     2207
    22042208    if (aClient == NULL)
    22052209    {
     
    22232227            vrc = aClient->write (Utf8Str (d->name));
    22242228            if (VBOX_FAILURE (vrc)) break;
    2225            
     2229
    22262230            /* wait for a reply */
    22272231            bool endLoop = false;
     
    22322236                vrc = aClient->read (reply);
    22332237                if (VBOX_FAILURE (vrc)) break;
    2234                
     2238
    22352239                switch (reply)
    22362240                {
     
    22712275                }
    22722276            }
    2273            
     2277
    22742278            break;
    22752279        }
     
    22842288            vrc = aClient->write (d->guid);
    22852289            if (VBOX_FAILURE (vrc)) break;
    2286            
     2290
    22872291            /* wait for a reply */
    22882292            bool endLoop = false;
     
    22932297                vrc = aClient->read (reply);
    22942298                if (VBOX_FAILURE (vrc)) break;
    2295                
     2299
    22962300                switch (reply)
    22972301                {
     
    23242328                }
    23252329            }
    2326            
     2330
    23272331            break;
    23282332        }
     
    23652369            Guid guid;
    23662370            Utf8Str errMsg;
    2367             vrc = createNetworkInterface (aClient, name, guid, errMsg); 
     2371            vrc = createNetworkInterface (aClient, name, guid, errMsg);
    23682372
    23692373            if (VBOX_SUCCESS (vrc))
     
    23972401
    23982402            Utf8Str errMsg;
    2399             vrc = removeNetworkInterface (aClient, guid, errMsg); 
     2403            vrc = removeNetworkInterface (aClient, guid, errMsg);
    24002404
    24012405            if (VBOX_SUCCESS (vrc))
  • trunk/src/VBox/Main/MachineImpl.cpp

    r441 r606  
    2222#if defined(__WIN__)
    2323#elif defined(__LINUX__)
     24#endif
     25
     26#ifdef VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
    2427#   include <errno.h>
    2528#   include <sys/types.h>
     
    139142{
    140143    /* default values for a newly created machine */
    141    
     144
    142145    mNameSync = TRUE;
    143    
     146
    144147    /* mName, mOSType, mSnapshotFolder, mSnapshotFolderFull are initialized in
    145148     * Machine::init() */
     
    208211        {
    209212            if ((*it)->name() == (*thatIt)->name() &&
    210                 RTPathCompare (Utf8Str ((*it)->hostPath()), 
     213                RTPathCompare (Utf8Str ((*it)->hostPath()),
    211214                               Utf8Str ((*thatIt)->hostPath())) == 0)
    212215            {
     
    326329 *  @param aId          UUID of the machine (used only for consistency
    327330 *                      check when aMode is Init_Registered; must match UUID
    328  *                      stored in the settings file). 
     331 *                      stored in the settings file).
    329332 *
    330333 *  @return  Success indicator. if not S_OK, the machine object is invalid
     
    364367    mHWData.allocate();
    365368    mHDData.allocate();
    366    
     369
    367370    char configFileFull [RTPATH_MAX] = {0};
    368371
     
    380383
    381384    mData->mAccessible = TRUE;
    382    
     385
    383386    if (aMode != Init_New)
    384387    {
    385388        /* lock the settings file */
    386389        rc = lockConfig();
    387      
     390
    388391        if (aMode == Init_Registered && FAILED (rc))
    389392        {
     
    478481            /* create the machine UUID */
    479482            unconst (mData->mUuid).create();
    480    
     483
    481484            /* initialize the default snapshots folder */
    482485            rc = COMSETTER(SnapshotFolder) (NULL);
    483486            AssertComRC (rc);
    484            
     487
    485488            /* memorize the provided new machine's name */
    486489            mUserData->mName = aName;
     
    528531    AssertReturn (mType == IsMachine, E_FAIL);
    529532    AssertReturn (!mData->mUuid.isEmpty(), E_FAIL);
    530    
     533
    531534    HRESULT rc = S_OK;
    532535
     
    538541     * will return FALSE for a Machine instance if mRegistered is TRUE). */
    539542    mData->mRegistered = FALSE;
    540    
     543
    541544    if (SUCCEEDED (rc))
    542545    {
     
    550553    {
    551554        mData->mAccessible = TRUE;
    552        
     555
    553556        /* commit all changes made during loading the settings file */
    554557        commit();
     
    578581    /* Restore the registered flag (even on failure) */
    579582    mData->mRegistered = TRUE;
    580    
     583
    581584    return rc;
    582585}
     
    596599{
    597600    LogFlowThisFuncEnter();
    598    
     601
    599602    Assert (!isLockedOnCurrentThread());
    600603
     
    698701    AutoLimitedCaller autoCaller (this);
    699702    CheckComRCReturnRC (autoCaller.rc());
    700    
     703
    701704    AutoLock alock (this);
    702705
    703706    HRESULT rc = S_OK;
    704    
     707
    705708    if (!mData->mAccessible)
    706709    {
    707710        /* try to initialize the VM once more if not accessible */
    708        
     711
    709712        AutoReadySpan autoReadySpan (this);
    710713        AssertReturn (autoReadySpan.isOk(), E_FAIL);
    711        
     714
    712715        rc = registeredInit();
    713        
     716
    714717        if (mData->mAccessible)
    715718            autoReadySpan.setSucceeded();
     
    718721    if (SUCCEEDED (rc))
    719722        *aAccessible = mData->mAccessible;
    720    
     723
    721724    return rc;
    722725}
     
    729732    AutoLimitedCaller autoCaller (this);
    730733    CheckComRCReturnRC (autoCaller.rc());
    731    
     734
    732735    AutoReaderLock alock (this);
    733    
     736
    734737    if (mData->mAccessible || !mData->mAccessError.isBasicAvailable())
    735738    {
     
    738741        return S_OK;
    739742    }
    740    
     743
    741744    HRESULT rc = S_OK;
    742    
     745
    743746    ComObjPtr <VirtualBoxErrorInfo> errorInfo;
    744747    rc = errorInfo.createObject();
     
    751754        rc = errorInfo.queryInterfaceTo (aAccessError);
    752755    }
    753    
     756
    754757    return rc;
    755758}
     
    982985    //     value (to be smart and not to leave garbage). Note that it cannot be
    983986    //     done here because the change may be rolled back. Thus, the right
    984     //     place is #saveSettings(). 
    985    
     987    //     place is #saveSettings().
     988
    986989    AutoCaller autoCaller (this);
    987990    CheckComRCReturnRC (autoCaller.rc());
     
    25152518        mData->mSession.mProgress.setNull();
    25162519    }
    2517    
     2520
    25182521    /* uninitialize the created session machine on failure */
    25192522    if (FAILED (rc))
     
    27622765    {
    27632766        /* A special case: the machine is not accessible. */
    2764        
     2767
    27652768        /* inaccessible machines can only be unregistered */
    27662769        AssertReturn (!aRegistered, E_FAIL);
    27672770
    27682771        /* Uninitialize ourselves here because currently there may be no
    2769          * unregistered that are inaccessible (this state combination is not 
     2772         * unregistered that are inaccessible (this state combination is not
    27702773         * supported). Note releasing the caller and leaving the lock before
    27712774         * calling uninit() */
    2772          
     2775
    27732776        alock.leave();
    27742777        autoCaller.release();
     
    27782781        return S_OK;
    27792782    }
    2780    
     2783
    27812784    AssertReturn (autoCaller.state() == Ready, E_FAIL);
    2782    
     2785
    27832786    if (aRegistered)
    27842787    {
     
    30683071            mUserData->mNameSync = nameSync;
    30693072        }
    3070        
     3073
    30713074        /* OSType (required) */
    30723075        {
     
    37823785#endif
    37833786                mNetworkAdapters [slot]->COMSETTER(HostInterface) (name);
    3784 #ifdef __LINUX__
     3787#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    37853788                Bstr tapSetupApp;
    37863789                CFGLDRQueryBSTR (attachmentNode, "TAPSetup", tapSetupApp.asOutParam());
     
    37903793                mNetworkAdapters [slot]->COMSETTER(TAPSetupApplication) (tapSetupApp);
    37913794                mNetworkAdapters [slot]->COMSETTER(TAPTerminateApplication) (tapTerminateApp);
    3792 #endif // __LINUX__
     3795#endif // VBOX_WITH_UNIXY_TAP_NETWORKING
    37933796                mNetworkAdapters [slot]->AttachToHostInterface();
    37943797            }
     
    40864089    /* The settings file must be created and locked at this point */
    40874090    ComAssertRet (isConfigLocked(), E_FAIL);
    4088    
     4091
    40894092    /* load the config file */
    40904093    int vrc = CFGLDRLoad (aLoader,
     
    43784381
    43794382    aRenamed = false;
    4380    
     4383
    43814384    /* if we're ready and isConfigLocked() is FALSE then it means
    43824385     * that no config file exists yet (we will create a virgin one) */
     
    43894392    {
    43904393        aRenamed = true;
    4391        
     4394
    43924395        if (!aNew)
    43934396        {
     
    43964399            CheckComRCReturnRC (rc);
    43974400        }
    4398        
     4401
    43994402        bool dirRenamed = false;
    44004403        bool fileRenamed = false;
    4401        
     4404
    44024405        Utf8Str configFile, newConfigFile;
    44034406        Utf8Str configDir, newConfigDir;
    4404        
     4407
    44054408        do
    44064409        {
    44074410            int vrc = VINF_SUCCESS;
    4408            
     4411
    44094412            Utf8Str name = mUserData.backedUpData()->mName;
    44104413            Utf8Str newName = mUserData->mName;
    44114414
    44124415            configFile = mData->mConfigFileFull;
    4413            
     4416
    44144417            /* first, rename the directory if it matches the machine name */
    44154418            configDir = configFile;
     
    44424445            newConfigFile = Utf8StrFmt ("%s%c%s.xml",
    44434446                newConfigDir.raw(), RTPATH_DELIMITER, newName.raw());
    4444            
     4447
    44454448            /* then try to rename the settings file itself */
    44464449            if (newConfigFile != configFile)
     
    44654468                }
    44664469            }
    4467            
     4470
    44684471            /* update mConfigFileFull amd mConfigFile */
    44694472            Bstr oldConfigFileFull = mData->mConfigFileFull;
     
    44744477            mParent->calculateRelativePath (path, path);
    44754478            mData->mConfigFile = path;
    4476            
     4479
    44774480            /* last, try to update the global settings with the new path */
    44784481            if (mData->mRegistered)
     
    44944497                path = Utf8StrFmt ("%s%s", newConfigDir.raw(),
    44954498                                   path.raw() + configDir.length());
    4496                 mUserData->mSnapshotFolderFull = path; 
     4499                mUserData->mSnapshotFolderFull = path;
    44974500                calculateRelativePath (path, path);
    4498                 mUserData->mSnapshotFolder = path; 
     4501                mUserData->mSnapshotFolder = path;
    44994502            }
    45004503
     
    45054508                path = Utf8StrFmt ("%s%s", newConfigDir.raw(),
    45064509                                   path.raw() + configDir.length());
    4507                 mSSData->mStateFilePath = path; 
     4510                mSSData->mStateFilePath = path;
    45084511            }
    4509            
     4512
    45104513            /* Update saved state file paths of all online snapshots.
    45114514             * Note that saveSettings() will recognize name change
     
    45164519        }
    45174520        while (0);
    4518        
     4521
    45194522        if (FAILED (rc))
    45204523        {
     
    45254528                RTPathRename (newConfigDir.raw(), configDir.raw(), 0);
    45264529        }
    4527        
     4530
    45284531        if (!aNew)
    45294532        {
     
    45334536                rc = rc2;
    45344537        }
    4535        
     4538
    45364539        CheckComRCReturnRC (rc);
    45374540    }
     
    45564559            }
    45574560        }
    4558        
     4561
    45594562        /* Note: open flags must correlated with RTFileOpen() in lockConfig() */
    4560         path = Utf8Str (mData->mConfigFileFull);       
     4563        path = Utf8Str (mData->mConfigFileFull);
    45614564        vrc = RTFileOpen (&mData->mHandleCfgFile, path,
    45624565                          RTFILE_O_READWRITE | RTFILE_O_CREATE |
     
    45774580        /* we do not close the file to simulate lockConfig() */
    45784581    }
    4579    
     4582
    45804583    return rc;
    45814584}
     
    46314634
    46324635    HRESULT rc = S_OK;
    4633    
     4636
    46344637    /* First, prepare to save settings. It will will care about renaming the
    46354638     * settings directory and file if the machine name was changed and about
    46364639     * creating a new settings file if this is a new machine. */
    46374640    bool isRenamed = false;
    4638     bool isNew = false; 
     4641    bool isNew = false;
    46394642    rc = prepareSaveSettings (isRenamed, isNew);
    46404643    CheckComRCReturnRC (rc);
    4641    
     4644
    46424645    /* then, open the settings file */
    46434646    CFGHANDLE configLoader = 0;
    46444647    rc = openConfigLoader (&configLoader, isNew);
    46454648    CheckComRCReturnRC (rc);
    4646    
     4649
    46474650    /* save all snapshots when the machine name was changed since
    46484651     * it may affect saved state file paths for online snapshots (see
    46494652     * #openConfigLoader() for details) */
    46504653    bool updateAllSnapshots = isRenamed;
    4651    
     4654
    46524655    /* commit before saving, since it may change settings
    46534656     * (for example, perform fixup of lazy hard disk changes) */
     
    46864689        else
    46874690            CFGLDRDeleteAttribute (machineNode, "nameSync");
    4688        
     4691
    46894692        /* OSType (required) */
    46904693        {
     
    47774780                break;
    47784781        }
    4779        
     4782
    47804783        /* update all snapshots if requested */
    47814784        if (updateAllSnapshots)
     
    48214824 *  Wrapper for #saveSnapshotSettingsWorker() that opens the settings file
    48224825 *  and locates the <Machine> node in there. See #saveSnapshotSettingsWorker()
    4823  *  for more details. 
     4826 *  for more details.
    48244827 *
    48254828 *  @param aSnapshot    Snapshot to operate on
     
    48554858    {
    48564859        ComAssertBreak (machineNode, rc = E_FAIL);
    4857        
     4860
    48584861        rc = saveSnapshotSettingsWorker (machineNode, aSnapshot, aOpFlags);
    4859        
     4862
    48604863        CFGLDRReleaseNode (machineNode);
    48614864    }
     
    48974900
    48984901    AssertReturn (isLockedOnCurrentThread(), E_FAIL);
    4899    
     4902
    49004903    int op = aOpFlags & SaveSS_OpMask;
    49014904    AssertReturn (
     
    55325535                    Assert (!name.isNull());
    55335536#endif
    5534 #ifdef __LINUX__
     5537#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    55355538                    if (!name.isEmpty())
    55365539#endif
    55375540                        CFGLDRSetBSTR (attachmentNode, "name", name);
    5538 #ifdef __LINUX__
     5541#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    55395542                    const Bstr &tapSetupApp =
    55405543                        mNetworkAdapters [slot]->data()->mTAPSetupApplication;
     
    55455548                    if (!tapTerminateApp.isEmpty())
    55465549                        CFGLDRSetBSTR (attachmentNode, "TAPTerminate", tapTerminateApp);
    5547 #endif /* __LINUX__ */
     5550#endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */
    55485551                    break;
    55495552                }
     
    65836586    if (!mUserData->mNameSync)
    65846587        return false;
    6585    
     6588
    65866589    if (aSettingsDir)
    65876590        *aSettingsDir = settingsDir;
     
    69076910#if defined(__WIN__)
    69086911    mIPCSem = NULL;
    6909 #elif defined(__LINUX__)
     6912#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    69106913    mIPCSem = -1;
    69116914#endif
     
    69466949    ComAssertMsgRet (mIPCSem, ("Cannot create IPC mutex, err=0x%08X", ::GetLastError()),
    69476950                     E_FAIL);
    6948 #elif defined(__LINUX__)
     6951#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    69496952    Utf8Str configFile = aMachine->mData->mConfigFileFull;
    69506953    char *pszConfigFile = NULL;
     
    70507053            ::CloseHandle (mIPCSem);
    70517054        mIPCSem = NULL;
    7052 #elif defined(__LINUX__)
     7055#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    70537056        if (mIPCSem >= 0)
    70547057            ::semctl (mIPCSem, 0, IPC_RMID);
     
    71627165    Assert (mData->mSession.mMachine == this ||
    71637166            aReason == Uninit::Unexpected);
    7164    
     7167
    71657168    /* reset the rest of session data */
    71667169    mData->mSession.mMachine.setNull();
     
    71727175        ::CloseHandle (mIPCSem);
    71737176    mIPCSem = NULL;
    7174 #elif defined(__LINUX__)
     7177#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    71757178    if (mIPCSem >= 0)
    71767179        ::semctl (mIPCSem, 0, IPC_RMID);
     
    72297232    mIPCSemName.cloneTo (id);
    72307233    return S_OK;
    7231 #elif defined(__LINUX__)
     7234#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    72327235    mData->mConfigFileFull.cloneTo (id);
    72337236    return S_OK;
     
    72497252    Utf8Str logFolder;
    72507253    getLogFolder (logFolder);
    7251    
     7254
    72527255    Bstr (logFolder).cloneTo (aLogFolder);
    7253    
     7256
    72547257    return S_OK;
    72557258}
     
    73607363        /* The direct session is being normally closed by the client process
    73617364         * ----------------------------------------------------------------- */
    7362          
     7365
    73637366        /* go to the closing state (essential for all open*Session() calls and
    73647367         * for #checkForDeath()) */
     
    79617964
    79627965        AutoLock alock (this);
    7963        
     7966
    79647967        /*
    79657968         *  Determine the reason of death: if the session state is Closing here,
     
    79747977                 Uninit::Normal :
    79757978                 Uninit::Abnormal;
    7976        
     7979
    79777980#if defined(__WIN__)
    79787981
     
    79967999        rc = true;
    79978000
    7998 #elif defined(__LINUX__)
     8001#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    79998002
    80008003        AssertMsg (mIPCSem >= 0, ("semaphore must be created"));
     
    84128415        /* finalize the progress after setting the state, for consistency */
    84138416        mSnapshotData.mServerProgress->notifyComplete (rc);
    8414        
     8417
    84158418        endTakingSnapshot (SUCCEEDED (rc));
    84168419    }
     
    92749277        if (mData->mSession.mState == SessionState_SessionClosing)
    92759278            return S_OK;
    9276        
    9277         AssertReturn (!directControl.isNull(), E_FAIL); 
     9279
     9280        AssertReturn (!directControl.isNull(), E_FAIL);
    92789281    }
    92799282
  • trunk/src/VBox/Main/Makefile

    r436 r606  
    3232PROGRAMS         = VBoxSVC
    3333ifeq ($(BUILD_TARGET),win)
    34 LIBRARIES        = VBoxCOM
    35 else
    36 LIBRARIES.linux  = VBoxXPCOM
     34 LIBRARIES       = VBoxCOM
     35else
     36 ifndef VBOX_WITH_XPCOM
     37  $(error "VBox: VBOX_WITH_XPCOM isn't defined")
     38 endif
     39 LIBRARIES       = VBoxXPCOM
     40 DEFS           += VBOX_WITH_XPCOM
     41 DEFS           += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
     42 DEFS           += VBOX_WITH_UNIXY_TAP_NETWORKING
    3743endif
    3844#PROGRAMS         = tstCFGLdr
     
    118124        $(VBOX_XPCOM_INCS)
    119125endif
     126ifdef VBOX_WITH_XPCOM
     127VBoxSVC_LIBS += \
     128        $(PATH_BIN)/VBoxDD$(VBOX_SUFF_DLL) \
     129        $(PATH_BIN)/VBoxXML$(VBOX_SUFF_DLL) \
     130        $(TARGET_VBoxXPCOM)
     131VBoxSVC_LIBS += \
     132        $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
     133        $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
     134VBoxSVC_LIBS.darwin = \
     135        $(LIB_REM)
     136else
    120137VBoxSVC_LIBS = \
    121         $(LIB_RUNTIME)
    122 VBoxSVC_LIBS.win = \
    123138        $(PATH_LIB)/VBoxDD$(VBOX_SUFF_LIB) \
    124139        $(PATH_LIB)/VBoxXML.lib \
    125140        $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
    126 VBoxSVC_LIBS.linux = \
    127         $(PATH_BIN)/VBoxDD.so \
    128         $(PATH_BIN)/VBoxXML.so \
    129         $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
    130         m \
    131         util \
    132         $(LIB_Z) \
    133         $(LIB_PTHREAD) \
    134         $(LIB_UUID) \
    135         $(PATH_BIN)/VBoxXPCOM.so \
    136         $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
    137 VBoxSVC_LIBPATH.linux = \
    138         $(LIBPATH_XPCOM)
     141endif
    139142VBoxSVC_SOURCES = \
    140143        Logging.cpp \
     
    177180        win32/VBoxSVC.rc
    178181
    179 VBoxSVC_SOURCES.linux = \
     182ifdef VBOX_WITH_XPCOM
     183VBoxSVC_SOURCES += \
    180184        linux/server.cpp
     185endif
    181186
    182187ifdef VBOX_WITH_USB
     
    224229VBoxC_LDFLAGS.win = /MANIFEST
    225230endif
     231ifdef VBOX_WITH_XPCOM
    226232VBoxC_LIBS = \
     233        $(TARGET_VBoxXPCOM) \
     234        $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
     235        $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
     236else
     237VBoxC_LIBS = \
     238        $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
     239endif
     240VBoxC_LIBS += \
    227241        $(LIB_VMM) \
    228         $(LIB_REM) \
    229         $(LIB_RUNTIME)
    230 VBoxC_LIBS.win = \
    231         $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
    232 VBoxC_LIBS.linux = \
    233         $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
    234         m \
    235         util \
    236         $(LIB_Z) \
    237         $(LIB_PTHREAD) \
    238         $(LIB_UUID) \
    239         $(PATH_BIN)/VBoxXPCOM.so \
    240         $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
    241 VBoxC_LIBPATH.linux = \
    242         $(LIBPATH_XPCOM)
     242        $(LIB_REM)
    243243VBoxC_SOURCES = \
    244244        Logging.cpp \
     
    266266        win32/VBoxC.def \
    267267        win32/VBoxC.rc
    268 VBoxC_SOURCES.linux = \
     268ifdef VBOX_WITH_XPCOM
     269VBoxC_SOURCES += \
    269270        linux/module.cpp
     271endif
    270272
    271273ifdef VBOX_WITH_HGCM
    272 VBoxC_SOURCES  += \
    273         hgcm/HGCMObjects.cpp \
    274         hgcm/HGCMThread.cpp \
    275         hgcm/HGCM.cpp
     274VBoxC_SOURCES += \
     275        hgcm/HGCMObjects.cpp \
     276        hgcm/HGCMThread.cpp \
     277        hgcm/HGCM.cpp
    276278endif
    277279
    278280ifdef VBOX_WITH_USB
    279 VBoxC_SOURCES  += \
     281VBoxC_SOURCES += \
    280282        RemoteUSBBackend.cpp
    281283endif
     
    297299        xml/cfgldr.cpp \
    298300        xml/cfgldrhlp.cpp
     301ifdef VBOX_WITH_XPCOM
    299302VBoxXML_LIBS       = \
    300         $(LIB_RUNTIME)
    301 VBoxXML_LIBS.linux = \
    302         $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB)
     303        $(TARGET_VBoxXPCOM) \
     304        $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
     305endif
    303306
    304307## @todo (dmik): temporarily embed SettingsConverter.xsl into VBoxXML,
     
    325328        include \
    326329        $(PATH_TARGET)
     330ifdef VBOX_WITH_XPCOM
    327331tstCFGLdr_LIBS     = \
     332        $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB)
     333endif
     334tstCFGLdr_LIBS    += \
    328335        $(LIB_RUNTIME)
    329 tstCFGLdr_LIBS.linux = \
    330         m \
    331         util \
    332         $(LIB_Z) \
    333         $(LIB_PTHREAD) \
    334         $(LIB_UUID) \
    335         $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB)
    336336
    337337
     
    394394
    395395VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
     396VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
    396397VBOX_XML_SCHEMA.linux  = xml/VirtualBox-settings-linux.xsd
    397398VBOX_XML_SCHEMA.win    = xml/VirtualBox-settings-windows.xsd
     
    431432
    432433#
    433 # Creates the symlinks necessary for making XPCOM work. 
     434# Creates the symlinks necessary for making XPCOM work.
    434435#
    435436xpcom-components_INST = bin/components/
     
    536537        $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
    537538
    538 ifeq ($(BUILD_TARGET),linux)
     539ifdef VBOX_WITH_XPCOM
    539540
    540541testidl: $(IDLFILE) $(IDLTYPELIB)
  • trunk/src/VBox/Main/NetworkAdapterImpl.cpp

    r1 r606  
    385385        return E_INVALIDARG;
    386386#endif
    387 #ifdef __LINUX__
     387#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    388388    // empty strings are not allowed as path names
    389389    if (hostInterface && !(*hostInterface))
     
    409409}
    410410
    411 #ifdef __LINUX__
     411#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    412412/**
    413413 * Returns the TAP file descriptor the adapter is attached to
     
    565565}
    566566
    567 #endif /* __LINUX__ */
     567#endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */
    568568
    569569/**
     
    944944            mData->mHostInterface = "";
    945945#endif
    946 #ifdef __LINUX__
     946#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    947947            mData->mHostInterface.setNull();
    948948            mData->mTAPFD = NIL_RTFILE;
  • trunk/src/VBox/Main/SessionImpl.cpp

    r1 r606  
    2222#if defined(__WIN__)
    2323#elif defined(__LINUX__)
     24#endif
     25
     26#ifdef VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
    2427#   include <errno.h>
    2528#   include <sys/types.h>
     
    9194    mIPCSem = NULL;
    9295    mIPCThreadSem = NULL;
    93 #elif defined(__LINUX__)
     96#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    9497    mIPCSem = -1;
    9598#endif
     
    627630#if defined(__WIN32__)
    628631        Assert (!mIPCSem && !mIPCThreadSem);
    629 #elif defined(__LINUX__)
     632#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    630633        Assert (mIPCSem == -1);
    631634#endif
     
    770773    }
    771774
    772 #elif defined(__LINUX__)
     775#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    773776
    774777    Utf8Str semName = ipcId;
     
    811814        ::CloseHandle (mIPCThreadSem);
    812815    }
    813 #elif defined(__LINUX__)
     816#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    814817    if (mIPCSem >= 0)
    815818    {
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r1 r606  
    306306#if defined(__WIN__)
    307307        unconst (mWatcherData.mUpdateReq) = ::CreateEvent (NULL, FALSE, FALSE, NULL);
    308 #elif defined(__LINUX__)
     308#else
    309309        RTSemEventCreate (&unconst (mWatcherData.mUpdateReq));
    310310#endif
     
    447447        unconst (mWatcherData.mUpdateReq) = NULL;
    448448    }
    449 #elif defined(__LINUX__)
     449#else
    450450    if (mWatcherData.mUpdateReq != NIL_RTSEMEVENT)
    451451    {
     
    21142114 *  necessary (it's assumed that the ownership of this argument is passed to
    21152115 *  the user function once #startSVCHelperClient() returns a success, thus
    2116  *  making it responsible for the cleanup). 
     2116 *  making it responsible for the cleanup).
    21172117 *
    21182118 *  After the user function returns, the thread will send the SVCHlpMsg::Null
     
    21202120 *
    21212121 *  @param  aPrivileged |true| to start the SVC Hepler process as a privlieged
    2122  *                      user that can perform administrative tasks 
     2122 *                      user that can perform administrative tasks
    21232123 *  @param  aFunc       user function to run
    21242124 *  @param  aUser       argument to the user function
     
    21432143    /* create the SVCHelperClientThread() argument */
    21442144    std::auto_ptr <StartSVCHelperClientData>
    2145         d (new StartSVCHelperClientData());   
     2145        d (new StartSVCHelperClientData());
    21462146    AssertReturn (d.get(), E_OUTOFMEMORY);
    21472147
     
    21542154    RTTHREAD tid = NIL_RTTHREAD;
    21552155    int vrc = RTThreadCreate (&tid, SVCHelperClientThread,
    2156                               static_cast <void *> (d.get()), 
     2156                              static_cast <void *> (d.get()),
    21572157                              0, RTTHREADTYPE_MAIN_WORKER,
    21582158                              RTTHREADFLAGS_WAITABLE, "SVCHelper");
     
    21682168
    21692169/**
    2170  *  Worker thread for startSVCHelperClient(). 
     2170 *  Worker thread for startSVCHelperClient().
    21712171 */
    21722172/* static */
     
    21812181    HRESULT rc = S_OK;
    21822182    bool userFuncCalled = false;
    2183    
     2183
    21842184    do
    21852185    {
     
    22292229        {
    22302230            /* Attempt to start a privileged process using the Run As dialog */
    2231            
     2231
    22322232            Bstr file = exePath;
    22332233            Bstr parameters = argsStr;
    22342234
    22352235            SHELLEXECUTEINFO shExecInfo;
    2236            
     2236
    22372237            shExecInfo.cbSize = sizeof (SHELLEXECUTEINFO);
    2238            
     2238
    22392239            shExecInfo.fMask = NULL;
    22402240            shExecInfo.hwnd = NULL;
     
    22452245            shExecInfo.nShow = SW_NORMAL;
    22462246            shExecInfo.hInstApp = NULL;
    2247            
     2247
    22482248            if (!ShellExecuteEx (&shExecInfo))
    22492249            {
     
    22902290        }
    22912291
    2292         if (SUCCEEDED (rc) && VBOX_FAILURE (vrc))       
     2292        if (SUCCEEDED (rc) && VBOX_FAILURE (vrc))
    22932293        {
    22942294            rc = setError (E_FAIL,
     
    23052305        d->func (NULL, NULL, d->user, NULL);
    23062306    }
    2307    
     2307
    23082308    d->progress->notifyComplete (rc);
    23092309
     
    23302330#if defined(__WIN__)
    23312331    ::SetEvent (mWatcherData.mUpdateReq);
    2332 #elif defined(__LINUX__)
     2332#else
    23332333    RTSemEventSignal (mWatcherData.mUpdateReq);
    23342334#endif
     
    42974297    ::CoUninitialize();
    42984298
    4299 #elif defined(__LINUX__)
     4299#else
    43004300
    43014301    bool need_update = false;
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r436 r606  
    6666            return setError (E_ACCESSDENIED, tr ("The console is not powered up")); \
    6767    } while (0)
     68
     69/** @def VBOX_WITH_UNIXY_TAP_NETWORKING
     70 *  Unixy style TAP networking. This is defined in the Makefile since it's also
     71 *  used by NetworkAdapterImpl.h/cpp.
     72 */
     73#ifdef __DOXYGEN__
     74# define VBOX_WITH_UNIXY_TAP_NETWORKING
     75#endif
    6876
    6977// Console
     
    395403#ifdef VRDP_MC
    396404    int m_cAudioRefs;
    397    
     405
    398406    static DECLCALLBACK(int)    vrdp_ClientLogon (void *pvUser, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
    399407    static DECLCALLBACK(void)   vrdp_ClientConnect (void *pvUser, uint32_t u32ClientId);
     
    463471    PPDMLED     mapIDELeds[4];
    464472    PPDMLED     mapNetworkLeds[8];
    465 #ifdef __LINUX__
     473#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    466474    Utf8Str     maTAPDeviceName[8];
    467475    RTFILE      maTapFD[8];
  • trunk/src/VBox/Main/include/MachineImpl.h

    r1 r606  
    160160        BOOL mAccessible;
    161161        com::ErrorInfo mAccessError;
    162        
     162
    163163        MachineState_T mMachineState;
    164164        LONG64 mLastStateChange;
     
    274274
    275275    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (Machine)
    276    
     276
    277277    DECLARE_NOT_AGGREGATABLE(Machine)
    278278
     
    414414    int calculateFullPath (const char *aPath, Utf8Str &aResult);
    415415    void calculateRelativePath (const char *aPath, Utf8Str &aResult);
    416    
     416
    417417    void getLogFolder (Utf8Str &aLogFolder);
    418418
     
    440440
    441441    HRESULT registeredInit();
    442    
     442
    443443    inline Machine *machine();
    444444
     
    694694    HANDLE mIPCSem;
    695695    Bstr mIPCSemName;
    696 #elif defined(__LINUX__)
     696#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    697697    int mIPCSem;
    698698#endif
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r1 r606  
    4545            , mHostInterface ("") // cannot be null
    4646#endif
    47 #ifdef __LINUX__
     47#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    4848            , mTAPFD (NIL_RTFILE)
    4949#endif
     
    6161                    mTraceEnabled == that.mTraceEnabled &&
    6262                    mHostInterface == that.mHostInterface &&
    63 #ifdef __LINUX__
     63#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    6464                    mTAPSetupApplication == that.mTAPSetupApplication &&
    6565                    mTAPTerminateApplication == that.mTAPTerminateApplication &&
     
    7878        Bstr mTraceFile;
    7979        Bstr mHostInterface;
    80 #ifdef __LINUX__
     80#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    8181        Bstr mTAPSetupApplication;
    8282        Bstr mTAPTerminateApplication;
     
    117117    STDMETHOD(COMGETTER(HostInterface))(BSTR *hostInterface);
    118118    STDMETHOD(COMSETTER(HostInterface))(INPTR BSTR hostInterface);
    119 #ifdef __LINUX__
     119#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    120120    STDMETHOD(COMGETTER(TAPFileDescriptor))(LONG *tapFileDescriptor);
    121121    STDMETHOD(COMSETTER(TAPFileDescriptor))(LONG tapFileDescriptor);
  • trunk/src/VBox/Main/include/SessionImpl.h

    r1 r606  
    2828#ifdef __WIN__
    2929#include "win32/resource.h"
     30#endif
     31
     32/** @def VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
     33 *  Use SYS V IPC for watching a session.
     34 *  This is defined in the Makefile since it's also used by MachineImpl.h/cpp.
     35 *
     36 *  @todo Dmitry, feel free to completely change this (and/or write a better description).
     37 *        (The same goes for the other darwin changes.)
     38 */
     39#ifdef __DOXYGEN__
     40# define VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
    3041#endif
    3142
     
    117128    HANDLE mIPCSem;
    118129    HANDLE mIPCThreadSem;
    119 #elif defined(__LINUX__)
     130#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    120131    int mIPCSem;
     132#else
     133# error "PORTME"
    121134#endif
    122135};
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r1 r606  
    253253
    254254    const Bstr &settingsFileName() { return mData.mCfgFile.mName; }
    255    
     255
    256256    /* for VirtualBoxSupportErrorInfoImpl */
    257257    static const wchar_t *getComponentName() { return L"VirtualBox"; }
     
    353353#if defined(__WIN__)
    354354            : mUpdateReq (NULL)
    355 #elif defined(__LINUX__)
     355#else
    356356            : mUpdateReq (NIL_RTSEMEVENT)
    357357#endif
     
    361361#if defined(__WIN__)
    362362        const HANDLE mUpdateReq;
    363 #elif defined(__LINUX__)
     363#else
    364364        const RTSEMEVENT mUpdateReq;
    365365#endif
  • trunk/src/VBox/Main/include/VirtualBoxXMLUtil.h

    r1 r606  
    4040#elif defined (__LINUX__)
    4141#   define VBOX_XML_PLATFORM     "linux"
     42#elif defined (__DARWIN__)
     43#   define VBOX_XML_PLATFORM     "macosx"
    4244#else
    4345#   error Unsupported platform!
  • trunk/src/VBox/Main/linux/server.cpp

    r1 r606  
    5656
    5757// for the backtrace signal handler
    58 #if defined(DEBUG)
     58#if defined(DEBUG) && defined(__LINUX__)
    5959# define USE_BACKTRACE
    6060#endif
  • trunk/src/VBox/Main/xml/VirtualBox-settings-macosx.xsd

    r588 r606  
    44 *  :folding=explicit:collapseFolds=1:
    55 *
    6  *  InnoTek VirtualBox Settings Schema Version 1.0-linux
     6 *  InnoTek VirtualBox Settings Schema Version 1.0-macosx
    77
    88 * Copyright (C) 2006 InnoTek Systemberatung GmbH
     
    3131<xsd:annotation>
    3232  <xsd:documentation xml:lang="en">
    33     InnoTek VirtualBox Settings Schema Version 1.0-linux.
     33    InnoTek VirtualBox Settings Schema Version 1.0-macosx.
    3434    Copyright (c) 2004-2005 InnoTek Systemberatung GmbH.
    3535  </xsd:documentation>
     
    5353      <xsd:restriction base="xsd:unsignedInt">
    5454        <xsd:minInclusive value="4"/>
    55         <xsd:maxInclusive value="2000"/>
     55        <xsd:maxInclusive value="3000"/>
    5656      </xsd:restriction>
    5757    </xsd:simpleType>
     
    9696      <xsd:restriction base="xsd:token">
    9797        <xsd:enumeration value="null"/>
    98         <xsd:enumeration value="oss"/>
    99         <xsd:enumeration value="alsa"/>
    10098      </xsd:restriction>
    10199    </xsd:simpleType>
     
    112110    <xsd:complexContent>
    113111      <xsd:extension base="TVirtualBox">
    114         <xsd:attribute name="version" type="xsd:token" fixed="1.2-linux" use="required"/>
     112        <xsd:attribute name="version" type="xsd:token" fixed="1.2-macosx" use="required"/>
    115113      </xsd:extension>
    116114    </xsd:complexContent>
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