Changeset 49738 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Dec 2, 2013 12:52:51 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 91037
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/BandwidthControlImpl.cpp
r49644 r49738 115 115 m->llBandwidthGroups.allocate(); 116 116 BandwidthGroupList::const_iterator it; 117 for (it = aThat->m->llBandwidthGroups->begin();118 it != aThat->m->llBandwidthGroups->end();119 ++it)117 for (it = aThat->m->llBandwidthGroups->begin(); 118 it != aThat->m->llBandwidthGroups->end(); 119 ++it) 120 120 { 121 121 ComObjPtr<BandwidthGroup> group; … … 157 157 m->llBandwidthGroups.allocate(); 158 158 BandwidthGroupList::const_iterator it; 159 for (it = aThat->m->llBandwidthGroups->begin();160 it != aThat->m->llBandwidthGroups->end();161 ++it)159 for (it = aThat->m->llBandwidthGroups->begin(); 160 it != aThat->m->llBandwidthGroups->end(); 161 ++it) 162 162 { 163 163 ComObjPtr<BandwidthGroup> group; … … 178 178 * represented by @a aThat (locked for reading). 179 179 */ 180 void BandwidthControl::i_copyFrom 181 { 182 AssertReturnVoid 180 void BandwidthControl::i_copyFrom(BandwidthControl *aThat) 181 { 182 AssertReturnVoid(aThat != NULL); 183 183 184 184 /* sanity */ 185 185 AutoCaller autoCaller(this); 186 AssertComRCReturnVoid 186 AssertComRCReturnVoid(autoCaller.rc()); 187 187 188 188 /* sanity too */ 189 AutoCaller thatCaller 190 AssertComRCReturnVoid 189 AutoCaller thatCaller(aThat); 190 AssertComRCReturnVoid(thatCaller.rc()); 191 191 192 192 /* even more sanity */ 193 193 AutoAnyStateDependency adep(m->pParent); 194 AssertComRCReturnVoid 194 AssertComRCReturnVoid(adep.rc()); 195 195 /* Machine::copyFrom() may not be called when the VM is running */ 196 AssertReturnVoid (!Global::IsOnline(adep.machineState()));196 AssertReturnVoid(!Global::IsOnline(adep.machineState())); 197 197 198 198 /* peer is not modified, lock it for reading (aThat is "master" so locked … … 205 205 m->llBandwidthGroups->clear(); 206 206 BandwidthGroupList::const_iterator it; 207 for (it = aThat->m->llBandwidthGroups->begin();208 it != aThat->m->llBandwidthGroups->end();209 ++it)207 for (it = aThat->m->llBandwidthGroups->begin(); 208 it != aThat->m->llBandwidthGroups->end(); 209 ++it) 210 210 { 211 211 ComObjPtr<BandwidthGroup> group; 212 212 group.createObject(); 213 group->initCopy 213 group->initCopy(this, *it); 214 214 m->llBandwidthGroups->push_back(group); 215 215 } … … 235 235 /* unitialize all new groups (absent in the backed up list). */ 236 236 BandwidthGroupList *backedList = m->llBandwidthGroups.backedUpData(); 237 for (it = m->llBandwidthGroups->begin();238 it != m->llBandwidthGroups->end();239 ++it)237 for (it = m->llBandwidthGroups->begin(); 238 it != m->llBandwidthGroups->end(); 239 ++it) 240 240 { 241 241 if ( std::find(backedList->begin(), backedList->end(), *it) … … 249 249 250 250 /* rollback any changes to groups after restoring the list */ 251 for (it = m->llBandwidthGroups->begin();252 it != m->llBandwidthGroups->end();253 ++it)251 for (it = m->llBandwidthGroups->begin(); 252 it != m->llBandwidthGroups->end(); 253 ++it) 254 254 (*it)->i_rollback(); 255 255 } … … 272 272 * peers for those who have peers) */ 273 273 BandwidthGroupList *newList = new BandwidthGroupList(); 274 for(it = m->llBandwidthGroups->begin(); it != m->llBandwidthGroups->end(); ++it) 274 for (it = m->llBandwidthGroups->begin(); 275 it != m->llBandwidthGroups->end(); 276 ++it) 275 277 { 276 278 (*it)->i_commit(); … … 292 294 /* and add it to the new list */ 293 295 newList->push_back(peer); 294 295 ++it;296 296 } 297 297 298 298 /* uninit old peer's controllers that are left */ 299 for (it = m->pPeer->m->llBandwidthGroups->begin();300 it != m->pPeer->m->llBandwidthGroups->end();301 ++it)299 for (it = m->pPeer->m->llBandwidthGroups->begin(); 300 it != m->pPeer->m->llBandwidthGroups->end(); 301 ++it) 302 302 (*it)->uninit(); 303 303 … … 321 321 if (commitBandwidthGroups) 322 322 { 323 for (it = m->llBandwidthGroups->begin();324 it != m->llBandwidthGroups->end();325 ++it)323 for (it = m->llBandwidthGroups->begin(); 324 it != m->llBandwidthGroups->end(); 325 ++it) 326 326 (*it)->i_commit(); 327 327 } … … 482 482 aBandwidthGroups.resize(0); 483 483 BandwidthGroupList::const_iterator it; 484 for (it = m->llBandwidthGroups->begin();485 it != m->llBandwidthGroups->end();486 ++it)484 for (it = m->llBandwidthGroups->begin(); 485 it != m->llBandwidthGroups->end(); 486 ++it) 487 487 aBandwidthGroups.push_back(*it); 488 488 … … 497 497 AssertComRCReturnRC(autoCaller.rc()); 498 498 settings::BandwidthGroupList::const_iterator it; 499 for (it = data.llBandwidthGroups.begin();500 it != data.llBandwidthGroups.end();501 ++it)499 for (it = data.llBandwidthGroups.begin(); 500 it != data.llBandwidthGroups.end(); 501 ++it) 502 502 { 503 503 const settings::BandwidthGroup &gr = *it; … … 517 517 data.llBandwidthGroups.clear(); 518 518 BandwidthGroupList::const_iterator it; 519 for (it = m->llBandwidthGroups->begin();520 it != m->llBandwidthGroups->end();521 ++it)519 for (it = m->llBandwidthGroups->begin(); 520 it != m->llBandwidthGroups->end(); 521 ++it) 522 522 { 523 523 AutoWriteLock groupLock(*it COMMA_LOCKVAL_SRC_POS); -
trunk/src/VBox/Main/src-server/BandwidthGroupImpl.cpp
r49644 r49738 127 127 128 128 unconst(aThat->m->pPeer) = this; 129 m->bd.attach 129 m->bd.attach(aThat->m->bd); 130 130 } 131 131 else … … 134 134 135 135 AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS); 136 m->bd.share 136 m->bd.share(aThat->m->bd); 137 137 } 138 138 … … 271 271 /* sanity */ 272 272 AutoCaller autoCaller(this); 273 AssertComRCReturnVoid 273 AssertComRCReturnVoid(autoCaller.rc()); 274 274 275 275 /* sanity too */ 276 AutoCaller peerCaller 277 AssertComRCReturnVoid 276 AutoCaller peerCaller(m->pPeer); 277 AssertComRCReturnVoid(peerCaller.rc()); 278 278 279 279 /* lock both for writing since we modify both (m->pPeer is "master" so locked … … 287 287 { 288 288 // attach new data to the peer and reshare it 289 m->pPeer->m->bd.attach 289 m->pPeer->m->bd.attach(m->bd); 290 290 } 291 291 } … … 304 304 /* sanity */ 305 305 AutoCaller autoCaller(this); 306 AssertComRCReturnVoid 306 AssertComRCReturnVoid(autoCaller.rc()); 307 307 308 308 /* sanity too */ 309 AutoCaller peerCaller 310 AssertComRCReturnVoid 309 AutoCaller peerCaller(m->pPeer); 310 AssertComRCReturnVoid(peerCaller.rc()); 311 311 312 312 /* peer is not modified, lock it for reading (m->pPeer is "master" so locked
Note:
See TracChangeset
for help on using the changeset viewer.