Changeset 48989 in vbox
- Timestamp:
- Oct 9, 2013 7:05:31 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 89707
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r48710 r48989 155 155 HRESULT updateMacAddress(Utf8Str aMacAddress); 156 156 void updateBandwidthGroup(BandwidthGroup *aBwGroup); 157 HRESULT checkAndSwitchFromNatNetworking( );157 HRESULT checkAndSwitchFromNatNetworking(IN_BSTR aNatNetworkName); 158 158 HRESULT switchToNatNetworking(IN_BSTR aNatNetworkName); 159 159 -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r48988 r48989 484 484 } 485 485 486 #if 0 // later 487 alock.release(); 488 HRESULT hrc = checkAndSwitchFromNatNetworking(); 489 if (FAILED(hrc)) 490 return hrc; 491 alock.acquire(); 492 #endif 493 486 NetworkAttachmentType_T oldAttachmentType = mData->mAttachmentType; 494 487 mData->mAttachmentType = aAttachmentType; 495 496 #if 0 // later497 alock.release();498 if (aAttachmentType == NetworkAttachmentType_NATNetwork)499 {500 hrc = switchToNatNetworking(mData->mNATNetwork.raw());501 if (FAILED(hrc))502 return hrc;503 }504 alock.acquire();505 #endif506 488 507 489 m_fModified = true; … … 512 494 mParent->setModified(Machine::IsModified_NetworkAdapters); 513 495 mlock.release(); 496 497 if (oldAttachmentType == NetworkAttachmentType_NATNetwork) 498 checkAndSwitchFromNatNetworking(mData->mNATNetwork.raw()); 499 500 if (aAttachmentType == NetworkAttachmentType_NATNetwork) 501 switchToNatNetworking(mData->mNATNetwork.raw()); 514 502 515 503 /* Adapt the CFGM logic and notify the guest => changeAdapter=TRUE. */ … … 728 716 { 729 717 730 HRESULT hrc;731 718 /* if an empty/null string is to be set, host only interface must be 732 719 * turned off */ … … 740 727 mData.backup(); 741 728 742 alock.release(); 743 744 hrc = checkAndSwitchFromNatNetworking(); 745 if (FAILED(hrc)) 746 return hrc; 747 748 hrc = switchToNatNetworking(aNATNetwork); 749 if (FAILED(hrc)) 750 return hrc; 751 752 alock.acquire(); 753 729 Bstr oldNatNetworkName = mData->mNATNetwork; 754 730 mData->mNATNetwork = aNATNetwork; 755 731 … … 761 737 mParent->setModified(Machine::IsModified_NetworkAdapters); 762 738 mlock.release(); 739 740 checkAndSwitchFromNatNetworking(oldNatNetworkName.raw()); 741 742 switchToNatNetworking(aNATNetwork); 763 743 764 744 /* When changing the host adapter, adapt the CFGM logic to make this … … 1585 1565 1586 1566 1587 HRESULT NetworkAdapter::checkAndSwitchFromNatNetworking( )1567 HRESULT NetworkAdapter::checkAndSwitchFromNatNetworking(IN_BSTR networkName) 1588 1568 { 1589 1569 HRESULT hrc; … … 1599 1579 Bstr bstrName; 1600 1580 hrc = mParent->COMGETTER(Name)(bstrName.asOutParam()); 1601 LogRel(("VM '%ls' stops using NAT network '%ls'\n", bstrName.raw(), mData->mNATNetwork.raw()));1602 int natCount = mParent->getVirtualBox()->natNetworkRefDec( mData->mNATNetwork.raw());1581 LogRel(("VM '%ls' stops using NAT network '%ls'\n", bstrName.raw(), networkName)); 1582 int natCount = mParent->getVirtualBox()->natNetworkRefDec(networkName); 1603 1583 if (natCount == -1) 1604 1584 return E_INVALIDARG; /* no such network */
Note:
See TracChangeset
for help on using the changeset viewer.