- Timestamp:
- Jan 30, 2023 7:44:51 PM (2 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r98351 r98352 3218 3218 3219 3219 <method name="createMedium"> 3220 <rest name="create" request="post" path="/medi ums/"/>3220 <rest name="create" request="post" path="/media/"/> 3221 3221 <desc> 3222 3222 Creates a new base medium object that will use the given storage … … 8231 8231 8232 8232 <method name="unmountMedium"> 8233 <rest name="unmount" request="post" path="/vms/{vmid}/medi ums/{mediumid}/actions/"/>8233 <rest name="unmount" request="post" path="/vms/{vmid}/media/{mediumid}/actions/"/> 8234 8234 <desc> 8235 8235 Unmounts any currently mounted medium (<link to="IMedium" />, … … 8284 8284 8285 8285 <method name="mountMedium"> 8286 <rest name="mount" request="post" path="/vms/{vmid}/medi ums/{mediumid}/actions/"/>8286 <rest name="mount" request="post" path="/vms/{vmid}/media/{mediumid}/actions/"/> 8287 8287 <desc> 8288 8288 Mounts a medium (<link to="IMedium" />, identified … … 8339 8339 8340 8340 <method name="getMedium" const="yes"> 8341 <rest name="find" request="get" path="/vms/{vmid}/medi ums/{mediumid}/"/>8341 <rest name="find" request="get" path="/vms/{vmid}/media/{mediumid}/"/> 8342 8342 <desc> 8343 8343 Returns the virtual medium attached to a device slot of the specified … … 18600 18600 18601 18601 <method name="setIds" wrap-hint-server="passcaller"> 18602 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18602 <rest request="post" path="/media/{mediumid}/configuration/"/> 18603 18603 <desc> 18604 18604 Changes the UUID and parent UUID for a hard disk medium. … … 18637 18637 18638 18638 <method name="refreshState" wrap-hint-server="passcaller"> 18639 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18639 <rest request="post" path="/media/{mediumid}/configuration/"/> 18640 18640 <desc> 18641 18641 If the current medium state (see <link to="MediumState"/>) is one of … … 18674 18674 18675 18675 <method name="getSnapshotIds"> 18676 <rest request="get" path="/medi ums/{mediumid}/configuration/"/>18676 <rest request="get" path="/media/{mediumid}/configuration/"/> 18677 18677 <desc> 18678 18678 Returns an array of UUIDs of all snapshots of the given machine where … … 18704 18704 18705 18705 <method name="lockRead"> 18706 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18706 <rest request="post" path="/media/{mediumid}/configuration/"/> 18707 18707 <desc> 18708 18708 Locks this medium for reading. … … 18766 18766 18767 18767 <method name="lockWrite"> 18768 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18768 <rest request="post" path="/media/{mediumid}/configuration/"/> 18769 18769 <desc> 18770 18770 Locks this medium for writing. … … 18820 18820 18821 18821 <method name="close" wrap-hint-server="passcaller"> 18822 <rest request="post" path="/medi ums/{mediumid}/actions/"/>18822 <rest request="post" path="/media/{mediumid}/actions/"/> 18823 18823 <desc> 18824 18824 Closes this medium. … … 18859 18859 18860 18860 <method name="getProperty" const="yes"> 18861 <rest request="get" path="/medi ums/{mediumid}/configuration/"/>18861 <rest request="get" path="/media/{mediumid}/configuration/"/> 18862 18862 <desc> 18863 18863 Returns the value of the custom medium property with the given name. … … 18883 18883 18884 18884 <method name="setProperty"> 18885 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18885 <rest request="post" path="/media/{mediumid}/configuration/"/> 18886 18886 <desc> 18887 18887 Sets the value of the custom medium property with the given name. … … 18909 18909 18910 18910 <method name="getProperties" const="yes"> 18911 <rest request="get" path="/medi ums/{mediumid}/configuration/"/>18911 <rest request="get" path="/media/{mediumid}/configuration/"/> 18912 18912 <desc> 18913 18913 Returns values for a group of properties in one call. … … 18946 18946 18947 18947 <method name="setProperties"> 18948 <rest request="post" path="/medi ums/{mediumid}/configuration/"/>18948 <rest request="post" path="/media/{mediumid}/configuration/"/> 18949 18949 <desc> 18950 18950 Sets values for a group of properties in one call. … … 18981 18981 18982 18982 <method name="createBaseStorage"> 18983 <rest request="post" path="/medi ums/{mediumid}/actions/"/>18983 <rest request="post" path="/media/{mediumid}/actions/"/> 18984 18984 <desc> 18985 18985 Starts creating a hard disk storage unit (fixed/dynamic, according … … 19016 19016 19017 19017 <method name="deleteStorage"> 19018 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19018 <rest request="post" path="/media/{mediumid}/actions/"/> 19019 19019 <desc> 19020 19020 Starts deleting the storage unit of this medium. … … 19063 19063 19064 19064 <method name="createDiffStorage" wrap-hint-server="passcaller"> 19065 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19065 <rest request="post" path="/media/{mediumid}/actions/"/> 19066 19066 <desc> 19067 19067 Starts creating an empty differencing storage unit based on this … … 19101 19101 19102 19102 <method name="mergeTo"> 19103 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19103 <rest request="post" path="/media/{mediumid}/actions/"/> 19104 19104 <desc> 19105 19105 Starts merging the contents of this medium and all intermediate … … 19184 19184 19185 19185 <method name="cloneTo"> 19186 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19186 <rest request="post" path="/media/{mediumid}/actions/"/> 19187 19187 <desc> 19188 19188 Starts creating a clone of this medium in the format and at the … … 19234 19234 19235 19235 <method name="cloneToBase"> 19236 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19236 <rest request="post" path="/media/{mediumid}/actions/"/> 19237 19237 <desc> 19238 19238 Starts creating a clone of this medium in the format and at the … … 19282 19282 19283 19283 <method name="moveTo" wrap-hint-server="passcaller"> 19284 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19284 <rest request="post" path="/media/{mediumid}/actions/"/> 19285 19285 <desc> 19286 19286 Changes the location of this medium. Some medium types may support … … 19319 19319 19320 19320 <method name="compact"> 19321 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19321 <rest request="post" path="/media/{mediumid}/actions/"/> 19322 19322 <desc> 19323 19323 Starts compacting of this medium. This means that the medium is … … 19346 19346 19347 19347 <method name="resize"> 19348 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19348 <rest request="post" path="/media/{mediumid}/actions/"/> 19349 19349 <desc> 19350 19350 Starts resizing this medium. This means that the nominal size of the … … 19378 19378 19379 19379 <method name="reset" wrap-hint-server="passcaller"> 19380 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19380 <rest request="post" path="/media/{mediumid}/actions/"/> 19381 19381 <desc> 19382 19382 Starts erasing the contents of this differencing medium. … … 19405 19405 19406 19406 <method name="changeEncryption"> 19407 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19407 <rest request="post" path="/media/{mediumid}/actions/"/> 19408 19408 <desc> 19409 19409 Starts encryption of this medium. This means that the stored data in the … … 19449 19449 19450 19450 <method name="getEncryptionSettings" const="yes" wrap-hint-server="passcaller"> 19451 <rest request="get" path="/medi ums/{mediumid}/configuration/"/>19451 <rest request="get" path="/media/{mediumid}/configuration/"/> 19452 19452 <desc> 19453 19453 Returns the encryption settings for this medium. … … 19466 19466 19467 19467 <method name="checkEncryptionPassword" const="yes"> 19468 <rest request="get" path="/medi ums/{mediumid}/configuration/"/>19468 <rest request="get" path="/media/{mediumid}/configuration/"/> 19469 19469 <desc> 19470 19470 Checks whether the supplied password is correct for the medium. … … 19499 19499 19500 19500 <method name="resizeAndCloneTo"> 19501 <rest request="post" path="/medi ums/{mediumid}/actions/"/>19501 <rest request="post" path="/media/{mediumid}/actions/"/> 19502 19502 19503 19503 <desc> -
trunk/src/VBox/Main/include/MachineImplMoveVM.h
r98103 r98352 77 77 { 78 78 std::vector<ComObjPtr<Machine> > machineList; 79 RTCList<MEDIUMTASKCHAINMOVE> m_llMedia s;79 RTCList<MEDIUMTASKCHAINMOVE> m_llMedia; 80 80 RTCList<SNAPFILETASKMOVE> m_llSaveStateFiles; 81 81 RTCList<SNAPFILETASKMOVE> m_llNVRAMFiles; 82 std::map<Utf8Str, MEDIUMTASKMOVE> m_finalMedi umsMap;82 std::map<Utf8Str, MEDIUMTASKMOVE> m_finalMediaMap; 83 83 std::map<Utf8Str, SNAPFILETASKMOVE> m_finalSaveStateFilesMap; 84 84 std::map<Utf8Str, SNAPFILETASKMOVE> m_finalNVRAMFilesMap; … … 127 127 HRESULT createMachineList(const ComPtr<ISnapshot> &pSnapshot); 128 128 inline HRESULT queryBaseName(const ComPtr<IMedium> &pMedium, Utf8Str &strBaseName) const; 129 HRESULT queryMedia sForAllStates();129 HRESULT queryMediaForAllStates(); 130 130 void updateProgressStats(MEDIUMTASKCHAINMOVE &mtc, ULONG &uCount, ULONG &uTotalWeight) const; 131 131 HRESULT addSaveState(const ComObjPtr<Machine> &machine); -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r98351 r98352 5382 5382 Progress *p, 5383 5383 const Utf8Str &t, 5384 const RTCList<ComPtr<IMedium> > &llMedi ums,5384 const RTCList<ComPtr<IMedium> > &llMedia, 5385 5385 const StringsList &llFilesToDelete) 5386 5386 : Task(m, p, t), 5387 m_llMedi ums(llMediums),5387 m_llMedia(llMedia), 5388 5388 m_llFilesToDelete(llFilesToDelete) 5389 5389 {} … … 5402 5402 } 5403 5403 5404 RTCList<ComPtr<IMedium> > m_llMedi ums;5404 RTCList<ComPtr<IMedium> > m_llMedia; 5405 5405 StringsList m_llFilesToDelete; 5406 5406 … … 5452 5452 i_setMachineState(MachineState_SettingUp); 5453 5453 alock.release(); 5454 for (size_t i = 0; i < task.m_llMedi ums.size(); ++i)5455 { 5456 ComObjPtr<Medium> pMedium = (Medium*)(IMedium*)(task.m_llMedi ums.at(i));5454 for (size_t i = 0; i < task.m_llMedia.size(); ++i) 5455 { 5456 ComObjPtr<Medium> pMedium = (Medium*)(IMedium*)(task.m_llMedia.at(i)); 5457 5457 { 5458 5458 AutoCaller mac(pMedium); … … 5601 5601 llFilesToDelete.push_back(strTmp); 5602 5602 5603 RTCList<ComPtr<IMedium> > llMedi ums;5603 RTCList<ComPtr<IMedium> > llMedia; 5604 5604 for (size_t i = 0; i < aMedia.size(); ++i) 5605 5605 { … … 5615 5615 * deleted. */ 5616 5616 if (ids.size() < 1) 5617 llMedi ums.append(pMedium);5617 llMedia.append(pMedium); 5618 5618 } 5619 5619 … … 5624 5624 tr("Deleting files"), 5625 5625 true /* fCancellable */, 5626 (ULONG)(1 + llMedi ums.size() + llFilesToDelete.size() + 1), // cOperations5626 (ULONG)(1 + llMedia.size() + llFilesToDelete.size() + 1), // cOperations 5627 5627 tr("Collecting file inventory")); 5628 5628 if (FAILED(hrc)) … … 5631 5631 /* create and start the task on a separate thread (note that it will not 5632 5632 * start working until we release alock) */ 5633 DeleteConfigTask *pTask = new DeleteConfigTask(this, pProgress, "DeleteVM", llMedi ums, llFilesToDelete);5633 DeleteConfigTask *pTask = new DeleteConfigTask(this, pProgress, "DeleteVM", llMedia, llFilesToDelete); 5634 5634 hrc = pTask->createThread(); 5635 5635 pTask = NULL; -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r98351 r98352 121 121 inline HRESULT addNVRAM(const ComObjPtr<Machine> &machine, bool fAttachCurrent, ULONG &uCount, ULONG &uTotalWeight); 122 122 inline HRESULT queryBaseName(const ComPtr<IMedium> &pMedium, Utf8Str &strBaseName) const; 123 HRESULT queryMedia sForMachineState(const RTCList<ComObjPtr<Machine> > &machineList,124 125 HRESULT queryMedia sForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList,126 127 HRESULT queryMedia sForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount,128 123 HRESULT queryMediaForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, 124 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 125 HRESULT queryMediaForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, 126 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight); 127 HRESULT queryMediaForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, bool fAttachLinked, ULONG &uCount, 128 ULONG &uTotalWeight); 129 129 130 130 /* MachineCloneVM::run helper: */ … … 154 154 CloneMode_T mode; 155 155 RTCList<CloneOptions_T> options; 156 RTCList<MEDIUMTASKCHAIN> llMedia s;156 RTCList<MEDIUMTASKCHAIN> llMedia; 157 157 RTCList<FILECOPYTASK> llSaveStateFiles; /* Snapshot UUID -> File path */ 158 158 RTCList<FILECOPYTASK> llNVRAMFiles; /* Snapshot UUID -> File path */ … … 299 299 } 300 300 301 HRESULT MachineCloneVMPrivate::queryMedia sForMachineState(const RTCList<ComObjPtr<Machine> > &machineList,302 301 HRESULT MachineCloneVMPrivate::queryMediaForMachineState(const RTCList<ComObjPtr<Machine> > &machineList, 302 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 303 303 { 304 304 /* This mode is pretty straightforward. We didn't need to know about any … … 371 371 updateProgressStats(mtc, fAttachLinked, uCount, uTotalWeight); 372 372 /* Append the list of images which have to be cloned. */ 373 llMedia s.append(mtc);373 llMedia.append(mtc); 374 374 } 375 375 /* Add the save state file of this machine if there is one. */ … … 384 384 } 385 385 386 HRESULT MachineCloneVMPrivate::queryMedia sForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList,387 386 HRESULT MachineCloneVMPrivate::queryMediaForMachineAndChildStates(const RTCList<ComObjPtr<Machine> > &machineList, 387 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 388 388 { 389 389 /* This is basically a three step approach. First select all media … … 480 480 } 481 481 482 llMedia s.append(mtc);482 llMedia.append(mtc); 483 483 } 484 484 /* Add the save state file of this machine if there is one. */ … … 501 501 * that in the previous loop, cause there we go from child -> parent and 502 502 * didn't know how many are between. */ 503 for (size_t i = 0; i < llMedia s.size(); ++i)503 for (size_t i = 0; i < llMedia.size(); ++i) 504 504 { 505 505 uint32_t uIdx = 0; 506 MEDIUMTASKCHAIN &mtc = llMedia s.at(i);506 MEDIUMTASKCHAIN &mtc = llMedia.at(i); 507 507 for (size_t a = mtc.chain.size(); a > 0; --a) 508 508 mtc.chain[a - 1].uIdx = uIdx++; … … 524 524 * children knows of the new parent (which doesn't necessarily mean it 525 525 * is a direct children in the source chain). */ 526 for (size_t i = 0; i < llMedia s.size(); ++i)527 { 528 MEDIUMTASKCHAIN &mtc = llMedia s.at(i);526 for (size_t i = 0; i < llMedia.size(); ++i) 527 { 528 MEDIUMTASKCHAIN &mtc = llMedia.at(i); 529 529 RTCList<MEDIUMTASK> newChain; 530 530 uint32_t used = 0; … … 562 562 } 563 563 564 HRESULT MachineCloneVMPrivate::queryMedia sForAllStates(const RTCList<ComObjPtr<Machine> > &machineList,565 564 HRESULT MachineCloneVMPrivate::queryMediaForAllStates(const RTCList<ComObjPtr<Machine> > &machineList, 565 bool fAttachLinked, ULONG &uCount, ULONG &uTotalWeight) 566 566 { 567 567 /* In this case we create a exact copy of the original VM. This means just … … 633 633 updateProgressStats(mtc, fAttachLinked, uCount, uTotalWeight); 634 634 /* Append the list of images which have to be cloned. */ 635 llMedia s.append(mtc);635 llMedia.append(mtc); 636 636 } 637 637 /* Add the save state file of this machine if there is one. */ … … 654 654 * that in the previous loop, cause there we go from child -> parent and 655 655 * didn't know how many are between. */ 656 for (size_t i = 0; i < llMedia s.size(); ++i)656 for (size_t i = 0; i < llMedia.size(); ++i) 657 657 { 658 658 uint32_t uIdx = 0; 659 MEDIUMTASKCHAIN &mtc = llMedia s.at(i);659 MEDIUMTASKCHAIN &mtc = llMedia.at(i); 660 660 for (size_t a = mtc.chain.size(); a > 0; --a) 661 661 mtc.chain[a - 1].uIdx = uIdx++; … … 1027 1027 { 1028 1028 case CloneMode_MachineState: 1029 d->queryMedia sForMachineState(machineList, fAttachLinked, uCount, uTotalWeight);1029 d->queryMediaForMachineState(machineList, fAttachLinked, uCount, uTotalWeight); 1030 1030 break; 1031 1031 case CloneMode_MachineAndChildStates: 1032 d->queryMedia sForMachineAndChildStates(machineList, fAttachLinked, uCount, uTotalWeight);1032 d->queryMediaForMachineAndChildStates(machineList, fAttachLinked, uCount, uTotalWeight); 1033 1033 break; 1034 1034 case CloneMode_AllStates: 1035 d->queryMedia sForAllStates(machineList, fAttachLinked, uCount, uTotalWeight);1035 d->queryMediaForAllStates(machineList, fAttachLinked, uCount, uTotalWeight); 1036 1036 break; 1037 1037 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK … … 1095 1095 RTCList<ComObjPtr<Medium> > newMedia; /* All created images */ 1096 1096 RTCList<Utf8Str> newFiles; /* All extra created files (save states, ...) */ 1097 std::set<ComObjPtr<Medium> > pMedi umsForNotify;1097 std::set<ComObjPtr<Medium> > pMediaForNotify; 1098 1098 std::map<Guid, DeviceType_T> uIdsForNotify; 1099 1099 try … … 1190 1190 TStrMediumMap map; 1191 1191 size_t cDisks = 0; 1192 for (size_t i = 0; i < d->llMedia s.size(); ++i)1193 { 1194 const MEDIUMTASKCHAIN &mtc = d->llMedia s.at(i);1192 for (size_t i = 0; i < d->llMedia.size(); ++i) 1193 { 1194 const MEDIUMTASKCHAIN &mtc = d->llMedia.at(i); 1195 1195 ComObjPtr<Medium> pNewParent; 1196 1196 uint32_t uSrcParentIdx = UINT32_MAX; … … 1233 1233 /* diff image has to be used... */ 1234 1234 pNewParent = pDiff; 1235 pMedi umsForNotify.insert(pDiff->i_getParent());1235 pMediaForNotify.insert(pDiff->i_getParent()); 1236 1236 uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType(); 1237 1237 } … … 1435 1435 /* diff image has to be used... */ 1436 1436 pNewParent = pDiff; 1437 pMedi umsForNotify.insert(pDiff->i_getParent());1437 pMediaForNotify.insert(pDiff->i_getParent()); 1438 1438 uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType(); 1439 1439 } … … 1673 1673 p->mParent->i_onMediumRegistered(it->first, it->second, TRUE); 1674 1674 } 1675 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMedi umsForNotify.begin();1676 it != pMedi umsForNotify.end();1675 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediaForNotify.begin(); 1676 it != pMediaForNotify.end(); 1677 1677 ++it) 1678 1678 { -
trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp
r98351 r98352 321 321 ULONG uTotalWeight = 1; 322 322 323 /* The lists m_llMedia s, m_llSaveStateFiles and m_llNVRAMFiles are filled in the queryMediasForAllStates() */324 hrc = queryMedia sForAllStates();323 /* The lists m_llMedia, m_llSaveStateFiles and m_llNVRAMFiles are filled in the queryMediaForAllStates() */ 324 hrc = queryMediaForAllStates(); 325 325 if (FAILED(hrc)) 326 326 return hrc; 327 327 328 /* Calculate the total size of images. Fill m_finalMedi umsMap */328 /* Calculate the total size of images. Fill m_finalMediaMap */ 329 329 { /** The scope here for better reading, apart from that the variables have limited scope too */ 330 uint64_t totalMedi umsSize = 0;331 332 for (size_t i = 0; i < m_llMedia s.size(); ++i)333 { 334 MEDIUMTASKCHAINMOVE &mtc = m_llMedia s.at(i);330 uint64_t totalMediaSize = 0; 331 332 for (size_t i = 0; i < m_llMedia.size(); ++i) 333 { 334 MEDIUMTASKCHAINMOVE &mtc = m_llMedia.at(i); 335 335 for (size_t a = mtc.chain.size(); a > 0; --a) 336 336 { … … 353 353 354 354 std::pair<std::map<Utf8Str, MEDIUMTASKMOVE>::iterator,bool> ret; 355 ret = m_finalMedi umsMap.insert(std::make_pair(name, mtc.chain[a - 1]));355 ret = m_finalMediaMap.insert(std::make_pair(name, mtc.chain[a - 1])); 356 356 if (ret.second == true) 357 357 { … … 359 359 ++uCount; 360 360 uTotalWeight += mtc.chain[a - 1].uWeight; 361 totalMedi umsSize += (uint64_t)cbSize;361 totalMediaSize += (uint64_t)cbSize; 362 362 Log2(("Image %s was added into the moved list\n", name.c_str())); 363 363 } … … 366 366 } 367 367 368 Log2(("Total Size of images is %lld bytes\n", totalMedi umsSize));369 neededFreeSpace += totalMedi umsSize;368 Log2(("Total Size of images is %lld bytes\n", totalMediaSize)); 369 neededFreeSpace += totalMediaSize; 370 370 } 371 371 … … 666 666 { 667 667 /* Move all disks */ 668 hrc = taskMoveVM->moveAllDisks(taskMoveVM->m_finalMedi umsMap, strTargetFolder);668 hrc = taskMoveVM->moveAllDisks(taskMoveVM->m_finalMediaMap, strTargetFolder); 669 669 if (FAILED(hrc)) 670 670 throw hrc; … … 1008 1008 taskMoveVM->m_pProgress->SetNextOperation(BstrFmt(tr("Skip the empty operation %d..."), i + 1).raw(), 1); 1009 1009 1010 hrc = taskMoveVM->moveAllDisks(taskMoveVM->m_finalMedi umsMap);1010 hrc = taskMoveVM->moveAllDisks(taskMoveVM->m_finalMediaMap); 1011 1011 if (FAILED(hrc)) 1012 1012 throw hrc; … … 1098 1098 * because we doubled the number of operations for rollback case. 1099 1099 * But if we want to update the progress object corectly it's needed to add all medium moved by standard 1100 * "move medium" logic (for us it's taskMoveVM->m_finalMedi umsMap) to the current number of operation.1100 * "move medium" logic (for us it's taskMoveVM->m_finalMediaMap) to the current number of operation. 1101 1101 */ 1102 1102 … … 1106 1106 hrc = taskMoveVM->m_pProgress->COMGETTER(Operation)(&operation); 1107 1107 1108 for (ULONG i = operation; i < operation + taskMoveVM->m_finalMedi umsMap.size() - 1; ++i)1108 for (ULONG i = operation; i < operation + taskMoveVM->m_finalMediaMap.size() - 1; ++i) 1109 1109 taskMoveVM->m_pProgress->SetNextOperation(BstrFmt(tr("Skip the empty operation %d..."), i).raw(), 1); 1110 1110 … … 1436 1436 } 1437 1437 1438 HRESULT MachineMoveVM::queryMedia sForAllStates()1438 HRESULT MachineMoveVM::queryMediaForAllStates() 1439 1439 { 1440 1440 /* In this case we create a exact copy of the original VM. This means just … … 1525 1525 } 1526 1526 1527 m_llMedia s.append(mtc);1527 m_llMedia.append(mtc); 1528 1528 } 1529 1529 … … 1540 1540 * that in the previous loop, cause there we go from child -> parent and 1541 1541 * didn't know how many are between. */ 1542 for (size_t i = 0; i < m_llMedia s.size(); ++i)1542 for (size_t i = 0; i < m_llMedia.size(); ++i) 1543 1543 { 1544 1544 uint32_t uIdx = 0; 1545 MEDIUMTASKCHAINMOVE &mtc = m_llMedia s.at(i);1545 MEDIUMTASKCHAINMOVE &mtc = m_llMedia.at(i); 1546 1546 for (size_t a = mtc.chain.size(); a > 0; --a) 1547 1547 mtc.chain[a - 1].uIdx = uIdx++; -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r98351 r98352 9512 9512 HRESULT hrc2; 9513 9513 9514 std::set<ComObjPtr<Medium> > pMedi umsForNotify;9514 std::set<ComObjPtr<Medium> > pMediaForNotify; 9515 9515 std::map<Guid, DeviceType_T> uIdsForNotify; 9516 9516 … … 9537 9537 i_deparent(); 9538 9538 if (task.NotifyAboutChanges()) 9539 pMedi umsForNotify.insert(task.mParentForTarget);9539 pMediaForNotify.insert(task.mParentForTarget); 9540 9540 } 9541 9541 … … 9574 9574 9575 9575 if (task.NotifyAboutChanges()) 9576 pMedi umsForNotify.insert(pMedium);9576 pMediaForNotify.insert(pMedium); 9577 9577 } 9578 9578 } 9579 pMedi umsForNotify.insert(pTarget);9579 pMediaForNotify.insert(pTarget); 9580 9580 } 9581 9581 … … 9666 9666 else if (task.NotifyAboutChanges()) 9667 9667 { 9668 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMedi umsForNotify.begin();9669 it != pMedi umsForNotify.end();9668 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediaForNotify.begin(); 9669 it != pMediaForNotify.end(); 9670 9670 ++it) 9671 9671 { -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r98292 r98352 1763 1763 BOOL fSuspendedBySave = FALSE; 1764 1764 1765 std::set<ComObjPtr<Medium> > pMedi umsForNotify;1765 std::set<ComObjPtr<Medium> > pMediaForNotify; 1766 1766 std::map<Guid, DeviceType_T> uIdsForNotify; 1767 1767 … … 1949 1949 if (!fFound) 1950 1950 { 1951 pMedi umsForNotify.insert(pMedium->i_getParent());1951 pMediaForNotify.insert(pMedium->i_getParent()); 1952 1952 uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType(); 1953 1953 } … … 2065 2065 } 2066 2066 2067 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMedi umsForNotify.begin();2068 it != pMedi umsForNotify.end();2067 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediaForNotify.begin(); 2068 it != pMediaForNotify.end(); 2069 2069 ++it) 2070 2070 { … … 2329 2329 HRESULT hrc = S_OK; 2330 2330 Guid snapshotId; 2331 std::set<ComObjPtr<Medium> > pMedi umsForNotify;2331 std::set<ComObjPtr<Medium> > pMediaForNotify; 2332 2332 std::map<Guid, std::pair<DeviceType_T, BOOL> > uIdsForNotify; 2333 2333 … … 2461 2461 if (!fFound) 2462 2462 { 2463 pMedi umsForNotify.insert(pMedium->i_getParent());2463 pMediaForNotify.insert(pMedium->i_getParent()); 2464 2464 uIdsForNotify[pMedium->i_getId()] = std::pair<DeviceType_T, BOOL>(pMedium->i_getDeviceType(), TRUE); 2465 2465 } … … 2571 2571 if (SUCCEEDED(hrc2)) 2572 2572 { 2573 pMedi umsForNotify.insert(pParent);2573 pMediaForNotify.insert(pParent); 2574 2574 uIdsForNotify[id] = std::pair<DeviceType_T, BOOL>(pMedium->i_getDeviceType(), FALSE); 2575 2575 pMedium->uninit(); … … 2609 2609 mParent->i_onMediumRegistered(it->first, it->second.first, it->second.second); 2610 2610 } 2611 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMedi umsForNotify.begin();2612 it != pMedi umsForNotify.end();2611 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediaForNotify.begin(); 2612 it != pMediaForNotify.end(); 2613 2613 ++it) 2614 2614 { … … 2972 2972 MediumDeleteRecList toDelete; 2973 2973 Guid snapshotId; 2974 std::set<ComObjPtr<Medium> > pMedi umsForNotify;2974 std::set<ComObjPtr<Medium> > pMediaForNotify; 2975 2975 std::map<Guid,DeviceType_T> uIdsForNotify; 2976 2976 … … 3345 3345 throw hrc; 3346 3346 3347 pMedi umsForNotify.insert(pParent);3347 pMediaForNotify.insert(pParent); 3348 3348 uIdsForNotify[uMedium] = uMediumType; 3349 3349 … … 3356 3356 { 3357 3357 //store ids before merging for notify 3358 pMedi umsForNotify.insert(it->mpTarget);3358 pMediaForNotify.insert(it->mpTarget); 3359 3359 if (it->mfMergeForward) 3360 pMedi umsForNotify.insert(it->mpSource->i_getParent());3360 pMediaForNotify.insert(it->mpSource->i_getParent()); 3361 3361 else 3362 3362 { … … 3366 3366 ++iit) 3367 3367 { 3368 pMedi umsForNotify.insert(*iit);3368 pMediaForNotify.insert(*iit); 3369 3369 } 3370 3370 } … … 3605 3605 mParent->i_onMediumRegistered(it->first, it->second, FALSE); 3606 3606 } 3607 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMedi umsForNotify.begin();3608 it != pMedi umsForNotify.end();3607 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediaForNotify.begin(); 3608 it != pMediaForNotify.end(); 3609 3609 ++it) 3610 3610 {
Note:
See TracChangeset
for help on using the changeset viewer.