Changeset 85284 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Jul 12, 2020 3:11:52 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139261
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r82968 r85284 26 26 27 27 #include "AutoCaller.h" 28 #include "Global.h" 28 29 #include "LoggingNew.h" 29 30 #include "ThreadTask.h" … … 1271 1272 { 1272 1273 // Otherwise use the old VirtualBox "make absolute path" logic: 1273 rc = m->pVirtualBox->i_calculateFullPath(data.strLocation, strFull); 1274 if (FAILED(rc)) return rc; 1274 int vrc = m->pVirtualBox->i_calculateFullPath(data.strLocation, strFull); 1275 if (RT_FAILURE(vrc)) 1276 return Global::vboxStatusCodeToCOM(vrc); 1275 1277 } 1276 1278 } … … 1702 1704 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1703 1705 1704 *aSize = m->size;1706 *aSize = (LONG64)m->size; 1705 1707 1706 1708 return S_OK; … … 1947 1949 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1948 1950 1949 *aLogicalSize = m->logicalSize;1951 *aLogicalSize = (LONG64)m->logicalSize; 1950 1952 1951 1953 return S_OK; … … 2589 2591 2590 2592 /* setup task object to carry out the operation asynchronously */ 2591 pTask = new Medium::CreateBaseTask(this, pProgress, aLogicalSize,2593 pTask = new Medium::CreateBaseTask(this, pProgress, (uint64_t)aLogicalSize, 2592 2594 (MediumVariant_T)mediumVariantFlags); 2593 2595 rc = pTask->rc(); … … 2784 2786 ComPtr<IProgress> &aProgress) 2785 2787 { 2786 int rc = S_OK; 2787 2788 rc = cloneTo(aTarget, aVariant, NULL, aProgress); 2789 return rc; 2788 return cloneTo(aTarget, aVariant, NULL, aProgress); 2790 2789 } 2791 2790 … … 2979 2978 if (aLocation.isEmpty()) 2980 2979 { 2981 rc = setError (VERR_PATH_ZERO_LENGTH,2982 tr("Medium '%s' can't be moved. Destination path is empty."),2983 i_getLocationFull().c_str());2980 rc = setErrorVrc(VERR_PATH_ZERO_LENGTH, 2981 tr("Medium '%s' can't be moved. Destination path is empty."), 2982 i_getLocationFull().c_str()); 2984 2983 throw rc; 2985 2984 } … … 3046 3045 break; 3047 3046 default: 3048 rc = setError (VERR_NOT_A_FILE, /** @todo r=bird: Mixing status codes again. */3049 tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."),3050 i_getLocationFull().c_str());3047 rc = setErrorVrc(VERR_NOT_A_FILE, /** @todo r=bird: Mixing status codes again. */ 3048 tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."), 3049 i_getLocationFull().c_str()); 3051 3050 throw rc; 3052 3051 } … … 3076 3075 if (!i_isMediumFormatFile()) 3077 3076 { 3078 rc = setError (VERR_NOT_A_FILE,3079 tr("Medium '%s' isn't a file object. \"Move\" operation isn't supported."),3080 i_getLocationFull().c_str());3077 rc = setErrorVrc(VERR_NOT_A_FILE, 3078 tr("Medium '%s' isn't a file object. \"Move\" operation isn't supported."), 3079 i_getLocationFull().c_str()); 3081 3080 throw rc; 3082 3081 } … … 3098 3097 if (FAILED(rc)) 3099 3098 { 3100 rc = setError (VERR_NO_CHANGE,3101 tr("Medium '%s' is already in the correct location"),3102 i_getLocationFull().c_str());3099 rc = setErrorVrc(VERR_NO_CHANGE, 3100 tr("Medium '%s' is already in the correct location"), 3101 i_getLocationFull().c_str()); 3103 3102 throw rc; 3104 3103 } … … 3141 3140 if (ses) 3142 3141 { 3143 rc = setError(V ERR_VM_UNEXPECTED_VM_STATE,3142 rc = setError(VBOX_E_INVALID_VM_STATE, 3144 3143 tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before relocating this medium"), 3145 3144 id.toString().c_str(), … … 3299 3298 alock.acquire(); 3300 3299 3301 rc = setError(V ERR_VM_UNEXPECTED_VM_STATE,3300 rc = setError(VBOX_E_INVALID_VM_STATE, 3302 3301 tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before set location for this medium"), 3303 3302 id.toString().c_str(), … … 3406 3405 ComPtr<IProgress> &aProgress) 3407 3406 { 3407 CheckComArgExpr(aLogicalSize, aLogicalSize > 0); 3408 3408 HRESULT rc = S_OK; 3409 3409 ComObjPtr<Progress> pProgress; … … 3453 3453 3454 3454 if (SUCCEEDED(rc)) 3455 rc = i_resize( aLogicalSize, pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);3455 rc = i_resize((uint64_t)aLogicalSize, pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */); 3456 3456 3457 3457 if (SUCCEEDED(rc)) … … 5066 5066 /* m->variant is const, no need to lock */ 5067 5067 ULONG mediumVariantFlags = (ULONG)m->variant; 5068 mediumVariantFlags &= ~( MediumVariant_Fixed | MediumVariant_VmdkStreamOptimized);5068 mediumVariantFlags &= ~(ULONG)(MediumVariant_Fixed | MediumVariant_VmdkStreamOptimized); 5069 5069 mediumVariantFlags |= MediumVariant_Diff; 5070 5070 return (MediumVariant_T)mediumVariantFlags; … … 6186 6186 */ 6187 6187 6188 HRESULT Medium::i_resize( LONG64aLogicalSize,6188 HRESULT Medium::i_resize(uint64_t aLogicalSize, 6189 6189 MediumLockList *aMediumLockList, 6190 6190 ComObjPtr<Progress> *aProgress,
Note:
See TracChangeset
for help on using the changeset viewer.