- Timestamp:
- Feb 4, 2007 7:19:30 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r604 r606 1411 1411 /DISALLOWLIB:libcmt.lib 1412 1412 TEMPLATE_VBOXMAINEXE_LIBS = \ 1413 $(LIB_RUNTIME) \ 1413 1414 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \ 1414 1415 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \ … … 1429 1430 TEMPLATE_VBOXMAINEXE_LIBS = pthread m $(LIB_UUID) rt 1430 1431 else ifeq ($(BUILD_TARGET),l4) 1431 TEMPLATE_VBOXMAINEXE_LIBS = 1432 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) 1432 1433 # no libs as yet in l4 target - must be added later 1433 1434 else ifeq ($(BUILD_TARGET),os2) 1434 1435 TEMPLATE_VBOXMAINEXE_TOOL = GCC3OMF 1435 TEMPLATE_VBOXMAINEXE_LIBS = 1436 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) 1436 1437 else ifeq ($(BUILD_TARGET),darwin) 1437 1438 TEMPLATE_VBOXMAINEXE_TOOL = GCC4MACHO 1438 TEMPLATE_VBOXMAINEXE_LIBS = 1439 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) 1439 1440 TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin = -bind_at_load -framework Carbon 1440 1441 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),) 1441 1442 TEMPLATE_VBOXMAINEXE_TOOL = GCC3 1442 TEMPLATE_VBOXMAINEXE_LIBS = 1443 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) 1443 1444 else ifeq ($(BUILD_TARGET),solaris) 1444 1445 $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!) 1445 1446 TEMPLATE_VBOXMAINEXE_TOOL = GCC3PLAIN 1446 TEMPLATE_VBOXMAINEXE_LIBS = rt1447 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt 1447 1448 else 1448 1449 $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!) -
trunk/src/VBox/Main/ConsoleImpl.cpp
r514 r606 214 214 memset(mapNetworkLeds, 0, sizeof(mapNetworkLeds)); 215 215 216 #ifdef __LINUX__216 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 217 217 Assert(ELEMENTS(maTapFD) == ELEMENTS(maTAPDeviceName)); 218 218 Assert(ELEMENTS(maTapFD) >= SchemaDefs::NetworkAdapterCount); … … 261 261 rc = mMachine->COMGETTER(VRDPServer) (unconst (mVRDPServer).asOutParam()); 262 262 AssertComRCReturn (rc, rc); 263 #endif 263 #endif 264 264 265 265 rc = mMachine->COMGETTER(DVDDrive) (unconst (mDVDDrive).asOutParam()); … … 295 295 unconst (mConsoleVRDPServer) = new ConsoleVRDPServer (this); 296 296 AssertReturn (mConsoleVRDPServer, E_FAIL); 297 297 298 298 #ifdef VRDP_MC 299 299 m_cAudioRefs = 0; … … 662 662 { 663 663 console->m_cAudioRefs--; 664 664 665 665 if (console->m_cAudioRefs <= 0) 666 666 { … … 718 718 #ifdef VRDP_MC 719 719 console->m_cAudioRefs++; 720 720 721 721 if (console->m_cAudioRefs == 1) 722 722 { … … 2774 2774 break; 2775 2775 } 2776 2776 2777 2777 if (VBOX_FAILURE (rc)) 2778 2778 { … … 3319 3319 AutoReaderLock alock (this); 3320 3320 3321 /** @todo Use the On-Screen Display feature to report the fact. 3321 /** @todo Use the On-Screen Display feature to report the fact. 3322 3322 * The user should be told to install additions that are 3323 3323 * provided with the current VBox build: … … 4058 4058 4059 4059 AssertReturn (that && aConfig && aUuid, VERR_INVALID_PARAMETER); 4060 4060 4061 4061 #ifdef VRDP_MC 4062 4062 if (aRemote) … … 4064 4064 /* @todo aRemoteBackend input parameter is not needed. */ 4065 4065 Assert (aRemoteBackend == NULL); 4066 4066 4067 4067 RemoteUSBDevice *pRemoteUSBDevice = static_cast <RemoteUSBDevice *> (aHostDevice); 4068 4068 4069 4069 Guid guid (*aUuid); 4070 4070 4071 4071 aRemoteBackend = that->consoleVRDPServer ()->USBBackendRequestPointer (pRemoteUSBDevice->clientId (), &guid); 4072 4072 4073 4073 if (aRemoteBackend == NULL) 4074 4074 { … … 4293 4293 rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK(); 4294 4294 rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK(); 4295 #ifdef __LINUX__4295 #ifdef VBOX_WITH_XPCOM 4296 4296 // VBoxC is located in the components subdirectory 4297 4297 char szPathProgram[RTPATH_MAX + sizeof("/components/VBoxC")]; … … 5004 5004 if (SUCCEEDED(hrc)) 5005 5005 { 5006 #ifdef __LINUX__5006 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5007 5007 Assert (pConsole->maTapFD[ulInstance] >= 0); 5008 5008 if (pConsole->maTapFD[ulInstance] >= 0) … … 5020 5020 rc = CFGMR3InsertInteger(pCfg, "FileHandle", pConsole->maTapFD[ulInstance]); RC_CHECK(); 5021 5021 } 5022 #el se /* !__LINUX__ */5022 #elif defined(__WIN__) 5023 5023 if (fSniffer) 5024 5024 { … … 5054 5054 rc = CFGMR3InsertBytes(pCfg, "GUID", szDriverGUID, sizeof(szDriverGUID)); RC_CHECK(); 5055 5055 } 5056 #endif /* !__LINUX__ */ 5056 #else 5057 # error "Port me" 5058 #endif 5057 5059 } 5058 5060 else … … 5180 5182 break; 5181 5183 } 5182 #else /* !__WIN__ */ 5184 #endif /* !__LINUX__ */ 5185 #ifdef __LINUX__ 5183 5186 case AudioDriverType_OSSAudioDriver: 5184 5187 { … … 5193 5196 } 5194 5197 #endif 5195 #endif /* !__WIN__ */5198 #endif /* __LINUX__ */ 5196 5199 } 5197 5200 } … … 5338 5341 *pszCFGMValueName = '\0'; 5339 5342 pszCFGMValueName++; 5340 5343 5341 5344 /* does the node already exist? */ 5342 5345 pNode = CFGMR3GetChild(pRoot, pszExtraDataKey); … … 5433 5436 HRESULT rc = S_OK; 5434 5437 5435 #ifdef __LINUX__5438 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5436 5439 ULONG slot = 0; 5437 5440 rc = networkAdapter->COMGETTER(Slot)(&slot); … … 5459 5462 } 5460 5463 else 5461 #endif /* __LINUX*/5464 #endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */ 5462 5465 { 5463 5466 /* … … 5544 5547 } 5545 5548 } 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" 5548 5556 #endif 5549 5557 /* in case of failure, cleanup. */ … … 5553 5561 } 5554 5562 } 5555 #ifdef __LINUX__5563 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5556 5564 if (SUCCEEDED(rc)) 5557 5565 { … … 5619 5627 } 5620 5628 } 5621 #endif /* __LINUX__*/5629 #endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */ 5622 5630 return rc; 5623 5631 } … … 5644 5652 #endif /* DEBUG */ 5645 5653 5646 #ifdef __LINUX__5654 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5647 5655 5648 5656 ULONG slot = 0; … … 5827 5835 fFatal, pszErrorID, message.raw())); 5828 5836 5829 that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message)); 5837 that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message)); 5830 5838 5831 5839 LogFlowFuncLeave(); -
trunk/src/VBox/Main/HostImpl.cpp
r259 r606 183 183 while (*p); 184 184 delete[] hostDrives; 185 #el se185 #elif defined(__LINUX__) 186 186 // On Linux, the situation is much more complex. There is no simple API so 187 187 // we will take a more creative approach. As there is only a heuristical … … 226 226 parseMountTable((char*)"/etc/fstab", list); 227 227 } 228 #else 229 /* PORTME */ 228 230 #endif 229 231 … … 270 272 while (*p); 271 273 delete[] hostDrives; 272 #el se274 #elif defined(__LINUX__) 273 275 // As with the CDROMs, on Linux we have to take a multi-level approach 274 276 // involving parsing the mount tables. As this is not bulletproof, we'll … … 310 312 } 311 313 } 314 #else 315 /* PORTME */ 312 316 #endif 313 317 … … 670 674 /* create the networkInterfaceHelperClient() argument */ 671 675 std::auto_ptr <NetworkInterfaceHelperClientData> 672 d (new NetworkInterfaceHelperClientData()); 676 d (new NetworkInterfaceHelperClientData()); 673 677 AssertReturn (d.get(), E_OUTOFMEMORY); 674 678 675 679 d->msgCode = SVCHlpMsg::CreateHostNetworkInterface; 676 680 d->name = aName; … … 682 686 static_cast <void *> (d.get()), 683 687 progress); 684 688 685 689 if (SUCCEEDED (rc)) 686 690 { … … 733 737 /* create the networkInterfaceHelperClient() argument */ 734 738 std::auto_ptr <NetworkInterfaceHelperClientData> 735 d (new NetworkInterfaceHelperClientData()); 739 d (new NetworkInterfaceHelperClientData()); 736 740 AssertReturn (d.get(), E_OUTOFMEMORY); 737 741 738 742 d->msgCode = SVCHlpMsg::RemoveHostNetworkInterface; 739 743 d->guid = aId; … … 744 748 static_cast <void *> (d.get()), 745 749 progress); 746 750 747 751 if (SUCCEEDED (rc)) 748 752 { … … 1695 1699 LogFlowFunc (("Network connection name = '%s'\n", aName.raw())); 1696 1700 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); 1699 1703 1700 1704 int vrc = VINF_SUCCESS; … … 1719 1723 /* for our purposes, 2k buffer is more 1720 1724 * than enough to obtain the hardware ID 1721 * of the VBoxTAP driver. */ 1725 * of the VBoxTAP driver. */ 1722 1726 DWORD detailBuf [2048]; 1723 1727 1724 1728 HKEY hkey = NULL; 1725 1729 DWORD cbSize; 1726 1730 DWORD dwValueType; 1727 1731 1728 1732 /* initialize the structure size */ 1729 1733 DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); 1730 1734 DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA); 1731 1735 1732 1736 /* copy the net class GUID */ 1733 1737 memcpy(&netGuid, &GUID_DEVCLASS_NET, sizeof(GUID_DEVCLASS_NET)); 1734 1738 1735 1739 /* create an empty device info set associated with the net class GUID */ 1736 1740 hDeviceInfo = SetupDiCreateDeviceInfoList (&netGuid, NULL); … … 1766 1770 SetErrBreak (("SetupDiBuildDriverInfoList failed (0x%08X)", 1767 1771 GetLastError())); 1768 1772 1769 1773 destroyList = TRUE; 1770 1774 … … 1773 1777 { 1774 1778 BOOL ret; 1775 1779 1776 1780 ret = SetupDiEnumDriverInfo (hDeviceInfo, &DeviceInfoData, 1777 1781 SPDIT_CLASSDRIVER, index, &DriverInfoData); 1778 1782 1779 1783 /* if the function failed and GetLastError() returned 1780 1784 * ERROR_NO_MORE_ITEMS, then we have reached the end of the … … 1791 1795 } 1792 1796 } 1793 1797 1794 1798 pDriverInfoDetail = (PSP_DRVINFO_DETAIL_DATA) detailBuf; 1795 1799 pDriverInfoDetail->cbSize = sizeof(SP_DRVINFO_DETAIL_DATA); 1796 1800 1797 1801 /* if we successfully find the hardware ID and it turns out to 1798 1802 * be the one for the loopback driver, then we are done. */ … … 1805 1809 { 1806 1810 TCHAR * t; 1807 1811 1808 1812 /* pDriverInfoDetail->HardwareID is a MULTISZ string. Go through the 1809 1813 * whole list and see if there is a match somewhere. */ … … 1813 1817 if (!_tcsicmp(t, DRIVERHWID)) 1814 1818 break; 1815 1819 1816 1820 t += _tcslen(t) + 1; 1817 1821 } 1818 1822 1819 1823 if (t && *t && t < (TCHAR *) &detailBuf [sizeof(detailBuf) / sizeof (detailBuf[0])]) 1820 1824 { … … 1823 1827 } 1824 1828 } 1825 1829 1826 1830 index ++; 1827 1831 } … … 1837 1841 SetErrBreak (("SetupDiSetSelectedDriver failed (0x%08X)", 1838 1842 GetLastError())); 1839 1843 1840 1844 /* register the phantom device to prepare for install */ 1841 1845 ok = SetupDiCallClassInstaller (DIF_REGISTERDEVICE, hDeviceInfo, … … 1844 1848 SetErrBreak (("SetupDiCallClassInstaller failed (0x%08X)", 1845 1849 GetLastError())); 1846 1850 1847 1851 /* registered, but remove if errors occur in the following code */ 1848 1852 registered = TRUE; 1849 1853 1850 1854 /* ask the installer if we can install the device */ 1851 1855 ok = SetupDiCallClassInstaller (DIF_ALLOW_INSTALL, hDeviceInfo, … … 1865 1869 SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLDEVICEFILES) failed (0x%08X)", 1866 1870 GetLastError())); 1867 1871 1868 1872 /* get the device install parameters and disable filecopy */ 1869 1873 DeviceInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); … … 1883 1887 * Register any device-specific co-installers for this device, 1884 1888 */ 1885 1889 1886 1890 ok = SetupDiCallClassInstaller (DIF_REGISTER_COINSTALLERS, 1887 1891 hDeviceInfo, … … 1890 1894 SetErrBreak (("SetupDiCallClassInstaller (DIF_REGISTER_COINSTALLERS) failed (0x%08X)", 1891 1895 GetLastError())); 1892 1896 1893 1897 /* 1894 1898 * install any installer-specified interfaces. … … 1901 1905 SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLINTERFACES) failed (0x%08X)", 1902 1906 GetLastError())); 1903 1907 1904 1908 ok = SetupDiCallClassInstaller (DIF_INSTALLDEVICE, 1905 1909 hDeviceInfo, … … 1919 1923 SetErrBreak (("SetupDiOpenDevRegKey failed (0x%08X)", 1920 1924 GetLastError())); 1921 1925 1922 1926 cbSize = sizeof (pCfgGuidString); 1923 1927 DWORD ret; … … 1925 1929 &dwValueType, (LPBYTE) pCfgGuidString, &cbSize); 1926 1930 RegCloseKey (hkey); 1927 1931 1928 1932 ret = RenameConnection (pCfgGuidString, Bstr (aName)); 1929 1933 if (FAILED (ret)) … … 1933 1937 } 1934 1938 while (0); 1935 1939 1936 1940 /* 1937 1941 * cleanup … … 1943 1947 if (ret != 0 && registered) 1944 1948 SetupDiCallClassInstaller (DIF_REMOVE, hDeviceInfo, &DeviceInfoData); 1945 1949 1946 1950 found = SetupDiDeleteDeviceInfo (hDeviceInfo, &DeviceInfoData); 1947 1951 1948 1952 /* destroy the driver info list */ 1949 1953 if (destroyList) … … 1979 1983 LogFlowFunc (("Network connection GUID = {%Vuuid}\n", aGUID.raw())); 1980 1984 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); 1983 1987 1984 1988 int vrc = VINF_SUCCESS; … … 2007 2011 tr ("Host interface network is not found in registry (%s) [1]"), 2008 2012 strRegLocation)); 2009 2013 2010 2014 status = RegOpenKeyExA (hkeyNetwork, "Connection", 0, 2011 2015 KEY_READ, &hkeyConnection); … … 2014 2018 tr ("Host interface network is not found in registry (%s) [2]"), 2015 2019 strRegLocation)); 2016 2020 2017 2021 DWORD len = sizeof (lszPnPInstanceId); 2018 2022 DWORD dwKeyType; … … 2040 2044 2041 2045 HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE; 2042 2046 2043 2047 do 2044 2048 { … … 2050 2054 BOOL found = FALSE; 2051 2055 DWORD size = 0; 2052 2056 2053 2057 /* initialize the structure size */ 2054 2058 DeviceInfoData.cbSize = sizeof (SP_DEVINFO_DATA); 2055 2059 2056 2060 /* copy the net class GUID */ 2057 2061 memcpy (&netGuid, &GUID_DEVCLASS_NET, sizeof (GUID_DEVCLASS_NET)); 2058 2062 2059 2063 /* return a device info set contains all installed devices of the Net class */ 2060 2064 hDeviceInfo = SetupDiGetClassDevs (&netGuid, NULL, NULL, DIGCF_PRESENT); 2061 2065 2062 2066 if (hDeviceInfo == INVALID_HANDLE_VALUE) 2063 2067 SetErrBreak (("SetupDiGetClassDevs failed (0x%08X)", GetLastError())); 2064 2068 2065 2069 /* enumerate the driver info list */ 2066 2070 while (TRUE) 2067 2071 { 2068 2072 TCHAR *deviceHwid; 2069 2073 2070 2074 ok = SetupDiEnumDeviceInfo (hDeviceInfo, index, &DeviceInfoData); 2071 2075 2072 2076 if (!ok) 2073 2077 { … … 2080 2084 } 2081 2085 } 2082 2086 2083 2087 /* try to get the hardware ID registry property */ 2084 2088 ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo, … … 2096 2100 continue; 2097 2101 } 2098 2102 2099 2103 deviceHwid = (TCHAR *) malloc (size); 2100 2104 ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo, … … 2119 2123 continue; 2120 2124 } 2121 2125 2122 2126 for (TCHAR *t = deviceHwid; 2123 2127 t && *t && t < &deviceHwid[size / sizeof(TCHAR)]; … … 2140 2144 } 2141 2145 } 2142 2146 2143 2147 if (deviceHwid) 2144 2148 { … … 2146 2150 deviceHwid = NULL; 2147 2151 } 2148 2152 2149 2153 if (found) 2150 2154 break; 2151 2155 2152 2156 index++; 2153 2157 } 2154 2158 2155 2159 if (found == FALSE) 2156 2160 SetErrBreak ((tr ("Host Interface Network driver not found (0x%08X)"), 2157 2161 GetLastError())); 2158 2162 2159 2163 ok = SetupDiSetSelectedDevice (hDeviceInfo, &DeviceInfoData); 2160 2164 if (!ok) 2161 2165 SetErrBreak (("SetupDiSetSelectedDevice failed (0x%08X)", 2162 2166 GetLastError())); 2163 2167 2164 2168 ok = SetupDiCallClassInstaller (DIF_REMOVE, hDeviceInfo, &DeviceInfoData); 2165 2169 if (!ok) … … 2196 2200 AssertReturn ((aClient == NULL && aProgress == NULL && aVrc == NULL) || 2197 2201 (aClient != NULL && aProgress != NULL && aVrc != NULL), 2198 E_POINTER); 2202 E_POINTER); 2199 2203 AssertReturn (aUser, E_POINTER); 2200 2204 2201 2205 std::auto_ptr <NetworkInterfaceHelperClientData> 2202 2206 d (static_cast <NetworkInterfaceHelperClientData *> (aUser)); 2203 2207 2204 2208 if (aClient == NULL) 2205 2209 { … … 2223 2227 vrc = aClient->write (Utf8Str (d->name)); 2224 2228 if (VBOX_FAILURE (vrc)) break; 2225 2229 2226 2230 /* wait for a reply */ 2227 2231 bool endLoop = false; … … 2232 2236 vrc = aClient->read (reply); 2233 2237 if (VBOX_FAILURE (vrc)) break; 2234 2238 2235 2239 switch (reply) 2236 2240 { … … 2271 2275 } 2272 2276 } 2273 2277 2274 2278 break; 2275 2279 } … … 2284 2288 vrc = aClient->write (d->guid); 2285 2289 if (VBOX_FAILURE (vrc)) break; 2286 2290 2287 2291 /* wait for a reply */ 2288 2292 bool endLoop = false; … … 2293 2297 vrc = aClient->read (reply); 2294 2298 if (VBOX_FAILURE (vrc)) break; 2295 2299 2296 2300 switch (reply) 2297 2301 { … … 2324 2328 } 2325 2329 } 2326 2330 2327 2331 break; 2328 2332 } … … 2365 2369 Guid guid; 2366 2370 Utf8Str errMsg; 2367 vrc = createNetworkInterface (aClient, name, guid, errMsg); 2371 vrc = createNetworkInterface (aClient, name, guid, errMsg); 2368 2372 2369 2373 if (VBOX_SUCCESS (vrc)) … … 2397 2401 2398 2402 Utf8Str errMsg; 2399 vrc = removeNetworkInterface (aClient, guid, errMsg); 2403 vrc = removeNetworkInterface (aClient, guid, errMsg); 2400 2404 2401 2405 if (VBOX_SUCCESS (vrc)) -
trunk/src/VBox/Main/MachineImpl.cpp
r441 r606 22 22 #if defined(__WIN__) 23 23 #elif defined(__LINUX__) 24 #endif 25 26 #ifdef VBOX_WITH_SYS_V_IPC_SESSION_WATCHER 24 27 # include <errno.h> 25 28 # include <sys/types.h> … … 139 142 { 140 143 /* default values for a newly created machine */ 141 144 142 145 mNameSync = TRUE; 143 146 144 147 /* mName, mOSType, mSnapshotFolder, mSnapshotFolderFull are initialized in 145 148 * Machine::init() */ … … 208 211 { 209 212 if ((*it)->name() == (*thatIt)->name() && 210 RTPathCompare (Utf8Str ((*it)->hostPath()), 213 RTPathCompare (Utf8Str ((*it)->hostPath()), 211 214 Utf8Str ((*thatIt)->hostPath())) == 0) 212 215 { … … 326 329 * @param aId UUID of the machine (used only for consistency 327 330 * check when aMode is Init_Registered; must match UUID 328 * stored in the settings file). 331 * stored in the settings file). 329 332 * 330 333 * @return Success indicator. if not S_OK, the machine object is invalid … … 364 367 mHWData.allocate(); 365 368 mHDData.allocate(); 366 369 367 370 char configFileFull [RTPATH_MAX] = {0}; 368 371 … … 380 383 381 384 mData->mAccessible = TRUE; 382 385 383 386 if (aMode != Init_New) 384 387 { 385 388 /* lock the settings file */ 386 389 rc = lockConfig(); 387 390 388 391 if (aMode == Init_Registered && FAILED (rc)) 389 392 { … … 478 481 /* create the machine UUID */ 479 482 unconst (mData->mUuid).create(); 480 483 481 484 /* initialize the default snapshots folder */ 482 485 rc = COMSETTER(SnapshotFolder) (NULL); 483 486 AssertComRC (rc); 484 487 485 488 /* memorize the provided new machine's name */ 486 489 mUserData->mName = aName; … … 528 531 AssertReturn (mType == IsMachine, E_FAIL); 529 532 AssertReturn (!mData->mUuid.isEmpty(), E_FAIL); 530 533 531 534 HRESULT rc = S_OK; 532 535 … … 538 541 * will return FALSE for a Machine instance if mRegistered is TRUE). */ 539 542 mData->mRegistered = FALSE; 540 543 541 544 if (SUCCEEDED (rc)) 542 545 { … … 550 553 { 551 554 mData->mAccessible = TRUE; 552 555 553 556 /* commit all changes made during loading the settings file */ 554 557 commit(); … … 578 581 /* Restore the registered flag (even on failure) */ 579 582 mData->mRegistered = TRUE; 580 583 581 584 return rc; 582 585 } … … 596 599 { 597 600 LogFlowThisFuncEnter(); 598 601 599 602 Assert (!isLockedOnCurrentThread()); 600 603 … … 698 701 AutoLimitedCaller autoCaller (this); 699 702 CheckComRCReturnRC (autoCaller.rc()); 700 703 701 704 AutoLock alock (this); 702 705 703 706 HRESULT rc = S_OK; 704 707 705 708 if (!mData->mAccessible) 706 709 { 707 710 /* try to initialize the VM once more if not accessible */ 708 711 709 712 AutoReadySpan autoReadySpan (this); 710 713 AssertReturn (autoReadySpan.isOk(), E_FAIL); 711 714 712 715 rc = registeredInit(); 713 716 714 717 if (mData->mAccessible) 715 718 autoReadySpan.setSucceeded(); … … 718 721 if (SUCCEEDED (rc)) 719 722 *aAccessible = mData->mAccessible; 720 723 721 724 return rc; 722 725 } … … 729 732 AutoLimitedCaller autoCaller (this); 730 733 CheckComRCReturnRC (autoCaller.rc()); 731 734 732 735 AutoReaderLock alock (this); 733 736 734 737 if (mData->mAccessible || !mData->mAccessError.isBasicAvailable()) 735 738 { … … 738 741 return S_OK; 739 742 } 740 743 741 744 HRESULT rc = S_OK; 742 745 743 746 ComObjPtr <VirtualBoxErrorInfo> errorInfo; 744 747 rc = errorInfo.createObject(); … … 751 754 rc = errorInfo.queryInterfaceTo (aAccessError); 752 755 } 753 756 754 757 return rc; 755 758 } … … 982 985 // value (to be smart and not to leave garbage). Note that it cannot be 983 986 // done here because the change may be rolled back. Thus, the right 984 // place is #saveSettings(). 985 987 // place is #saveSettings(). 988 986 989 AutoCaller autoCaller (this); 987 990 CheckComRCReturnRC (autoCaller.rc()); … … 2515 2518 mData->mSession.mProgress.setNull(); 2516 2519 } 2517 2520 2518 2521 /* uninitialize the created session machine on failure */ 2519 2522 if (FAILED (rc)) … … 2762 2765 { 2763 2766 /* A special case: the machine is not accessible. */ 2764 2767 2765 2768 /* inaccessible machines can only be unregistered */ 2766 2769 AssertReturn (!aRegistered, E_FAIL); 2767 2770 2768 2771 /* 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 2770 2773 * supported). Note releasing the caller and leaving the lock before 2771 2774 * calling uninit() */ 2772 2775 2773 2776 alock.leave(); 2774 2777 autoCaller.release(); … … 2778 2781 return S_OK; 2779 2782 } 2780 2783 2781 2784 AssertReturn (autoCaller.state() == Ready, E_FAIL); 2782 2785 2783 2786 if (aRegistered) 2784 2787 { … … 3068 3071 mUserData->mNameSync = nameSync; 3069 3072 } 3070 3073 3071 3074 /* OSType (required) */ 3072 3075 { … … 3782 3785 #endif 3783 3786 mNetworkAdapters [slot]->COMSETTER(HostInterface) (name); 3784 #ifdef __LINUX__3787 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 3785 3788 Bstr tapSetupApp; 3786 3789 CFGLDRQueryBSTR (attachmentNode, "TAPSetup", tapSetupApp.asOutParam()); … … 3790 3793 mNetworkAdapters [slot]->COMSETTER(TAPSetupApplication) (tapSetupApp); 3791 3794 mNetworkAdapters [slot]->COMSETTER(TAPTerminateApplication) (tapTerminateApp); 3792 #endif // __LINUX__3795 #endif // VBOX_WITH_UNIXY_TAP_NETWORKING 3793 3796 mNetworkAdapters [slot]->AttachToHostInterface(); 3794 3797 } … … 4086 4089 /* The settings file must be created and locked at this point */ 4087 4090 ComAssertRet (isConfigLocked(), E_FAIL); 4088 4091 4089 4092 /* load the config file */ 4090 4093 int vrc = CFGLDRLoad (aLoader, … … 4378 4381 4379 4382 aRenamed = false; 4380 4383 4381 4384 /* if we're ready and isConfigLocked() is FALSE then it means 4382 4385 * that no config file exists yet (we will create a virgin one) */ … … 4389 4392 { 4390 4393 aRenamed = true; 4391 4394 4392 4395 if (!aNew) 4393 4396 { … … 4396 4399 CheckComRCReturnRC (rc); 4397 4400 } 4398 4401 4399 4402 bool dirRenamed = false; 4400 4403 bool fileRenamed = false; 4401 4404 4402 4405 Utf8Str configFile, newConfigFile; 4403 4406 Utf8Str configDir, newConfigDir; 4404 4407 4405 4408 do 4406 4409 { 4407 4410 int vrc = VINF_SUCCESS; 4408 4411 4409 4412 Utf8Str name = mUserData.backedUpData()->mName; 4410 4413 Utf8Str newName = mUserData->mName; 4411 4414 4412 4415 configFile = mData->mConfigFileFull; 4413 4416 4414 4417 /* first, rename the directory if it matches the machine name */ 4415 4418 configDir = configFile; … … 4442 4445 newConfigFile = Utf8StrFmt ("%s%c%s.xml", 4443 4446 newConfigDir.raw(), RTPATH_DELIMITER, newName.raw()); 4444 4447 4445 4448 /* then try to rename the settings file itself */ 4446 4449 if (newConfigFile != configFile) … … 4465 4468 } 4466 4469 } 4467 4470 4468 4471 /* update mConfigFileFull amd mConfigFile */ 4469 4472 Bstr oldConfigFileFull = mData->mConfigFileFull; … … 4474 4477 mParent->calculateRelativePath (path, path); 4475 4478 mData->mConfigFile = path; 4476 4479 4477 4480 /* last, try to update the global settings with the new path */ 4478 4481 if (mData->mRegistered) … … 4494 4497 path = Utf8StrFmt ("%s%s", newConfigDir.raw(), 4495 4498 path.raw() + configDir.length()); 4496 mUserData->mSnapshotFolderFull = path; 4499 mUserData->mSnapshotFolderFull = path; 4497 4500 calculateRelativePath (path, path); 4498 mUserData->mSnapshotFolder = path; 4501 mUserData->mSnapshotFolder = path; 4499 4502 } 4500 4503 … … 4505 4508 path = Utf8StrFmt ("%s%s", newConfigDir.raw(), 4506 4509 path.raw() + configDir.length()); 4507 mSSData->mStateFilePath = path; 4510 mSSData->mStateFilePath = path; 4508 4511 } 4509 4512 4510 4513 /* Update saved state file paths of all online snapshots. 4511 4514 * Note that saveSettings() will recognize name change … … 4516 4519 } 4517 4520 while (0); 4518 4521 4519 4522 if (FAILED (rc)) 4520 4523 { … … 4525 4528 RTPathRename (newConfigDir.raw(), configDir.raw(), 0); 4526 4529 } 4527 4530 4528 4531 if (!aNew) 4529 4532 { … … 4533 4536 rc = rc2; 4534 4537 } 4535 4538 4536 4539 CheckComRCReturnRC (rc); 4537 4540 } … … 4556 4559 } 4557 4560 } 4558 4561 4559 4562 /* Note: open flags must correlated with RTFileOpen() in lockConfig() */ 4560 path = Utf8Str (mData->mConfigFileFull); 4563 path = Utf8Str (mData->mConfigFileFull); 4561 4564 vrc = RTFileOpen (&mData->mHandleCfgFile, path, 4562 4565 RTFILE_O_READWRITE | RTFILE_O_CREATE | … … 4577 4580 /* we do not close the file to simulate lockConfig() */ 4578 4581 } 4579 4582 4580 4583 return rc; 4581 4584 } … … 4631 4634 4632 4635 HRESULT rc = S_OK; 4633 4636 4634 4637 /* First, prepare to save settings. It will will care about renaming the 4635 4638 * settings directory and file if the machine name was changed and about 4636 4639 * creating a new settings file if this is a new machine. */ 4637 4640 bool isRenamed = false; 4638 bool isNew = false; 4641 bool isNew = false; 4639 4642 rc = prepareSaveSettings (isRenamed, isNew); 4640 4643 CheckComRCReturnRC (rc); 4641 4644 4642 4645 /* then, open the settings file */ 4643 4646 CFGHANDLE configLoader = 0; 4644 4647 rc = openConfigLoader (&configLoader, isNew); 4645 4648 CheckComRCReturnRC (rc); 4646 4649 4647 4650 /* save all snapshots when the machine name was changed since 4648 4651 * it may affect saved state file paths for online snapshots (see 4649 4652 * #openConfigLoader() for details) */ 4650 4653 bool updateAllSnapshots = isRenamed; 4651 4654 4652 4655 /* commit before saving, since it may change settings 4653 4656 * (for example, perform fixup of lazy hard disk changes) */ … … 4686 4689 else 4687 4690 CFGLDRDeleteAttribute (machineNode, "nameSync"); 4688 4691 4689 4692 /* OSType (required) */ 4690 4693 { … … 4777 4780 break; 4778 4781 } 4779 4782 4780 4783 /* update all snapshots if requested */ 4781 4784 if (updateAllSnapshots) … … 4821 4824 * Wrapper for #saveSnapshotSettingsWorker() that opens the settings file 4822 4825 * and locates the <Machine> node in there. See #saveSnapshotSettingsWorker() 4823 * for more details. 4826 * for more details. 4824 4827 * 4825 4828 * @param aSnapshot Snapshot to operate on … … 4855 4858 { 4856 4859 ComAssertBreak (machineNode, rc = E_FAIL); 4857 4860 4858 4861 rc = saveSnapshotSettingsWorker (machineNode, aSnapshot, aOpFlags); 4859 4862 4860 4863 CFGLDRReleaseNode (machineNode); 4861 4864 } … … 4897 4900 4898 4901 AssertReturn (isLockedOnCurrentThread(), E_FAIL); 4899 4902 4900 4903 int op = aOpFlags & SaveSS_OpMask; 4901 4904 AssertReturn ( … … 5532 5535 Assert (!name.isNull()); 5533 5536 #endif 5534 #ifdef __LINUX__5537 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5535 5538 if (!name.isEmpty()) 5536 5539 #endif 5537 5540 CFGLDRSetBSTR (attachmentNode, "name", name); 5538 #ifdef __LINUX__5541 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 5539 5542 const Bstr &tapSetupApp = 5540 5543 mNetworkAdapters [slot]->data()->mTAPSetupApplication; … … 5545 5548 if (!tapTerminateApp.isEmpty()) 5546 5549 CFGLDRSetBSTR (attachmentNode, "TAPTerminate", tapTerminateApp); 5547 #endif /* __LINUX__*/5550 #endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */ 5548 5551 break; 5549 5552 } … … 6583 6586 if (!mUserData->mNameSync) 6584 6587 return false; 6585 6588 6586 6589 if (aSettingsDir) 6587 6590 *aSettingsDir = settingsDir; … … 6907 6910 #if defined(__WIN__) 6908 6911 mIPCSem = NULL; 6909 #elif defined( __LINUX__)6912 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 6910 6913 mIPCSem = -1; 6911 6914 #endif … … 6946 6949 ComAssertMsgRet (mIPCSem, ("Cannot create IPC mutex, err=0x%08X", ::GetLastError()), 6947 6950 E_FAIL); 6948 #elif defined( __LINUX__)6951 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 6949 6952 Utf8Str configFile = aMachine->mData->mConfigFileFull; 6950 6953 char *pszConfigFile = NULL; … … 7050 7053 ::CloseHandle (mIPCSem); 7051 7054 mIPCSem = NULL; 7052 #elif defined( __LINUX__)7055 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7053 7056 if (mIPCSem >= 0) 7054 7057 ::semctl (mIPCSem, 0, IPC_RMID); … … 7162 7165 Assert (mData->mSession.mMachine == this || 7163 7166 aReason == Uninit::Unexpected); 7164 7167 7165 7168 /* reset the rest of session data */ 7166 7169 mData->mSession.mMachine.setNull(); … … 7172 7175 ::CloseHandle (mIPCSem); 7173 7176 mIPCSem = NULL; 7174 #elif defined( __LINUX__)7177 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7175 7178 if (mIPCSem >= 0) 7176 7179 ::semctl (mIPCSem, 0, IPC_RMID); … … 7229 7232 mIPCSemName.cloneTo (id); 7230 7233 return S_OK; 7231 #elif defined( __LINUX__)7234 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7232 7235 mData->mConfigFileFull.cloneTo (id); 7233 7236 return S_OK; … … 7249 7252 Utf8Str logFolder; 7250 7253 getLogFolder (logFolder); 7251 7254 7252 7255 Bstr (logFolder).cloneTo (aLogFolder); 7253 7256 7254 7257 return S_OK; 7255 7258 } … … 7360 7363 /* The direct session is being normally closed by the client process 7361 7364 * ----------------------------------------------------------------- */ 7362 7365 7363 7366 /* go to the closing state (essential for all open*Session() calls and 7364 7367 * for #checkForDeath()) */ … … 7961 7964 7962 7965 AutoLock alock (this); 7963 7966 7964 7967 /* 7965 7968 * Determine the reason of death: if the session state is Closing here, … … 7974 7977 Uninit::Normal : 7975 7978 Uninit::Abnormal; 7976 7979 7977 7980 #if defined(__WIN__) 7978 7981 … … 7996 7999 rc = true; 7997 8000 7998 #elif defined( __LINUX__)8001 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7999 8002 8000 8003 AssertMsg (mIPCSem >= 0, ("semaphore must be created")); … … 8412 8415 /* finalize the progress after setting the state, for consistency */ 8413 8416 mSnapshotData.mServerProgress->notifyComplete (rc); 8414 8417 8415 8418 endTakingSnapshot (SUCCEEDED (rc)); 8416 8419 } … … 9274 9277 if (mData->mSession.mState == SessionState_SessionClosing) 9275 9278 return S_OK; 9276 9277 AssertReturn (!directControl.isNull(), E_FAIL); 9279 9280 AssertReturn (!directControl.isNull(), E_FAIL); 9278 9281 } 9279 9282 -
trunk/src/VBox/Main/Makefile
r436 r606 32 32 PROGRAMS = VBoxSVC 33 33 ifeq ($(BUILD_TARGET),win) 34 LIBRARIES = VBoxCOM 35 else 36 LIBRARIES.linux = VBoxXPCOM 34 LIBRARIES = VBoxCOM 35 else 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 37 43 endif 38 44 #PROGRAMS = tstCFGLdr … … 118 124 $(VBOX_XPCOM_INCS) 119 125 endif 126 ifdef VBOX_WITH_XPCOM 127 VBoxSVC_LIBS += \ 128 $(PATH_BIN)/VBoxDD$(VBOX_SUFF_DLL) \ 129 $(PATH_BIN)/VBoxXML$(VBOX_SUFF_DLL) \ 130 $(TARGET_VBoxXPCOM) 131 VBoxSVC_LIBS += \ 132 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \ 133 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) 134 VBoxSVC_LIBS.darwin = \ 135 $(LIB_REM) 136 else 120 137 VBoxSVC_LIBS = \ 121 $(LIB_RUNTIME)122 VBoxSVC_LIBS.win = \123 138 $(PATH_LIB)/VBoxDD$(VBOX_SUFF_LIB) \ 124 139 $(PATH_LIB)/VBoxXML.lib \ 125 140 $(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) 141 endif 139 142 VBoxSVC_SOURCES = \ 140 143 Logging.cpp \ … … 177 180 win32/VBoxSVC.rc 178 181 179 VBoxSVC_SOURCES.linux = \ 182 ifdef VBOX_WITH_XPCOM 183 VBoxSVC_SOURCES += \ 180 184 linux/server.cpp 185 endif 181 186 182 187 ifdef VBOX_WITH_USB … … 224 229 VBoxC_LDFLAGS.win = /MANIFEST 225 230 endif 231 ifdef VBOX_WITH_XPCOM 226 232 VBoxC_LIBS = \ 233 $(TARGET_VBoxXPCOM) \ 234 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \ 235 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) 236 else 237 VBoxC_LIBS = \ 238 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) 239 endif 240 VBoxC_LIBS += \ 227 241 $(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) 243 243 VBoxC_SOURCES = \ 244 244 Logging.cpp \ … … 266 266 win32/VBoxC.def \ 267 267 win32/VBoxC.rc 268 VBoxC_SOURCES.linux = \ 268 ifdef VBOX_WITH_XPCOM 269 VBoxC_SOURCES += \ 269 270 linux/module.cpp 271 endif 270 272 271 273 ifdef VBOX_WITH_HGCM 272 VBoxC_SOURCES 273 274 275 274 VBoxC_SOURCES += \ 275 hgcm/HGCMObjects.cpp \ 276 hgcm/HGCMThread.cpp \ 277 hgcm/HGCM.cpp 276 278 endif 277 279 278 280 ifdef VBOX_WITH_USB 279 VBoxC_SOURCES 281 VBoxC_SOURCES += \ 280 282 RemoteUSBBackend.cpp 281 283 endif … … 297 299 xml/cfgldr.cpp \ 298 300 xml/cfgldrhlp.cpp 301 ifdef VBOX_WITH_XPCOM 299 302 VBoxXML_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) 305 endif 303 306 304 307 ## @todo (dmik): temporarily embed SettingsConverter.xsl into VBoxXML, … … 325 328 include \ 326 329 $(PATH_TARGET) 330 ifdef VBOX_WITH_XPCOM 327 331 tstCFGLdr_LIBS = \ 332 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) 333 endif 334 tstCFGLdr_LIBS += \ 328 335 $(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)336 336 337 337 … … 394 394 395 395 VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd 396 VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd 396 397 VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd 397 398 VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd … … 431 432 432 433 # 433 # Creates the symlinks necessary for making XPCOM work. 434 # Creates the symlinks necessary for making XPCOM work. 434 435 # 435 436 xpcom-components_INST = bin/components/ … … 536 537 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS) 537 538 538 if eq ($(BUILD_TARGET),linux)539 ifdef VBOX_WITH_XPCOM 539 540 540 541 testidl: $(IDLFILE) $(IDLTYPELIB) -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r1 r606 385 385 return E_INVALIDARG; 386 386 #endif 387 #ifdef __LINUX__387 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 388 388 // empty strings are not allowed as path names 389 389 if (hostInterface && !(*hostInterface)) … … 409 409 } 410 410 411 #ifdef __LINUX__411 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 412 412 /** 413 413 * Returns the TAP file descriptor the adapter is attached to … … 565 565 } 566 566 567 #endif /* __LINUX__*/567 #endif /* VBOX_WITH_UNIXY_TAP_NETWORKING */ 568 568 569 569 /** … … 944 944 mData->mHostInterface = ""; 945 945 #endif 946 #ifdef __LINUX__946 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 947 947 mData->mHostInterface.setNull(); 948 948 mData->mTAPFD = NIL_RTFILE; -
trunk/src/VBox/Main/SessionImpl.cpp
r1 r606 22 22 #if defined(__WIN__) 23 23 #elif defined(__LINUX__) 24 #endif 25 26 #ifdef VBOX_WITH_SYS_V_IPC_SESSION_WATCHER 24 27 # include <errno.h> 25 28 # include <sys/types.h> … … 91 94 mIPCSem = NULL; 92 95 mIPCThreadSem = NULL; 93 #elif defined( __LINUX__)96 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 94 97 mIPCSem = -1; 95 98 #endif … … 627 630 #if defined(__WIN32__) 628 631 Assert (!mIPCSem && !mIPCThreadSem); 629 #elif defined( __LINUX__)632 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 630 633 Assert (mIPCSem == -1); 631 634 #endif … … 770 773 } 771 774 772 #elif defined( __LINUX__)775 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 773 776 774 777 Utf8Str semName = ipcId; … … 811 814 ::CloseHandle (mIPCThreadSem); 812 815 } 813 #elif defined( __LINUX__)816 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 814 817 if (mIPCSem >= 0) 815 818 { -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r1 r606 306 306 #if defined(__WIN__) 307 307 unconst (mWatcherData.mUpdateReq) = ::CreateEvent (NULL, FALSE, FALSE, NULL); 308 #el if defined(__LINUX__)308 #else 309 309 RTSemEventCreate (&unconst (mWatcherData.mUpdateReq)); 310 310 #endif … … 447 447 unconst (mWatcherData.mUpdateReq) = NULL; 448 448 } 449 #el if defined(__LINUX__)449 #else 450 450 if (mWatcherData.mUpdateReq != NIL_RTSEMEVENT) 451 451 { … … 2114 2114 * necessary (it's assumed that the ownership of this argument is passed to 2115 2115 * the user function once #startSVCHelperClient() returns a success, thus 2116 * making it responsible for the cleanup). 2116 * making it responsible for the cleanup). 2117 2117 * 2118 2118 * After the user function returns, the thread will send the SVCHlpMsg::Null … … 2120 2120 * 2121 2121 * @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 2123 2123 * @param aFunc user function to run 2124 2124 * @param aUser argument to the user function … … 2143 2143 /* create the SVCHelperClientThread() argument */ 2144 2144 std::auto_ptr <StartSVCHelperClientData> 2145 d (new StartSVCHelperClientData()); 2145 d (new StartSVCHelperClientData()); 2146 2146 AssertReturn (d.get(), E_OUTOFMEMORY); 2147 2147 … … 2154 2154 RTTHREAD tid = NIL_RTTHREAD; 2155 2155 int vrc = RTThreadCreate (&tid, SVCHelperClientThread, 2156 static_cast <void *> (d.get()), 2156 static_cast <void *> (d.get()), 2157 2157 0, RTTHREADTYPE_MAIN_WORKER, 2158 2158 RTTHREADFLAGS_WAITABLE, "SVCHelper"); … … 2168 2168 2169 2169 /** 2170 * Worker thread for startSVCHelperClient(). 2170 * Worker thread for startSVCHelperClient(). 2171 2171 */ 2172 2172 /* static */ … … 2181 2181 HRESULT rc = S_OK; 2182 2182 bool userFuncCalled = false; 2183 2183 2184 2184 do 2185 2185 { … … 2229 2229 { 2230 2230 /* Attempt to start a privileged process using the Run As dialog */ 2231 2231 2232 2232 Bstr file = exePath; 2233 2233 Bstr parameters = argsStr; 2234 2234 2235 2235 SHELLEXECUTEINFO shExecInfo; 2236 2236 2237 2237 shExecInfo.cbSize = sizeof (SHELLEXECUTEINFO); 2238 2238 2239 2239 shExecInfo.fMask = NULL; 2240 2240 shExecInfo.hwnd = NULL; … … 2245 2245 shExecInfo.nShow = SW_NORMAL; 2246 2246 shExecInfo.hInstApp = NULL; 2247 2247 2248 2248 if (!ShellExecuteEx (&shExecInfo)) 2249 2249 { … … 2290 2290 } 2291 2291 2292 if (SUCCEEDED (rc) && VBOX_FAILURE (vrc)) 2292 if (SUCCEEDED (rc) && VBOX_FAILURE (vrc)) 2293 2293 { 2294 2294 rc = setError (E_FAIL, … … 2305 2305 d->func (NULL, NULL, d->user, NULL); 2306 2306 } 2307 2307 2308 2308 d->progress->notifyComplete (rc); 2309 2309 … … 2330 2330 #if defined(__WIN__) 2331 2331 ::SetEvent (mWatcherData.mUpdateReq); 2332 #el if defined(__LINUX__)2332 #else 2333 2333 RTSemEventSignal (mWatcherData.mUpdateReq); 2334 2334 #endif … … 4297 4297 ::CoUninitialize(); 4298 4298 4299 #el if defined(__LINUX__)4299 #else 4300 4300 4301 4301 bool need_update = false; -
trunk/src/VBox/Main/include/ConsoleImpl.h
r436 r606 66 66 return setError (E_ACCESSDENIED, tr ("The console is not powered up")); \ 67 67 } 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 68 76 69 77 // Console … … 395 403 #ifdef VRDP_MC 396 404 int m_cAudioRefs; 397 405 398 406 static DECLCALLBACK(int) vrdp_ClientLogon (void *pvUser, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); 399 407 static DECLCALLBACK(void) vrdp_ClientConnect (void *pvUser, uint32_t u32ClientId); … … 463 471 PPDMLED mapIDELeds[4]; 464 472 PPDMLED mapNetworkLeds[8]; 465 #ifdef __LINUX__473 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 466 474 Utf8Str maTAPDeviceName[8]; 467 475 RTFILE maTapFD[8]; -
trunk/src/VBox/Main/include/MachineImpl.h
r1 r606 160 160 BOOL mAccessible; 161 161 com::ErrorInfo mAccessError; 162 162 163 163 MachineState_T mMachineState; 164 164 LONG64 mLastStateChange; … … 274 274 275 275 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (Machine) 276 276 277 277 DECLARE_NOT_AGGREGATABLE(Machine) 278 278 … … 414 414 int calculateFullPath (const char *aPath, Utf8Str &aResult); 415 415 void calculateRelativePath (const char *aPath, Utf8Str &aResult); 416 416 417 417 void getLogFolder (Utf8Str &aLogFolder); 418 418 … … 440 440 441 441 HRESULT registeredInit(); 442 442 443 443 inline Machine *machine(); 444 444 … … 694 694 HANDLE mIPCSem; 695 695 Bstr mIPCSemName; 696 #elif defined( __LINUX__)696 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 697 697 int mIPCSem; 698 698 #endif -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r1 r606 45 45 , mHostInterface ("") // cannot be null 46 46 #endif 47 #ifdef __LINUX__47 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 48 48 , mTAPFD (NIL_RTFILE) 49 49 #endif … … 61 61 mTraceEnabled == that.mTraceEnabled && 62 62 mHostInterface == that.mHostInterface && 63 #ifdef __LINUX__63 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 64 64 mTAPSetupApplication == that.mTAPSetupApplication && 65 65 mTAPTerminateApplication == that.mTAPTerminateApplication && … … 78 78 Bstr mTraceFile; 79 79 Bstr mHostInterface; 80 #ifdef __LINUX__80 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 81 81 Bstr mTAPSetupApplication; 82 82 Bstr mTAPTerminateApplication; … … 117 117 STDMETHOD(COMGETTER(HostInterface))(BSTR *hostInterface); 118 118 STDMETHOD(COMSETTER(HostInterface))(INPTR BSTR hostInterface); 119 #ifdef __LINUX__119 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING 120 120 STDMETHOD(COMGETTER(TAPFileDescriptor))(LONG *tapFileDescriptor); 121 121 STDMETHOD(COMSETTER(TAPFileDescriptor))(LONG tapFileDescriptor); -
trunk/src/VBox/Main/include/SessionImpl.h
r1 r606 28 28 #ifdef __WIN__ 29 29 #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 30 41 #endif 31 42 … … 117 128 HANDLE mIPCSem; 118 129 HANDLE mIPCThreadSem; 119 #elif defined( __LINUX__)130 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 120 131 int mIPCSem; 132 #else 133 # error "PORTME" 121 134 #endif 122 135 }; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r1 r606 253 253 254 254 const Bstr &settingsFileName() { return mData.mCfgFile.mName; } 255 255 256 256 /* for VirtualBoxSupportErrorInfoImpl */ 257 257 static const wchar_t *getComponentName() { return L"VirtualBox"; } … … 353 353 #if defined(__WIN__) 354 354 : mUpdateReq (NULL) 355 #el if defined(__LINUX__)355 #else 356 356 : mUpdateReq (NIL_RTSEMEVENT) 357 357 #endif … … 361 361 #if defined(__WIN__) 362 362 const HANDLE mUpdateReq; 363 #el if defined(__LINUX__)363 #else 364 364 const RTSEMEVENT mUpdateReq; 365 365 #endif -
trunk/src/VBox/Main/include/VirtualBoxXMLUtil.h
r1 r606 40 40 #elif defined (__LINUX__) 41 41 # define VBOX_XML_PLATFORM "linux" 42 #elif defined (__DARWIN__) 43 # define VBOX_XML_PLATFORM "macosx" 42 44 #else 43 45 # error Unsupported platform! -
trunk/src/VBox/Main/linux/server.cpp
r1 r606 56 56 57 57 // for the backtrace signal handler 58 #if defined(DEBUG) 58 #if defined(DEBUG) && defined(__LINUX__) 59 59 # define USE_BACKTRACE 60 60 #endif -
trunk/src/VBox/Main/xml/VirtualBox-settings-macosx.xsd
r588 r606 4 4 * :folding=explicit:collapseFolds=1: 5 5 * 6 * InnoTek VirtualBox Settings Schema Version 1.0- linux6 * InnoTek VirtualBox Settings Schema Version 1.0-macosx 7 7 8 8 * Copyright (C) 2006 InnoTek Systemberatung GmbH … … 31 31 <xsd:annotation> 32 32 <xsd:documentation xml:lang="en"> 33 InnoTek VirtualBox Settings Schema Version 1.0- linux.33 InnoTek VirtualBox Settings Schema Version 1.0-macosx. 34 34 Copyright (c) 2004-2005 InnoTek Systemberatung GmbH. 35 35 </xsd:documentation> … … 53 53 <xsd:restriction base="xsd:unsignedInt"> 54 54 <xsd:minInclusive value="4"/> 55 <xsd:maxInclusive value=" 2000"/>55 <xsd:maxInclusive value="3000"/> 56 56 </xsd:restriction> 57 57 </xsd:simpleType> … … 96 96 <xsd:restriction base="xsd:token"> 97 97 <xsd:enumeration value="null"/> 98 <xsd:enumeration value="oss"/>99 <xsd:enumeration value="alsa"/>100 98 </xsd:restriction> 101 99 </xsd:simpleType> … … 112 110 <xsd:complexContent> 113 111 <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"/> 115 113 </xsd:extension> 116 114 </xsd:complexContent>
Note:
See TracChangeset
for help on using the changeset viewer.