Changeset 41106 in vbox
- Timestamp:
- May 1, 2012 8:02:21 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r41105 r41106 226 226 /* VBoxManageDisk.cpp */ 227 227 HRESULT findMedium(HandlerArg *a, const char *pszFilenameOrUuid, 228 229 228 DeviceType_T enmDevType, bool fSilent, 229 ComPtr<IMedium> &pMedium); 230 230 HRESULT findOrOpenMedium(HandlerArg *a, const char *pszFilenameOrUuid, 231 231 DeviceType_T enmDevType, ComPtr<IMedium> &pMedium, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r41105 r41106 171 171 172 172 if (!fSilent) 173 #if 0 // Substitute call to FindMedium to OpenMedium174 173 CHECK_ERROR(a->virtualBox, FindMedium(Bstr(pszFilenameOrUuid).raw(), 175 174 enmDevType, pMedium.asOutParam())); 176 #endif177 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(pszFilenameOrUuid).raw(),178 enmDevType, AccessMode_ReadWrite,179 /* fForceNewUuidOnOpen */ false,180 pMedium.asOutParam()));181 175 else 182 #if 0 // Substitute call to FindMedium to OpenMedium183 176 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), 184 enmDevType, pMedium.asOutParam()); 185 #endif 186 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 187 enmDevType, AccessMode_ReadWrite, 188 /* fForceNewUuidOnOpen */ false, 189 pMedium.asOutParam()); 177 enmDevType, pMedium.asOutParam()); 190 178 return rc; 191 179 } … … 212 200 } 213 201 214 #if 0 // Substitute call to FindMedium to OpenMedium215 202 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, 216 203 pMedium.asOutParam()); 217 #endif218 219 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(),220 enmDevType, AccessMode_ReadWrite,221 fForceNewUuidOnOpen,222 pMedium.asOutParam());223 204 /* If the medium is unknown try to open it. */ 224 205 if (!pMedium) -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r41105 r41106 1462 1462 */ 1463 1463 Bstr bstrHdaFile(hdaFile); 1464 #if 0 // Substitute call to FindMedium to OpenMedium1465 1464 pVirtualBox->FindMedium(bstrHdaFile.raw(), DeviceType_HardDisk, 1466 pMedium.asOutParam());1467 #endif1468 pVirtualBox->OpenMedium(bstrHdaFile.raw(), DeviceType_HardDisk,1469 AccessMode_ReadWrite, FALSE /* fForceNewUuid */,1470 1465 pMedium.asOutParam()); 1471 1466 if (!pMedium) … … 1550 1545 { 1551 1546 /* try to find an existing one */ 1552 #if 0 // Substitute call to FindMedium to OpenMedium1553 1547 rc = pVirtualBox->FindMedium(bstrFdaFile.raw(), DeviceType_Floppy, 1554 1548 pMedium.asOutParam()); 1555 #endif1556 rc = pVirtualBox->OpenMedium(bstrFdaFile.raw(),1557 DeviceType_Floppy,1558 AccessMode_ReadWrite,1559 FALSE /* fForceNewUuid */,1560 pMedium.asOutParam());1561 1549 if (FAILED(rc)) 1562 1550 { … … 1638 1626 { 1639 1627 /* try to find an existing one */ 1640 #if 0 // Substitute call to FindMedium to OpenMedium1641 1628 rc = pVirtualBox->FindMedium(bstrCdromFile.raw(), DeviceType_DVD, 1642 1629 pMedium.asOutParam()); 1643 #endif1644 rc = pVirtualBox->OpenMedium(bstrCdromFile.raw(), DeviceType_DVD,1645 AccessMode_ReadWrite, FALSE /* fForceNewUuid */,1646 pMedium.asOutParam());1647 1630 if (FAILED(rc)) 1648 1631 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r41105 r41106 425 425 { 426 426 QString strUuid; 427 #if 0 // Substitute call to FindMedium to OpenMedium428 427 CMedium image = vbox.FindMedium(strSource, KDeviceType_DVD); 429 #endif430 431 CMedium image = vbox.OpenMedium(strSource, KDeviceType_DVD, KAccessMode_ReadWrite, false /* fForceNewUuid */);432 428 if (image.isNull()) 433 429 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r41105 r41106 1957 1957 <param name="medium" type="IMedium" dir="return"> 1958 1958 <desc>Opened medium object.</desc> 1959 </param> 1960 </method> 1961 1962 <method name="findMedium"> 1963 <desc> 1964 Returns a medium of the given type that uses the given fully qualified 1965 location or UUID to store medium data. 1966 1967 The given medium must be known to this VirtualBox installation, i.e. 1968 it must be previously created by <link to="#createHardDisk"/> or opened 1969 by <link to="#openMedium"/>. 1970 1971 The search is done by comparing the value of the @a location argument to 1972 the <link to="IMedium::location"/> and <link to="IMedium::id" /> 1973 attributes of each known medium. 1974 1975 On case sensitive file systems, a case sensitive comparison is performed, 1976 otherwise the case of symbols in the file path is ignored. 1977 1978 <result name="VBOX_E_OBJECT_NOT_FOUND"> 1979 No medium object matching @a location found. 1980 </result> 1981 </desc> 1982 <param name="location" type="wstring" dir="in"> 1983 <desc>What to search for. This can either be the UUID or the location string of an open medium.</desc> 1984 </param> 1985 <param name="type" type="DeviceType" dir="in"> 1986 <desc>Device type (must be HardDisk, DVD or Floppy)</desc> 1987 </param> 1988 <param name="medium" type="IMedium" dir="return"> 1989 <desc>Medium object, if found.</desc> 1959 1990 </param> 1960 1991 </method> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r41105 r41106 145 145 BOOL fForceNewUuid, 146 146 IMedium **aMedium); 147 #if 0 // Remove def of fineMedium 148 STDMETHOD(FindMedium)(IN_BSTR aLocation, 149 DeviceType_T deviceType, 150 IMedium **aMedium); 151 #endif 147 STDMETHOD(FindMedium)(IN_BSTR aLocation, 148 DeviceType_T deviceType, 149 IMedium **aMedium); 152 150 153 151 STDMETHOD(GetGuestOSType)(IN_BSTR aId, IGuestOSType **aType); -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r41105 r41106 626 626 * already */ 627 627 /** @todo: Maybe too cost-intensive; try to find a lighter way */ 628 629 #if 0 // Substitute call to FindMedium to OpenMedium 630 while ( RTPathExists(tmpName) 631 || mVirtualBox->FindMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, &harddisk) != VBOX_E_OBJECT_NOT_FOUND 632 ) 633 #endif 634 635 while ( RTPathExists(tmpName) 636 || mVirtualBox->OpenMedium(Bstr(tmpName).raw(), 637 DeviceType_HardDisk, 638 AccessMode_ReadWrite, 639 FALSE /* fForceNewUuid */, 640 &harddisk) != VBOX_E_OBJECT_NOT_FOUND 641 ) 628 while ( RTPathExists(tmpName) 629 || mVirtualBox->FindMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, &harddisk) != VBOX_E_OBJECT_NOT_FOUND 630 ) 642 631 { 643 632 RTStrFree(tmpName); -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r41105 r41106 795 795 796 796 Log(("Finding source disk \"%ls\"\n", bstrSrcFilePath.raw())); 797 798 #if 0 // Substitute call to FindMedium to OpenMedium799 797 HRESULT rc = mVirtualBox->FindMedium(bstrSrcFilePath.raw(), DeviceType_HardDisk, pSourceDisk.asOutParam()); 800 #endif801 HRESULT rc = mVirtualBox->OpenMedium(bstrSrcFilePath.raw(),802 DeviceType_HardDisk,803 AccessMode_ReadWrite,804 FALSE /* fForceNewUuid */,805 pSourceDisk.asOutParam());806 798 if (FAILED(rc)) throw rc; 807 799 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r41105 r41106 1771 1771 } 1772 1772 1773 #if 0 // FindMedium is redundant1774 1773 STDMETHODIMP VirtualBox::FindMedium(IN_BSTR aLocation, 1775 1776 1777 { 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1774 DeviceType_T aDeviceType, 1775 IMedium **aMedium) 1776 { 1777 CheckComArgStrNotEmptyOrNull(aLocation); 1778 CheckComArgOutPointerValid(aMedium); 1779 1780 AutoCaller autoCaller(this); 1781 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1782 1783 Guid id(aLocation); 1784 Utf8Str strLocation(aLocation); 1785 1786 HRESULT rc; 1787 ComObjPtr<Medium> pMedium; 1788 1789 switch (aDeviceType) 1790 { 1791 case DeviceType_HardDisk: 1792 if (!id.isEmpty()) 1793 rc = findHardDiskById(id, true /* setError */, &pMedium); 1794 else 1795 rc = findHardDiskByLocation(strLocation, true /* setError */, &pMedium); 1796 break; 1797 1798 case DeviceType_Floppy: 1799 case DeviceType_DVD: 1800 if (!id.isEmpty()) 1801 rc = findDVDOrFloppyImage(aDeviceType, &id, Utf8Str::Empty, true /* setError */, &pMedium); 1802 else 1803 rc = findDVDOrFloppyImage(aDeviceType, NULL, strLocation, true /* setError */, &pMedium); 1804 break; 1805 1806 default: 1808 1807 return setError(E_INVALIDARG, 1809 1808 tr("Invalid device type %d"), aDeviceType); 1810 } 1811 #endif 1809 } 1812 1810 1813 1811 /* the below will set *aHardDisk to NULL if hardDisk is null */ 1814 //pMedium.queryInterfaceTo(aMedium);1815 1816 //return rc;1817 //}1812 pMedium.queryInterfaceTo(aMedium); 1813 1814 return rc; 1815 } 1818 1816 1819 1817 /** @note Locks this object for reading. */
Note:
See TracChangeset
for help on using the changeset viewer.