Changeset 50652 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 28, 2014 3:41:58 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r50651 r50652 13066 13066 } 13067 13067 13068 /* Remove all references to the NAT network service. The service will stop 13069 * if all references (also from other VMs) are removed. */ 13068 13070 for (; miNATNetworksStarted > 0; miNATNetworksStarted--) 13069 13071 { … … 13259 13261 mData->mSession.mProgress->setOtherProgressObject(aProgress); 13260 13262 13261 for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)13262 {13263 NetworkAttachmentType_T type;13264 HRESULT hrc;13265 hrc = mNetworkAdapters[slot]->COMGETTER(AttachmentType)(&type);13266 if ( SUCCEEDED(hrc)13267 && type == NetworkAttachmentType_NATNetwork)13268 {13269 Bstr name;13270 hrc = mNetworkAdapters[slot]->COMGETTER(NATNetwork)(name.asOutParam());13271 if (SUCCEEDED(hrc))13263 /* If we didn't reference the NAT network service yet, add a reference to 13264 * force a start */ 13265 if (miNATNetworksStarted < 1) 13266 { 13267 for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++) 13268 { 13269 NetworkAttachmentType_T type; 13270 HRESULT hrc; 13271 hrc = mNetworkAdapters[slot]->COMGETTER(AttachmentType)(&type); 13272 if ( SUCCEEDED(hrc) 13273 && type == NetworkAttachmentType_NATNetwork) 13272 13274 { 13273 LogRel(("VM '%s' starts using NAT network '%ls'\n", 13274 mUserData->s.strName.c_str(), name.raw())); 13275 mPeer->lockHandle()->unlockWrite(); 13276 mParent->i_natNetworkRefInc(name.raw()); 13275 Bstr name; 13276 hrc = mNetworkAdapters[slot]->COMGETTER(NATNetwork)(name.asOutParam()); 13277 if (SUCCEEDED(hrc)) 13278 { 13279 LogRel(("VM '%s' starts using NAT network '%ls'\n", 13280 mUserData->s.strName.c_str(), name.raw())); 13281 mPeer->lockHandle()->unlockWrite(); 13282 mParent->i_natNetworkRefInc(name.raw()); 13277 13283 #ifdef RT_LOCK_STRICT 13278 mPeer->lockHandle()->lockWrite(RT_SRC_POS);13284 mPeer->lockHandle()->lockWrite(RT_SRC_POS); 13279 13285 #else 13280 mPeer->lockHandle()->lockWrite();13286 mPeer->lockHandle()->lockWrite(); 13281 13287 #endif 13288 } 13282 13289 } 13283 13290 } 13284 } 13285 13286 miNATNetworksStarted++; 13291 miNATNetworksStarted++; 13292 } 13287 13293 13288 13294 LogFlowThisFunc(("returns S_OK.\n"));
Note:
See TracChangeset
for help on using the changeset viewer.