Changeset 98292 in vbox for trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
- Timestamp:
- Jan 25, 2023 1:14:53 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r98289 r98292 384 384 HRESULT Snapshot::setName(const com::Utf8Str &aName) 385 385 { 386 HRESULT rc = S_OK;386 HRESULT hrc = S_OK; 387 387 388 388 // prohibit setting a UUID only as the machine name, or else it can … … 399 399 m->strName = aName; 400 400 alock.release(); /* Important! (child->parent locks are forbidden) */ 401 rc = m->pMachine->i_onSnapshotChange(this);402 } 403 404 return rc;401 hrc = m->pMachine->i_onSnapshotChange(this); 402 } 403 404 return hrc; 405 405 } 406 406 … … 414 414 HRESULT Snapshot::setDescription(const com::Utf8Str &aDescription) 415 415 { 416 HRESULT rc = S_OK;416 HRESULT hrc = S_OK; 417 417 418 418 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 421 421 m->strDescription = aDescription; 422 422 alock.release(); /* Important! (child->parent locks are forbidden) */ 423 rc = m->pMachine->i_onSnapshotChange(this);424 } 425 426 return rc;423 hrc = m->pMachine->i_onSnapshotChange(this); 424 } 425 426 return hrc; 427 427 } 428 428 … … 903 903 llSettingsTodo.pop_front(); 904 904 905 HRESULT rc = pSnapshot->i_saveSnapshotOne(*current);906 if (FAILED( rc))907 return rc;905 HRESULT hrc = pSnapshot->i_saveSnapshotOne(*current); 906 if (FAILED(hrc)) 907 return hrc; 908 908 909 909 /* save all children */ … … 954 954 Assert(m->pMachine->isWriteLockOnCurrentThread()); 955 955 956 HRESULT rc = S_OK;956 HRESULT hrc = S_OK; 957 957 958 958 SnapshotsList llSnapshotsTodo; … … 987 987 llSnapshotsAll.pop_front(); 988 988 989 rc = pSnapshot->m->pMachine->i_detachAllMedia(writeLock, 990 pSnapshot, 991 cleanupMode, 992 llMedia); 993 if (SUCCEEDED(rc)) 989 hrc = pSnapshot->m->pMachine->i_detachAllMedia(writeLock, pSnapshot, cleanupMode, llMedia); 990 if (SUCCEEDED(hrc)) 994 991 { 995 992 Utf8Str strFile; … … 1096 1093 mSSData->strStateFilePath = aStateFilePath; 1097 1094 1098 HRESULT rc = S_OK;1095 HRESULT hrc = S_OK; 1099 1096 1100 1097 /* Create copies of all attachments (mMediaData after attaching a copy … … 1110 1107 ComObjPtr<MediumAttachment> pAtt; 1111 1108 pAtt.createObject(); 1112 rc = pAtt->initCopy(this, *it);1113 if (FAILED( rc)) returnrc;1109 hrc = pAtt->initCopy(this, *it); 1110 if (FAILED(hrc)) return hrc; 1114 1111 mMediumAttachments->push_back(pAtt); 1115 1112 … … 1117 1114 if (pMedium) // can be NULL for non-harddisk 1118 1115 { 1119 rc = pMedium->i_addBackReference(mData->mUuid, mSnapshotId);1120 AssertComRC( rc);1116 hrc = pMedium->i_addBackReference(mData->mUuid, mSnapshotId); 1117 AssertComRC(hrc); 1121 1118 } 1122 1119 } … … 1131 1128 ComObjPtr<SharedFolder> pFolder; 1132 1129 pFolder.createObject(); 1133 rc = pFolder->initCopy(this, *it);1134 if (FAILED( rc)) returnrc;1130 hrc = pFolder->initCopy(this, *it); 1131 if (FAILED(hrc)) return hrc; 1135 1132 *it = pFolder; 1136 1133 } … … 1145 1142 ComObjPtr<PCIDeviceAttachment> pDev; 1146 1143 pDev.createObject(); 1147 rc = pDev->initCopy(this, *it);1148 if (FAILED( rc)) returnrc;1144 hrc = pDev->initCopy(this, *it); 1145 if (FAILED(hrc)) return hrc; 1149 1146 *it = pDev; 1150 1147 } … … 1160 1157 ComObjPtr<StorageController> ctrl; 1161 1158 ctrl.createObject(); 1162 rc = ctrl->initCopy(this, *it);1163 if (FAILED( rc)) returnrc;1159 hrc = ctrl->initCopy(this, *it); 1160 if (FAILED(hrc)) return hrc; 1164 1161 mStorageControllers->push_back(ctrl); 1165 1162 } … … 1168 1165 1169 1166 unconst(mBIOSSettings).createObject(); 1170 rc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings);1171 if (FAILED( rc)) returnrc;1167 hrc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings); 1168 if (FAILED(hrc)) return hrc; 1172 1169 1173 1170 unconst(mRecordingSettings).createObject(); 1174 rc = mRecordingSettings->initCopy(this, pMachine->mRecordingSettings);1175 if (FAILED( rc)) returnrc;1171 hrc = mRecordingSettings->initCopy(this, pMachine->mRecordingSettings); 1172 if (FAILED(hrc)) return hrc; 1176 1173 1177 1174 unconst(mTrustedPlatformModule).createObject(); 1178 rc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule);1179 if (FAILED( rc)) returnrc;1175 hrc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule); 1176 if (FAILED(hrc)) return hrc; 1180 1177 1181 1178 unconst(mNvramStore).createObject(); 1182 rc = mNvramStore->initCopy(this, pMachine->mNvramStore);1183 if (FAILED( rc)) returnrc;1179 hrc = mNvramStore->initCopy(this, pMachine->mNvramStore); 1180 if (FAILED(hrc)) return hrc; 1184 1181 1185 1182 unconst(mGraphicsAdapter).createObject(); 1186 rc = mGraphicsAdapter->initCopy(this, pMachine->mGraphicsAdapter);1187 if (FAILED( rc)) returnrc;1183 hrc = mGraphicsAdapter->initCopy(this, pMachine->mGraphicsAdapter); 1184 if (FAILED(hrc)) return hrc; 1188 1185 1189 1186 unconst(mVRDEServer).createObject(); 1190 rc = mVRDEServer->initCopy(this, pMachine->mVRDEServer);1191 if (FAILED( rc)) returnrc;1187 hrc = mVRDEServer->initCopy(this, pMachine->mVRDEServer); 1188 if (FAILED(hrc)) return hrc; 1192 1189 1193 1190 unconst(mAudioSettings).createObject(); 1194 rc = mAudioSettings->initCopy(this, pMachine->mAudioSettings);1195 if (FAILED( rc)) returnrc;1191 hrc = mAudioSettings->initCopy(this, pMachine->mAudioSettings); 1192 if (FAILED(hrc)) return hrc; 1196 1193 1197 1194 /* create copies of all USB controllers (mUSBControllerData … … 1205 1202 ComObjPtr<USBController> ctrl; 1206 1203 ctrl.createObject(); 1207 rc = ctrl->initCopy(this, *it);1208 if (FAILED( rc)) returnrc;1204 hrc = ctrl->initCopy(this, *it); 1205 if (FAILED(hrc)) return hrc; 1209 1206 mUSBControllers->push_back(ctrl); 1210 1207 } 1211 1208 1212 1209 unconst(mUSBDeviceFilters).createObject(); 1213 rc = mUSBDeviceFilters->initCopy(this, pMachine->mUSBDeviceFilters);1214 if (FAILED( rc)) returnrc;1210 hrc = mUSBDeviceFilters->initCopy(this, pMachine->mUSBDeviceFilters); 1211 if (FAILED(hrc)) return hrc; 1215 1212 1216 1213 mNetworkAdapters.resize(pMachine->mNetworkAdapters.size()); … … 1218 1215 { 1219 1216 unconst(mNetworkAdapters[slot]).createObject(); 1220 rc = mNetworkAdapters[slot]->initCopy(this, pMachine->mNetworkAdapters[slot]);1221 if (FAILED( rc)) returnrc;1217 hrc = mNetworkAdapters[slot]->initCopy(this, pMachine->mNetworkAdapters[slot]); 1218 if (FAILED(hrc)) return hrc; 1222 1219 } 1223 1220 … … 1225 1222 { 1226 1223 unconst(mSerialPorts[slot]).createObject(); 1227 rc = mSerialPorts[slot]->initCopy(this, pMachine->mSerialPorts[slot]);1228 if (FAILED( rc)) returnrc;1224 hrc = mSerialPorts[slot]->initCopy(this, pMachine->mSerialPorts[slot]); 1225 if (FAILED(hrc)) return hrc; 1229 1226 } 1230 1227 … … 1232 1229 { 1233 1230 unconst(mParallelPorts[slot]).createObject(); 1234 rc = mParallelPorts[slot]->initCopy(this, pMachine->mParallelPorts[slot]);1235 if (FAILED( rc)) returnrc;1231 hrc = mParallelPorts[slot]->initCopy(this, pMachine->mParallelPorts[slot]); 1232 if (FAILED(hrc)) return hrc; 1236 1233 } 1237 1234 1238 1235 unconst(mBandwidthControl).createObject(); 1239 rc = mBandwidthControl->initCopy(this, pMachine->mBandwidthControl);1240 if (FAILED( rc)) returnrc;1236 hrc = mBandwidthControl->initCopy(this, pMachine->mBandwidthControl); 1237 if (FAILED(hrc)) return hrc; 1241 1238 1242 1239 unconst(mGuestDebugControl).createObject(); 1243 rc = mGuestDebugControl->initCopy(this, pMachine->mGuestDebugControl);1244 if (FAILED( rc)) returnrc;1240 hrc = mGuestDebugControl->initCopy(this, pMachine->mGuestDebugControl); 1241 if (FAILED(hrc)) return hrc; 1245 1242 1246 1243 /* Confirm a successful initialization when it's the case */ … … 1436 1433 mMachine->i_setModified(Machine::IsModified_Snapshots, false /* fAllowStateModification */); 1437 1434 slock.release(); 1438 HRESULT rc = mMachine->i_saveSettings(&fNeedsGlobalSaveSettings,1439 alock,1440 SaveS_Force); // we know we need saving, no need to check1435 HRESULT hrc = mMachine->i_saveSettings(&fNeedsGlobalSaveSettings, 1436 alock, 1437 SaveS_Force); // we know we need saving, no need to check 1441 1438 alock.release(); 1442 1439 1443 if (SUCCEEDED( rc) && fNeedsGlobalSaveSettings)1440 if (SUCCEEDED(hrc) && fNeedsGlobalSaveSettings) 1444 1441 { 1445 1442 // save the global settings 1446 1443 AutoWriteLock vboxlock(mParent COMMA_LOCKVAL_SRC_POS); 1447 rc = mParent->i_saveSettings();1444 hrc = mParent->i_saveSettings(); 1448 1445 } 1449 1446 … … 1451 1448 mParent->i_onSnapshotChanged(uuidMachine, uuidSnapshot); 1452 1449 1453 return rc;1450 return hrc; 1454 1451 } 1455 1452 … … 1634 1631 Global::stringifyMachineState(mData->mMachineState)); 1635 1632 1636 HRESULT rc = i_checkStateDependency(MutableOrSavedOrRunningStateDep);1637 if (FAILED( rc))1638 return rc;1633 HRESULT hrc = i_checkStateDependency(MutableOrSavedOrRunningStateDep); 1634 if (FAILED(hrc)) 1635 return hrc; 1639 1636 1640 1637 // prepare the progress object: … … 1672 1669 ComObjPtr<Progress> pProgress; 1673 1670 pProgress.createObject(); 1674 rc = pProgress->init(mParent,1675 static_cast<IMachine *>(this),1676 Bstr(tr("Taking a snapshot of the virtual machine")).raw(),1677 fTakingSnapshotOnline /* aCancelable */,1678 cOperations,1679 ulTotalOperationsWeight,1680 Bstr(tr("Setting up snapshot operation")).raw(), // first sub-op description1681 1); // ulFirstOperationWeight1682 if (FAILED( rc))1683 return rc;1671 hrc = pProgress->init(mParent, 1672 static_cast<IMachine *>(this), 1673 Bstr(tr("Taking a snapshot of the virtual machine")).raw(), 1674 fTakingSnapshotOnline /* aCancelable */, 1675 cOperations, 1676 ulTotalOperationsWeight, 1677 Bstr(tr("Setting up snapshot operation")).raw(), // first sub-op description 1678 1); // ulFirstOperationWeight 1679 if (FAILED(hrc)) 1680 return hrc; 1684 1681 1685 1682 /* create an ID for the snapshot */ … … 1700 1697 fTakingSnapshotOnline); 1701 1698 MachineState_T const machineStateBackup = pTask->m_machineStateBackup; 1702 rc = pTask->createThread();1699 hrc = pTask->createThread(); 1703 1700 pTask = NULL; 1704 if (FAILED( rc))1705 return rc;1701 if (FAILED(hrc)) 1702 return hrc; 1706 1703 1707 1704 /* set the proper machine state (note: after creating a Task instance) */ … … 1720 1717 pProgress.queryInterfaceTo(aProgress.asOutParam()); 1721 1718 1722 return rc;1719 return hrc; 1723 1720 } 1724 1721 … … 1746 1743 // 5) update the various snapshot/machine objects, save settings 1747 1744 1748 HRESULT rc = S_OK;1745 HRESULT hrc = S_OK; 1749 1746 AutoCaller autoCaller(this); 1750 1747 LogFlowThisFunc(("state=%d\n", getObjectState().getState())); … … 1753 1750 /* we might have been uninitialized because the session was accidentally 1754 1751 * closed by the client, so don't assert */ 1755 rc = setError(E_FAIL, 1756 tr("The session has been accidentally closed")); 1757 task.m_pProgress->i_notifyComplete(rc); 1752 hrc = setError(E_FAIL, tr("The session has been accidentally closed")); 1753 task.m_pProgress->i_notifyComplete(hrc); 1758 1754 LogFlowThisFuncLeave(); 1759 1755 return; … … 1789 1785 /* save settings to ensure current changes are committed and 1790 1786 * hard disks are fixed up */ 1791 rc = i_saveSettings(NULL, alock); /******************1 */1787 hrc = i_saveSettings(NULL, alock); /******************1 */ 1792 1788 // no need to check for whether VirtualBox.xml needs changing since 1793 1789 // we can't have a machine XML rename pending at this point 1794 if (FAILED( rc))1795 throw rc;1790 if (FAILED(hrc)) 1791 throw hrc; 1796 1792 1797 1793 /* task.m_strStateFilePath is "" when the machine is offline or saved */ … … 1799 1795 { 1800 1796 Bstr value; 1801 rc = GetExtraData(Bstr("VBoxInternal2/ForceTakeSnapshotWithoutState").raw(), 1802 value.asOutParam()); 1803 if (FAILED(rc) || value != "1") 1797 hrc = GetExtraData(Bstr("VBoxInternal2/ForceTakeSnapshotWithoutState").raw(), value.asOutParam()); 1798 if (FAILED(hrc) || value != "1") 1804 1799 // creating a new online snapshot: we need a fresh saved state file 1805 1800 i_composeSavedStateFilename(task.m_strStateFilePath); … … 1812 1807 { 1813 1808 // ensure the directory for the saved state file exists 1814 rc = VirtualBox::i_ensureFilePathExists(task.m_strStateFilePath, true /* fCreate */);1815 if (FAILED( rc))1816 throw rc;1809 hrc = VirtualBox::i_ensureFilePathExists(task.m_strStateFilePath, true /* fCreate */); 1810 if (FAILED(hrc)) 1811 throw hrc; 1817 1812 } 1818 1813 … … 1822 1817 ComObjPtr<SnapshotMachine> pSnapshotMachine; 1823 1818 pSnapshotMachine.createObject(); 1824 rc = pSnapshotMachine->init(this, task.m_uuidSnapshot.ref(), task.m_strStateFilePath);1825 AssertComRCThrowRC( rc);1819 hrc = pSnapshotMachine->init(this, task.m_uuidSnapshot.ref(), task.m_strStateFilePath); 1820 AssertComRCThrowRC(hrc); 1826 1821 1827 1822 /* create a snapshot object */ … … 1829 1824 RTTimeNow(&time); 1830 1825 task.m_pSnapshot.createObject(); 1831 rc = task.m_pSnapshot->init(mParent,1832 task.m_uuidSnapshot,1833 task.m_strName,1834 task.m_strDescription,1835 time,1836 pSnapshotMachine,1837 mData->mCurrentSnapshot);1838 AssertComRCThrowRC( rc);1826 hrc = task.m_pSnapshot->init(mParent, 1827 task.m_uuidSnapshot, 1828 task.m_strName, 1829 task.m_strDescription, 1830 time, 1831 pSnapshotMachine, 1832 mData->mCurrentSnapshot); 1833 AssertComRCThrowRC(hrc); 1839 1834 1840 1835 /* STEP 2: create the diff images */ 1841 LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n", 1842 task.m_fTakingSnapshotOnline)); 1836 LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n", task.m_fTakingSnapshotOnline)); 1843 1837 1844 1838 // Backup the media data so we can recover if something goes wrong. … … 1849 1843 alock.release(); 1850 1844 /* create new differencing hard disks and attach them to this machine */ 1851 rc = i_createImplicitDiffs(task.m_pProgress,1852 1, // operation weight; must be the same as in Machine::TakeSnapshot()1853 task.m_fTakingSnapshotOnline);1854 if (FAILED( rc))1855 throw rc;1845 hrc = i_createImplicitDiffs(task.m_pProgress, 1846 1, // operation weight; must be the same as in Machine::TakeSnapshot() 1847 task.m_fTakingSnapshotOnline); 1848 if (FAILED(hrc)) 1849 throw hrc; 1856 1850 alock.acquire(); 1857 1851 … … 1873 1867 alock.release(); 1874 1868 task.m_pProgress->i_setCancelCallback(i_takeSnapshotProgressCancelCallback, &task); 1875 rc = task.m_pDirectControl->SaveStateWithReason(Reason_Snapshot,1876 task.m_pProgress,1877 task.m_pSnapshot,1878 Bstr(task.m_strStateFilePath).raw(),1879 task.m_fPause,1880 &fSuspendedBySave);1869 hrc = task.m_pDirectControl->SaveStateWithReason(Reason_Snapshot, 1870 task.m_pProgress, 1871 task.m_pSnapshot, 1872 Bstr(task.m_strStateFilePath).raw(), 1873 task.m_fPause, 1874 &fSuspendedBySave); 1881 1875 task.m_pProgress->i_setCancelCallback(NULL, NULL); 1882 1876 alock.acquire(); 1883 if (FAILED( rc))1884 throw rc;1877 if (FAILED(hrc)) 1878 throw hrc; 1885 1879 } 1886 1880 else … … 1897 1891 1898 1892 com::SafeIfaceArray<IMediumAttachment> atts; 1899 rc = COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));1900 if (FAILED( rc))1901 throw rc;1893 hrc = COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts)); 1894 if (FAILED(hrc)) 1895 throw hrc; 1902 1896 1903 1897 alock.release(); 1904 rc = task.m_pDirectControl->ReconfigureMediumAttachments(ComSafeArrayAsInParam(atts));1898 hrc = task.m_pDirectControl->ReconfigureMediumAttachments(ComSafeArrayAsInParam(atts)); 1905 1899 alock.acquire(); 1906 if (FAILED( rc))1907 throw rc;1900 if (FAILED(hrc)) 1901 throw hrc; 1908 1902 } 1909 1903 … … 1915 1909 Utf8Str strNVRAMSnapAbs; 1916 1910 i_calculateFullPath(strNVRAMSnap, strNVRAMSnapAbs); 1917 rc = VirtualBox::i_ensureFilePathExists(strNVRAMSnapAbs, true /* fCreate */);1918 if (FAILED( rc))1919 throw rc;1911 hrc = VirtualBox::i_ensureFilePathExists(strNVRAMSnapAbs, true /* fCreate */); 1912 if (FAILED(hrc)) 1913 throw hrc; 1920 1914 int vrc = RTFileCopy(strNVRAM.c_str(), strNVRAMSnapAbs.c_str()); 1921 1915 if (RT_FAILURE(vrc)) … … 1965 1959 * machine state to the state it had at the beginning. 1966 1960 */ 1967 rc = i_finishTakingSnapshot(task, alock, true /*aSuccess*/); /*******************2+3 */1968 // do not throw rc here because we can't call i_finishTakingSnapshot() twice1969 LogFlowThisFunc(("i_finishTakingSnapshot -> %Rhrc [mMachineState=%s]\n", rc, ::stringifyMachineState(mData->mMachineState)));1970 } 1971 catch (HRESULT rcThrown)1972 { 1973 rc = rcThrown;1974 LogThisFunc(("Caught %Rhrc [mMachineState=%s]\n", rc, ::stringifyMachineState(mData->mMachineState)));1961 hrc = i_finishTakingSnapshot(task, alock, true /*aSuccess*/); /*******************2+3 */ 1962 // do not throw hrc here because we can't call i_finishTakingSnapshot() twice 1963 LogFlowThisFunc(("i_finishTakingSnapshot -> %Rhrc [mMachineState=%s]\n", hrc, ::stringifyMachineState(mData->mMachineState))); 1964 } 1965 catch (HRESULT hrcXcpt) 1966 { 1967 hrc = hrcXcpt; 1968 LogThisFunc(("Caught %Rhrc [mMachineState=%s]\n", hrc, ::stringifyMachineState(mData->mMachineState))); 1975 1969 1976 1970 /// @todo r=klaus check that the implicit diffs created above are cleaned up im the relevant error cases … … 2013 2007 { 2014 2008 MachineState_T enmMachineState = MachineState_Null; 2015 HRESULT rc2 = task.m_pDirectControl->COMGETTER(NominalState)(&enmMachineState);2016 if (FAILED( rc2) || enmMachineState == MachineState_Null)2009 HRESULT hrc2 = task.m_pDirectControl->COMGETTER(NominalState)(&enmMachineState); 2010 if (FAILED(hrc2) || enmMachineState == MachineState_Null) 2017 2011 { 2018 2012 AssertMsgFailed(("state=%s\n", ::stringifyMachineState(enmMachineState))); … … 2025 2019 { 2026 2020 alock.release(); 2027 rc2 = task.m_pDirectControl->ResumeWithReason(Reason_Snapshot);2021 hrc2 = task.m_pDirectControl->ResumeWithReason(Reason_Snapshot); 2028 2022 alock.acquire(); 2029 if (SUCCEEDED( rc2))2023 if (SUCCEEDED(hrc2)) 2030 2024 enmMachineState = task.m_machineStateBackup; 2031 2025 } … … 2057 2051 } 2058 2052 2059 task.m_pProgress->i_notifyComplete( rc);2060 2061 if (SUCCEEDED( rc))2053 task.m_pProgress->i_notifyComplete(hrc); 2054 2055 if (SUCCEEDED(hrc)) 2062 2056 mParent->i_onSnapshotTaken(mData->mUuid, task.m_uuidSnapshot); 2063 2057 2064 if (SUCCEEDED( rc))2058 if (SUCCEEDED(hrc)) 2065 2059 { 2066 2060 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin(); … … 2126 2120 ComObjPtr<Snapshot> pOldCurrentSnap = mData->mCurrentSnapshot; 2127 2121 2128 HRESULT rc = S_OK;2122 HRESULT hrc = S_OK; 2129 2123 2130 2124 if (aSuccess) … … 2144 2138 flSaveSettings |= SaveS_ResetCurStateModified; 2145 2139 2146 rc = i_saveSettings(NULL, alock, flSaveSettings); /******************2 */2147 } 2148 2149 if (aSuccess && SUCCEEDED( rc))2140 hrc = i_saveSettings(NULL, alock, flSaveSettings); /******************2 */ 2141 } 2142 2143 if (aSuccess && SUCCEEDED(hrc)) 2150 2144 { 2151 2145 /* associate old hard disks with the snapshot and do locking/unlocking*/ … … 2186 2180 alock.acquire(); 2187 2181 2188 return rc;2182 return hrc; 2189 2183 } 2190 2184 … … 2228 2222 Global::stringifyMachineState(mData->mMachineState)); 2229 2223 2230 HRESULT rc = i_checkStateDependency(MutableOrSavedStateDep);2231 if (FAILED( rc))2232 return rc;2224 HRESULT hrc = i_checkStateDependency(MutableOrSavedStateDep); 2225 if (FAILED(hrc)) 2226 return hrc; 2233 2227 2234 2228 /* We need to explicitly check if the given snapshot is valid and bail out if not. */ … … 2285 2279 "RestoreSnap", 2286 2280 pSnapshot); 2287 rc = pTask->createThread();2281 hrc = pTask->createThread(); 2288 2282 pTask = NULL; 2289 if (FAILED( rc))2290 return rc;2283 if (FAILED(hrc)) 2284 return hrc; 2291 2285 2292 2286 /* set the proper machine state (note: after creating a Task instance) */ … … 2333 2327 } 2334 2328 2335 HRESULT rc = S_OK;2329 HRESULT hrc = S_OK; 2336 2330 Guid snapshotId; 2337 2331 std::set<ComObjPtr<Medium> > pMediumsForNotify; … … 2362 2356 task.modifyBackedUpState(MachineState_PoweredOff); 2363 2357 2364 rc = i_saveStateSettings(SaveSTS_StateFilePath);2365 if (FAILED( rc))2366 throw rc;2358 hrc = i_saveStateSettings(SaveSTS_StateFilePath); 2359 if (FAILED(hrc)) 2360 throw hrc; 2367 2361 } 2368 2362 … … 2405 2399 alock.release(); 2406 2400 2407 rc = i_createImplicitDiffs(task.m_pProgress, 2408 1, 2409 false /* aOnline */); 2410 if (FAILED(rc)) 2411 throw rc; 2401 hrc = i_createImplicitDiffs(task.m_pProgress, 1, false /* aOnline */); 2402 if (FAILED(hrc)) 2403 throw hrc; 2412 2404 2413 2405 alock.acquire(); … … 2553 2545 // save machine settings, reset the modified flag and commit; 2554 2546 bool fNeedsGlobalSaveSettings = false; 2555 rc = i_saveSettings(&fNeedsGlobalSaveSettings, alock, 2556 SaveS_ResetCurStateModified); 2557 if (FAILED(rc)) 2558 throw rc; 2547 hrc = i_saveSettings(&fNeedsGlobalSaveSettings, alock, SaveS_ResetCurStateModified); 2548 if (FAILED(hrc)) 2549 throw hrc; 2559 2550 2560 2551 // release the locks before updating registry and deleting image files … … 2576 2567 // store the id here because it becomes NULL after deleting storage. 2577 2568 com::Guid id = pMedium->i_getId(); 2578 HRESULT rc2 = pMedium->i_deleteStorage(NULL /* aProgress */, 2579 true /* aWait */, 2580 false /* aNotify */); 2569 HRESULT hrc2 = pMedium->i_deleteStorage(NULL /* aProgress */, true /* aWait */, false /* aNotify */); 2581 2570 // ignore errors here because we cannot roll back after i_saveSettings() above 2582 if (SUCCEEDED( rc2))2571 if (SUCCEEDED(hrc2)) 2583 2572 { 2584 2573 pMediumsForNotify.insert(pParent); … … 2590 2579 catch (HRESULT hrcXcpt) 2591 2580 { 2592 rc = hrcXcpt;2593 } 2594 2595 if (FAILED( rc))2581 hrc = hrcXcpt; 2582 } 2583 2584 if (FAILED(hrc)) 2596 2585 { 2597 2586 /* preserve existing error info */ … … 2609 2598 2610 2599 /* set the result (this will try to fetch current error info on failure) */ 2611 task.m_pProgress->i_notifyComplete( rc);2612 2613 if (SUCCEEDED( rc))2600 task.m_pProgress->i_notifyComplete(hrc); 2601 2602 if (SUCCEEDED(hrc)) 2614 2603 { 2615 2604 mParent->i_onSnapshotRestored(mData->mUuid, snapshotId); … … 2629 2618 } 2630 2619 2631 LogFlowThisFunc(("Done restoring snapshot ( rc=%08X)\n",rc));2620 LogFlowThisFunc(("Done restoring snapshot (hrc=%08X)\n", hrc)); 2632 2621 2633 2622 LogFlowThisFuncLeave(); … … 2731 2720 Global::stringifyMachineState(mData->mMachineState)); 2732 2721 2733 HRESULT rc = i_checkStateDependency(MutableOrSavedOrRunningStateDep);2734 if (FAILED( rc))2735 return rc;2722 HRESULT hrc = i_checkStateDependency(MutableOrSavedOrRunningStateDep); 2723 if (FAILED(hrc)) 2724 return hrc; 2736 2725 2737 2726 ComObjPtr<Snapshot> pSnapshot; 2738 rc = i_findSnapshotById(aStartId, pSnapshot, true /* aSetError */);2739 if (FAILED( rc))2740 return rc;2727 hrc = i_findSnapshotById(aStartId, pSnapshot, true /* aSetError */); 2728 if (FAILED(hrc)) 2729 return hrc; 2741 2730 2742 2731 AutoWriteLock snapshotLock(pSnapshot COMMA_LOCKVAL_SRC_POS); … … 2766 2755 { 2767 2756 snapshotLock.release(); 2768 rc = i_saveSettings(NULL, alock);2757 hrc = i_saveSettings(NULL, alock); 2769 2758 snapshotLock.acquire(); 2770 2759 // no need to change for whether VirtualBox.xml needs saving since 2771 2760 // we can't have a machine XML rename pending at this point 2772 if (FAILED( rc)) returnrc;2761 if (FAILED(hrc)) return hrc; 2773 2762 } 2774 2763 } … … 2839 2828 fDeleteOnline, 2840 2829 pSnapshot); 2841 rc = pTask->createThread();2830 hrc = pTask->createThread(); 2842 2831 pTask = NULL; 2843 if (FAILED( rc))2844 return rc;2832 if (FAILED(hrc)) 2833 return hrc; 2845 2834 2846 2835 // the task might start running but will block on acquiring the machine's write lock … … 2988 2977 try 2989 2978 { 2990 HRESULT rc = S_OK;2979 HRESULT hrc = S_OK; 2991 2980 2992 2981 /* Locking order: */ … … 3069 3058 if (pOnlineMediumAttachment) 3070 3059 { 3071 rc = mData->mSession.mLockedMedia.Get(pOnlineMediumAttachment, 3072 pVMMALockList); 3073 if (FAILED(rc)) 3060 hrc = mData->mSession.mLockedMedia.Get(pOnlineMediumAttachment, pVMMALockList); 3061 if (FAILED(hrc)) 3074 3062 fOnlineMergePossible = false; 3075 3063 } … … 3082 3070 3083 3071 treeLock.release(); 3084 rc = i_prepareDeleteSnapshotMedium(pHD, machineId, snapshotId,3085 fOnlineMergePossible,3086 pVMMALockList, pSource, pTarget,3087 fMergeForward, pParentForTarget,3088 pChildrenToReparent,3089 fNeedsOnlineMerge,3090 pMediumLockList,3091 pHDLockToken);3072 hrc = i_prepareDeleteSnapshotMedium(pHD, machineId, snapshotId, 3073 fOnlineMergePossible, 3074 pVMMALockList, pSource, pTarget, 3075 fMergeForward, pParentForTarget, 3076 pChildrenToReparent, 3077 fNeedsOnlineMerge, 3078 pMediumLockList, 3079 pHDLockToken); 3092 3080 treeLock.acquire(); 3093 if (FAILED( rc))3094 throw rc;3081 if (FAILED(hrc)) 3082 throw hrc; 3095 3083 3096 3084 // For simplicity, prepareDeleteSnapshotMedium selects the merge … … 3107 3095 // not going to merge a big source into a small target on online merge. Otherwise it will be resized 3108 3096 if (fNeedsOnlineMerge && pSource->i_getLogicalSize() > pTarget->i_getLogicalSize()) 3109 { 3110 rc = setError(E_FAIL, 3111 tr("Unable to merge storage '%s', because it is smaller than the source image. If you resize it to have a capacity of at least %lld bytes you can retry", 3112 "", pSource->i_getLogicalSize()), 3113 pTarget->i_getLocationFull().c_str(), pSource->i_getLogicalSize()); 3114 throw rc; 3115 } 3097 throw setError(E_FAIL, 3098 tr("Unable to merge storage '%s', because it is smaller than the source image. If you resize it to have a capacity of at least %lld bytes you can retry", 3099 "", pSource->i_getLogicalSize()), 3100 pTarget->i_getLocationFull().c_str(), pSource->i_getLogicalSize()); 3116 3101 3117 3102 // a couple paranoia checks for backward merges … … 3147 3132 // Note that the medium attachment object stays associated 3148 3133 // with the snapshot until the merge was successful. 3149 HRESULT rc2 = S_OK; 3150 rc2 = pSource->i_removeBackReference(replaceMachineId, replaceSnapshotId); 3151 AssertComRC(rc2); 3134 HRESULT hrc2 = pSource->i_removeBackReference(replaceMachineId, replaceSnapshotId); 3135 AssertComRC(hrc2); 3152 3136 3153 3137 toDelete.push_back(MediumDeleteRec(pHD, pSource, pTarget, … … 3199 3183 } 3200 3184 3201 rc = pTarget_local->COMGETTER(MediumFormat)(pTargetFormat.asOutParam());3202 if (FAILED( rc))3203 throw rc;3185 hrc = pTarget_local->COMGETTER(MediumFormat)(pTargetFormat.asOutParam()); 3186 if (FAILED(hrc)) 3187 throw hrc; 3204 3188 3205 3189 if (pTarget_local->i_isMediumFormatFile()) … … 3207 3191 int vrc = RTFsQuerySerial(pTarget_local->i_getLocationFull().c_str(), &pu32Serial); 3208 3192 if (RT_FAILURE(vrc)) 3209 { 3210 rc = setError(E_FAIL, 3211 tr("Unable to merge storage '%s'. Can't get storage UID"), 3212 pTarget_local->i_getLocationFull().c_str()); 3213 throw rc; 3214 } 3193 throw setError(E_FAIL, 3194 tr("Unable to merge storage '%s'. Can't get storage UID"), 3195 pTarget_local->i_getLocationFull().c_str()); 3215 3196 3216 3197 pSource_local->COMGETTER(Size)((LONG64*)&diskSize); … … 3250 3231 LogFlowThisFunc(("Path to the storage wasn't found...\n")); 3251 3232 3252 rc = setError(E_INVALIDARG, 3253 tr("Unable to merge storage '%s'. Path to the storage wasn't found"), 3254 it_sm->second); 3255 throw rc; 3233 throw setError(E_INVALIDARG, 3234 tr("Unable to merge storage '%s'. Path to the storage wasn't found"), 3235 it_sm->second); 3256 3236 } 3257 3237 … … 3259 3239 if (RT_FAILURE(vrc)) 3260 3240 { 3261 rc = setError(E_FAIL, 3262 tr("Unable to merge storage '%s'. Can't get the storage size"), 3263 it_sm->second); 3264 throw rc; 3241 throw setError(E_FAIL, 3242 tr("Unable to merge storage '%s'. Can't get the storage size"), 3243 it_sm->second); 3265 3244 } 3266 3245 … … 3269 3248 LogFlowThisFunc(("Not enough free space to merge...\n")); 3270 3249 3271 rc = setError(E_OUTOFMEMORY, 3272 tr("Unable to merge storage '%s'. Not enough free storage space"), 3273 it_sm->second); 3274 throw rc; 3250 throw setError(E_OUTOFMEMORY, 3251 tr("Unable to merge storage '%s'. Not enough free storage space"), 3252 it_sm->second); 3275 3253 } 3276 3254 … … 3363 3341 Guid uMedium = pMedium->i_getId(); 3364 3342 DeviceType_T uMediumType = pMedium->i_getDeviceType(); 3365 rc = pMedium->i_deleteStorage(&task.m_pProgress, 3366 true /* aWait */, 3367 false /* aNotify */); 3368 if (FAILED(rc)) 3369 throw rc; 3343 hrc = pMedium->i_deleteStorage(&task.m_pProgress, true /* aWait */, false /* aNotify */); 3344 if (FAILED(hrc)) 3345 throw hrc; 3370 3346 3371 3347 pMediumsForNotify.insert(pParent); … … 3424 3400 mConsoleTaskData.mDeleteSnapshotInfo = (void *)&(*it); 3425 3401 // online medium merge, in the direction decided earlier 3426 rc = i_onlineMergeMedium(it->mpOnlineMediumAttachment,3427 it->mpSource,3428 it->mpTarget,3429 it->mfMergeForward,3430 it->mpParentForTarget,3431 it->mpChildrenToReparent,3432 it->mpMediumLockList,3433 task.m_pProgress,3434 &fNeedsSave);3402 hrc = i_onlineMergeMedium(it->mpOnlineMediumAttachment, 3403 it->mpSource, 3404 it->mpTarget, 3405 it->mfMergeForward, 3406 it->mpParentForTarget, 3407 it->mpChildrenToReparent, 3408 it->mpMediumLockList, 3409 task.m_pProgress, 3410 &fNeedsSave); 3435 3411 mConsoleTaskData.mDeleteSnapshotInfo = NULL; 3436 3412 } … … 3438 3414 { 3439 3415 // normal medium merge, in the direction decided earlier 3440 rc = it->mpSource->i_mergeTo(it->mpTarget,3441 it->mfMergeForward,3442 it->mpParentForTarget,3443 it->mpChildrenToReparent,3444 it->mpMediumLockList,3445 &task.m_pProgress,3446 true /* aWait */,3447 false /* aNotify */);3416 hrc = it->mpSource->i_mergeTo(it->mpTarget, 3417 it->mfMergeForward, 3418 it->mpParentForTarget, 3419 it->mpChildrenToReparent, 3420 it->mpMediumLockList, 3421 &task.m_pProgress, 3422 true /* aWait */, 3423 false /* aNotify */); 3448 3424 } 3449 3425 … … 3454 3430 // moment) is still there or not. Be careful not to lose the 3455 3431 // error code below, before the "Delayed failure exit". 3456 if (FAILED( rc))3432 if (FAILED(hrc)) 3457 3433 { 3458 3434 AutoReadLock mlock(it->mpSource COMMA_LOCKVAL_SRC_POS); … … 3460 3436 // Diff medium not backed by a file - cannot get status so 3461 3437 // be pessimistic. 3462 throw rc;3438 throw hrc; 3463 3439 const Utf8Str &loc = it->mpSource->i_getLocationFull(); 3464 3440 // Source medium is still there, so merge failed early. 3465 3441 if (RTFileExists(loc.c_str())) 3466 throw rc;3442 throw hrc; 3467 3443 3468 3444 // Source medium is gone. Assume the merge succeeded and … … 3551 3527 // Delayed failure exit when the merge cleanup failed but the 3552 3528 // merge actually succeeded. 3553 if (FAILED( rc))3554 throw rc;3529 if (FAILED(hrc)) 3530 throw hrc; 3555 3531 } 3556 3532 … … 3638 3614 } 3639 3615 3640 LogFlowThisFunc(("Done deleting snapshot ( rc=%08X)\n", (HRESULT)mrc));3616 LogFlowThisFunc(("Done deleting snapshot (mrc=%08X)\n", (HRESULT)mrc)); 3641 3617 LogFlowThisFuncLeave(); 3642 3618 } … … 3764 3740 childLock.release(); 3765 3741 alock.release(); 3766 HRESULT rc = aHD->i_queryPreferredMergeDirection(pChild, fMergeForward);3742 HRESULT hrc = aHD->i_queryPreferredMergeDirection(pChild, fMergeForward); 3767 3743 alock.acquire(); 3768 3744 childLock.acquire(); 3769 3745 3770 if (FAILED( rc) &&rc != E_FAIL)3771 return rc;3746 if (FAILED(hrc) && hrc != E_FAIL) 3747 return hrc; 3772 3748 3773 3749 if (fMergeForward) … … 3785 3761 } 3786 3762 3787 HRESULT rc;3763 HRESULT hrc; 3788 3764 childLock.release(); 3789 3765 alock.release(); 3790 rc = aSource->i_prepareMergeTo(aTarget, &aMachineId, &aSnapshotId,3791 !fOnlineMergePossible /* fLockMedia */,3792 aMergeForward, aParentForTarget,3793 aChildrenToReparent, aMediumLockList);3766 hrc = aSource->i_prepareMergeTo(aTarget, &aMachineId, &aSnapshotId, 3767 !fOnlineMergePossible /* fLockMedia */, 3768 aMergeForward, aParentForTarget, 3769 aChildrenToReparent, aMediumLockList); 3794 3770 alock.acquire(); 3795 3771 childLock.acquire(); 3796 if (SUCCEEDED( rc) && fOnlineMergePossible)3772 if (SUCCEEDED(hrc) && fOnlineMergePossible) 3797 3773 { 3798 3774 /* Try to lock the newly constructed medium lock list. If it succeeds … … 3802 3778 childLock.release(); 3803 3779 alock.release(); 3804 rc = aMediumLockList->Lock();3780 hrc = aMediumLockList->Lock(); 3805 3781 alock.acquire(); 3806 3782 childLock.acquire(); 3807 if (FAILED( rc))3783 if (FAILED(hrc)) 3808 3784 { 3809 3785 /* Locking failed, this cannot be done as an offline merge. Try to … … 3834 3810 childLock.release(); 3835 3811 alock.release(); 3836 rc = it->UpdateLock(fLockReq);3812 hrc = it->UpdateLock(fLockReq); 3837 3813 alock.acquire(); 3838 3814 childLock.acquire(); 3839 if (FAILED( rc))3815 if (FAILED(hrc)) 3840 3816 { 3841 3817 // could not update the lock, trigger cleanup below … … 3862 3838 childLock.release(); 3863 3839 alock.release(); 3864 rc = aChildrenToReparent->Lock(true /* fSkipOverLockedMedia */);3840 hrc = aChildrenToReparent->Lock(true /* fSkipOverLockedMedia */); 3865 3841 alock.acquire(); 3866 3842 childLock.acquire(); … … 3878 3854 childLock.release(); 3879 3855 alock.release(); 3880 rc = aVMMALockList->Update(pMedium, true);3856 hrc = aVMMALockList->Update(pMedium, true); 3881 3857 alock.acquire(); 3882 3858 childLock.acquire(); 3883 3859 mediumLock.acquire(); 3884 if (FAILED( rc))3885 throw rc;3860 if (FAILED(hrc)) 3861 throw hrc; 3886 3862 } 3887 3863 } … … 3893 3869 childLock.release(); 3894 3870 alock.release(); 3895 rc = aVMMALockList->Lock();3871 hrc = aVMMALockList->Lock(); 3896 3872 alock.acquire(); 3897 3873 childLock.acquire(); 3898 if (FAILED( rc))3874 if (FAILED(hrc)) 3899 3875 { 3900 3876 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3901 rc = setError(rc,3902 tr("Cannot lock hard disk '%s' for a live merge"),3903 aHD->i_getLocationFull().c_str());3877 hrc = setError(hrc, 3878 tr("Cannot lock hard disk '%s' for a live merge"), 3879 aHD->i_getLocationFull().c_str()); 3904 3880 } 3905 3881 else … … 3913 3889 { 3914 3890 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3915 rc = setError(rc,3916 tr("Failed to construct lock list for a live merge of hard disk '%s'"),3917 aHD->i_getLocationFull().c_str());3891 hrc = setError(hrc, 3892 tr("Failed to construct lock list for a live merge of hard disk '%s'"), 3893 aHD->i_getLocationFull().c_str()); 3918 3894 } 3919 3895 3920 3896 // fix the VM's lock list if anything failed 3921 if (FAILED( rc))3897 if (FAILED(hrc)) 3922 3898 { 3923 3899 lockListVMMABegin = aVMMALockList->GetBegin(); … … 3943 3919 } 3944 3920 } 3945 else if (FAILED( rc))3921 else if (FAILED(hrc)) 3946 3922 { 3947 3923 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3948 rc = setError(rc,3949 tr("Cannot lock hard disk '%s' when deleting a snapshot"),3950 aHD->i_getLocationFull().c_str());3951 } 3952 3953 return rc;3924 hrc = setError(hrc, 3925 tr("Cannot lock hard disk '%s' when deleting a snapshot"), 3926 aHD->i_getLocationFull().c_str()); 3927 } 3928 3929 return hrc; 3954 3930 } 3955 3931 … … 3990 3966 if (!aHDLockToken.isNull()) 3991 3967 { 3992 HRESULT rc = aHDLockToken->Abandon();3993 AssertComRC( rc);3968 HRESULT hrc = aHDLockToken->Abandon(); 3969 AssertComRC(hrc); 3994 3970 } 3995 3971 } 3996 3972 else 3997 3973 { 3998 HRESULT rc = aHD->i_unmarkForDeletion();3999 AssertComRC( rc);3974 HRESULT hrc = aHD->i_unmarkForDeletion(); 3975 AssertComRC(hrc); 4000 3976 } 4001 3977 } … … 4043 4019 { 4044 4020 // reattach the source media to the snapshot 4045 HRESULT rc = aSource->i_addBackReference(aMachineId, aSnapshotId);4046 AssertComRC( rc);4021 HRESULT hrc = aSource->i_addBackReference(aMachineId, aSnapshotId); 4022 AssertComRC(hrc); 4047 4023 } 4048 4024 } … … 4084 4060 NOREF(aChildrenToReparent); 4085 4061 4086 HRESULT rc = S_OK;4062 HRESULT hrc = S_OK; 4087 4063 4088 4064 try … … 4136 4112 // Must not hold any locks here, as this will call back to finish 4137 4113 // updating the medium attachment, chain linking and state. 4138 rc = directControl->OnlineMergeMedium(aMediumAttachment, 4139 uSourceIdx, uTargetIdx, 4140 aProgress); 4141 if (FAILED(rc)) 4142 throw rc; 4143 } 4144 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4114 hrc = directControl->OnlineMergeMedium(aMediumAttachment, uSourceIdx, uTargetIdx, aProgress); 4115 if (FAILED(hrc)) 4116 throw hrc; 4117 } 4118 catch (HRESULT hrcXcpt) { hrc = hrcXcpt; } 4145 4119 4146 4120 // The callback mentioned above takes care of update the medium state … … 4149 4123 *pfNeedsMachineSaveSettings = true; 4150 4124 4151 return rc;4125 return hrc; 4152 4126 } 4153 4127 … … 4164 4138 HRESULT SessionMachine::finishOnlineMergeMedium() 4165 4139 { 4166 HRESULT rc = S_OK;4140 HRESULT hrc = S_OK; 4167 4141 MediumDeleteRec *pDeleteRec = (MediumDeleteRec *)mConsoleTaskData.mDeleteSnapshotInfo; 4168 4142 AssertReturn(pDeleteRec, E_FAIL); … … 4183 4157 // first, unregister the target since it may become a base 4184 4158 // hard disk which needs re-registration 4185 rc = mParent->i_unregisterMedium(pDeleteRec->mpTarget);4186 AssertComRC( rc);4159 hrc = mParent->i_unregisterMedium(pDeleteRec->mpTarget); 4160 AssertComRC(hrc); 4187 4161 4188 4162 // then, reparent it and disconnect the deleted branch at … … 4194 4168 4195 4169 // then, register again 4196 rc = mParent->i_registerMedium(pDeleteRec->mpTarget, &pDeleteRec->mpTarget, treeLock);4197 AssertComRC( rc);4170 hrc = mParent->i_registerMedium(pDeleteRec->mpTarget, &pDeleteRec->mpTarget, treeLock); 4171 AssertComRC(hrc); 4198 4172 } 4199 4173 else … … 4242 4216 /* unregister and uninitialize all hard disks removed by the merge */ 4243 4217 MediumLockList *pMediumLockList = NULL; 4244 rc = mData->mSession.mLockedMedia.Get(pDeleteRec->mpOnlineMediumAttachment, pMediumLockList);4218 hrc = mData->mSession.mLockedMedia.Get(pDeleteRec->mpOnlineMediumAttachment, pMediumLockList); 4245 4219 const ComObjPtr<Medium> &pLast = pDeleteRec->mfMergeForward ? pDeleteRec->mpTarget : pDeleteRec->mpSource; 4246 AssertReturn(SUCCEEDED( rc) && pMediumLockList, E_FAIL);4220 AssertReturn(SUCCEEDED(hrc) && pMediumLockList, E_FAIL); 4247 4221 MediumLockList::Base::iterator lockListBegin = 4248 4222 pMediumLockList->GetBegin(); … … 4266 4240 else 4267 4241 { 4268 rc = mParent->i_unregisterMedium(pMedium);4269 AssertComRC( rc);4242 hrc = mParent->i_unregisterMedium(pMedium); 4243 AssertComRC(hrc); 4270 4244 4271 4245 /* now, uninitialize the deleted hard disk (note that … … 4290 4264 * caller added by MergeChain before uninit() and updates the 4291 4265 * iterator to point to the right place. */ 4292 rc = pMediumLockList->RemoveByIterator(it);4293 AssertComRC( rc);4266 hrc = pMediumLockList->RemoveByIterator(it); 4267 AssertComRC(hrc); 4294 4268 4295 4269 treeLock.release();
Note:
See TracChangeset
for help on using the changeset viewer.