Changeset 81394 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 21, 2019 9:16:17 AM (5 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MachineImplMoveVM.h
r81393 r81394 66 66 class MachineMoveVM : public ThreadTask 67 67 { 68 std::vector<ComObjPtr<Machine> > machineList; 68 69 RTCList<MEDIUMTASKCHAINMOVE> m_llMedias; 69 70 RTCList<SAVESTATETASKMOVE> m_llSaveStateFiles; … … 110 111 111 112 private: 112 HRESULT createMachineList(const ComPtr<ISnapshot> &pSnapshot , std::vector<ComObjPtr<Machine> > &aMachineList) const;113 HRESULT createMachineList(const ComPtr<ISnapshot> &pSnapshot); 113 114 inline HRESULT queryBaseName(const ComPtr<IMedium> &pMedium, Utf8Str &strBaseName) const; 114 HRESULT queryMediasForAllStates( const std::vector<ComObjPtr<Machine> > &aMachineList);115 HRESULT queryMediasForAllStates(); 115 116 void updateProgressStats(MEDIUMTASKCHAINMOVE &mtc, ULONG &uCount, ULONG &uTotalWeight) const; 116 117 HRESULT addSaveState(const ComObjPtr<Machine> &machine); -
trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp
r81393 r81394 30 30 #include "LoggingNew.h" 31 31 32 /* This variable is global and used in the different places so it must be cleared each time before usage to avoid failure */33 std::vector<ComObjPtr<Machine> > machineList;34 35 32 typedef std::multimap<Utf8Str, Utf8Str> list_t; 36 33 typedef std::multimap<Utf8Str, Utf8Str>::const_iterator cit_t; … … 292 289 Utf8Str strTargetImageName; 293 290 294 /* Global variable (defined at the beginning of file), so clear it before usage */295 machineList.clear();296 291 machineList.push_back(m_pMachine); 297 292 … … 311 306 if (FAILED(hrc)) 312 307 return hrc; 313 hrc = createMachineList(pSnapshot , machineList);308 hrc = createMachineList(pSnapshot); 314 309 if (FAILED(hrc)) 315 310 return hrc; … … 321 316 322 317 /* The lists m_llMedias and m_llSaveStateFiles are filled in the queryMediasForAllStates() */ 323 hrc = queryMediasForAllStates( machineList);318 hrc = queryMediasForAllStates(); 324 319 if (FAILED(hrc)) 325 320 return hrc; … … 1322 1317 } 1323 1318 1324 HRESULT MachineMoveVM::createMachineList(const ComPtr<ISnapshot> &pSnapshot, 1325 std::vector<ComObjPtr<Machine> > &aMachineList) const 1319 HRESULT MachineMoveVM::createMachineList(const ComPtr<ISnapshot> &pSnapshot) 1326 1320 { 1327 1321 Bstr name; … … 1332 1326 rc = pSnapshot->COMGETTER(Machine)(l_pMachine.asOutParam()); 1333 1327 if (FAILED(rc)) return rc; 1334 aMachineList.push_back((Machine*)(IMachine*)l_pMachine);1328 machineList.push_back((Machine*)(IMachine*)l_pMachine); 1335 1329 1336 1330 SafeIfaceArray<ISnapshot> sfaChilds; … … 1339 1333 for (size_t i = 0; i < sfaChilds.size(); ++i) 1340 1334 { 1341 rc = createMachineList(sfaChilds[i] , aMachineList);1335 rc = createMachineList(sfaChilds[i]); 1342 1336 if (FAILED(rc)) return rc; 1343 1337 } … … 1346 1340 } 1347 1341 1348 HRESULT MachineMoveVM::queryMediasForAllStates( const std::vector<ComObjPtr<Machine> > &aMachineList)1342 HRESULT MachineMoveVM::queryMediasForAllStates() 1349 1343 { 1350 1344 /* In this case we create a exact copy of the original VM. This means just … … 1352 1346 * list. */ 1353 1347 HRESULT rc = S_OK; 1354 for (size_t i = 0; i < aMachineList.size(); ++i)1355 { 1356 const ComObjPtr<Machine> &machine = aMachineList.at(i);1348 for (size_t i = 0; i < machineList.size(); ++i) 1349 { 1350 const ComObjPtr<Machine> &machine = machineList.at(i); 1357 1351 1358 1352 /* Add all attachments (and their parents) of the different
Note:
See TracChangeset
for help on using the changeset viewer.