- Timestamp:
- Jun 19, 2009 2:13:31 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48843
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r20720 r20727 3244 3244 3245 3245 #ifdef VBOX_DYNAMIC_NET_ATTACH 3246 if (VBOX_SUCCESS (vrc) && 3247 !((eAttachmentType == meAttachmentType[ulInstance]) || 3248 (eAttachmentType == NetworkAttachmentType_Null && 3249 meAttachmentType[ulInstance] == NetworkAttachmentType_Null))) 3250 { 3251 rc = doNetworkAdapterChange(pszAdapterName, 3252 ulInstance, 0, 3253 eAttachmentType, 3254 &meAttachmentType[ulInstance], 3255 aNetworkAdapter); 3256 } 3246 if (VBOX_SUCCESS (vrc) && !(eAttachmentType == meAttachmentType[ulInstance])) 3247 rc = doNetworkAdapterChange(pszAdapterName, ulInstance, 0, aNetworkAdapter); 3257 3248 #endif /* VBOX_DYNAMIC_NET_ATTACH */ 3258 3249 … … 3284 3275 * @param uInstance The PDM device instance. 3285 3276 * @param uLun The PDM LUN number of the drive. 3286 * @param eAttachmentType The new attachment type.3287 * @param meAttachmentType The current attachment type.3288 3277 * @param aNetworkAdapter The network adapter whose attachment needs to be changed 3289 3278 * 3290 3279 * @note Locks this object for writing. 3291 3280 */ 3292 HRESULT Console::doNetworkAdapterChange (const char *pszDevice, unsigned uInstance,3293 unsigned u Lun, NetworkAttachmentType_T eAttachmentType,3294 NetworkAttachmentType_T *meAttachmentType,3281 HRESULT Console::doNetworkAdapterChange (const char *pszDevice, 3282 unsigned uInstance, 3283 unsigned uLun, 3295 3284 INetworkAdapter *aNetworkAdapter) 3296 3285 { 3297 LogFlowThisFunc (("pszDevice=%p:{%s} uInstance=%u uLun=%u eAttachmentType=%d " 3298 "meAttachmentType=%p:{%d} aNetworkAdapter=%p\n", 3299 pszDevice, pszDevice, uInstance, uLun, eAttachmentType, 3300 meAttachmentType, *meAttachmentType, aNetworkAdapter)); 3286 LogFlowThisFunc (("pszDevice=%p:{%s} uInstance=%u uLun=%u aNetworkAdapter=%p\n", 3287 pszDevice, pszDevice, uInstance, uLun, aNetworkAdapter)); 3301 3288 3302 3289 AutoCaller autoCaller (this); … … 3317 3304 PVMREQ pReq; 3318 3305 int vrc = VMR3ReqCall (mpVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, 3319 (PFNRT) Console::changeNetworkAttachment, 7, 3320 this, pszDevice, uInstance, uLun, eAttachmentType, 3321 meAttachmentType, aNetworkAdapter); 3306 (PFNRT) Console::changeNetworkAttachment, 5, 3307 this, pszDevice, uInstance, uLun, aNetworkAdapter); 3322 3308 3323 3309 /* leave the lock before waiting for a result (EMT will call us back!) */ … … 3353 3339 * @param uInstance The PDM device instance. 3354 3340 * @param uLun The PDM LUN number of the drive. 3355 * @param eAttachmentType The new attachment type.3356 * @param meAttachmentType The current attachment type.3357 3341 * @param aNetworkAdapter The network adapter whose attachment needs to be changed 3358 3342 * … … 3360 3344 * @note Locks the Console object for writing. 3361 3345 */ 3362 DECLCALLBACK(int) Console::changeNetworkAttachment (Console *pThis, const char *pszDevice,3363 unsigned uInstance, unsigned uLun,3364 NetworkAttachmentType_T eAttachmentType,3365 NetworkAttachmentType_T *meAttachmentType,3346 DECLCALLBACK(int) Console::changeNetworkAttachment (Console *pThis, 3347 const char *pszDevice, 3348 unsigned uInstance, 3349 unsigned uLun, 3366 3350 INetworkAdapter *aNetworkAdapter) 3367 3351 { 3368 LogFlowFunc (("pThis=%p pszDevice=%p:{%s} uInstance=%u uLun=%u eAttachmentType=%d " 3369 "meAttachmentType=%p{%d} aNetworkAdapter=%p\n", 3370 pThis, pszDevice, pszDevice, uInstance, uLun, eAttachmentType, 3371 meAttachmentType, *meAttachmentType, aNetworkAdapter)); 3352 LogFlowFunc (("pThis=%p pszDevice=%p:{%s} uInstance=%u uLun=%u aNetworkAdapter=%p\n", 3353 pThis, pszDevice, pszDevice, uInstance, uLun, aNetworkAdapter)); 3372 3354 3373 3355 AssertReturn (pThis, VERR_INVALID_PARAMETER); … … 3433 3415 * failing to attach. 3434 3416 */ 3435 rcRet = configNetwork(pThis, pszDevice, uInstance, uLun, eAttachmentType, meAttachmentType, 3436 aNetworkAdapter, pCfg, pLunL0, pInst, true); 3417 rcRet = configNetwork(pThis, pszDevice, uInstance, uLun, aNetworkAdapter, pCfg, pLunL0, pInst, true); 3437 3418 3438 3419 /* -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r20705 r20727 1351 1351 * Configure the network card now 1352 1352 */ 1353 NetworkAttachmentType_T networkAttachment; 1354 hrc = networkAdapter->COMGETTER(AttachmentType)(&networkAttachment); H(); 1355 1356 rc = configNetwork((Console*) pvConsole, pszAdapterName, ulInstance, 0, networkAttachment, 1357 &meAttachmentType[ulInstance], networkAdapter, pCfg, pLunL0, pInst, false); 1353 1354 rc = configNetwork(pConsole, pszAdapterName, ulInstance, 0, networkAdapter, pCfg, pLunL0, pInst, false); 1358 1355 RC_CHECK(); 1359 1356 } … … 2054 2051 * @param uInstance The PDM device instance. 2055 2052 * @param uLun The PDM LUN number of the drive. 2056 * @param eAttachmentType The new attachment type.2057 * @param meAttachmentType The current attachment type.2058 2053 * @param aNetworkAdapter The network adapter whose attachment needs to be changed 2059 2054 * … … 2062 2057 DECLCALLBACK(int) Console::configNetwork(Console *pThis, const char *pszDevice, 2063 2058 unsigned uInstance, unsigned uLun, 2064 NetworkAttachmentType_T eAttachmentType,2065 NetworkAttachmentType_T *meAttachmentType,2066 2059 INetworkAdapter *aNetworkAdapter, 2067 2060 PCFGMNODE pCfg, PCFGMNODE pLunL0, … … 2145 2138 2146 2139 Bstr networkName, trunkName, trunkType; 2140 NetworkAttachmentType_T eAttachmentType; 2141 hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType); 2142 H(); 2147 2143 switch (eAttachmentType) 2148 2144 { … … 2847 2843 } 2848 2844 2845 { 2846 /** @todo r=pritesh: get the dhcp server name from the 2847 * previous network configuration and then stop the server 2848 * else it may conflict with the dhcp server running with 2849 * the current attachment type 2850 */ 2851 /* Stop the hostonly DHCP Server */ 2852 } 2853 2849 2854 if(!networkName.isNull()) 2850 2855 { … … 2884 2889 } 2885 2890 2886 *meAttachmentType= eAttachmentType;2891 meAttachmentType[uInstance] = eAttachmentType; 2887 2892 } 2888 2893 while (0); -
trunk/src/VBox/Main/include/ConsoleImpl.h
r20631 r20727 432 432 static DECLCALLBACK(int) configNetwork(Console *pThis, const char *pszDevice, 433 433 unsigned uInstance, unsigned uLun, 434 NetworkAttachmentType_T eAttachmentType,435 NetworkAttachmentType_T *meAttachmentType,436 434 INetworkAdapter *aNetworkAdapter, 437 435 PCFGMNODE pCfg, PCFGMNODE pLunL0, … … 449 447 #ifdef VBOX_DYNAMIC_NET_ATTACH 450 448 HRESULT doNetworkAdapterChange (const char *pszDevice, unsigned uInstance, 451 unsigned uLun, NetworkAttachmentType_T eAttachmentType, 452 NetworkAttachmentType_T *meAttachmentType, 453 INetworkAdapter *aNetworkAdapter); 449 unsigned uLun, INetworkAdapter *aNetworkAdapter); 454 450 static DECLCALLBACK(int) changeNetworkAttachment (Console *pThis, const char *pszDevice, 455 451 unsigned uInstance, unsigned uLun, 456 NetworkAttachmentType_T eAttachmentType,457 NetworkAttachmentType_T *meAttachmentType,458 452 INetworkAdapter *aNetworkAdapter); 459 453 #endif /* VBOX_DYNAMIC_NET_ATTACH */
Note:
See TracChangeset
for help on using the changeset viewer.