Changeset 41105 in vbox
- Timestamp:
- May 1, 2012 6:14:46 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r40470 r41105 226 226 /* VBoxManageDisk.cpp */ 227 227 HRESULT findMedium(HandlerArg *a, const char *pszFilenameOrUuid, 228 DeviceType_T enmDevType, bool fSilent,229 ComPtr<IMedium> &pMedium);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
r40905 r41105 171 171 172 172 if (!fSilent) 173 #if 0 // Substitute call to FindMedium to OpenMedium 173 174 CHECK_ERROR(a->virtualBox, FindMedium(Bstr(pszFilenameOrUuid).raw(), 174 175 enmDevType, pMedium.asOutParam())); 176 #endif 177 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(pszFilenameOrUuid).raw(), 178 enmDevType, AccessMode_ReadWrite, 179 /* fForceNewUuidOnOpen */ false, 180 pMedium.asOutParam())); 175 181 else 182 #if 0 // Substitute call to FindMedium to OpenMedium 176 183 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), 177 enmDevType, pMedium.asOutParam()); 184 enmDevType, pMedium.asOutParam()); 185 #endif 186 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 187 enmDevType, AccessMode_ReadWrite, 188 /* fForceNewUuidOnOpen */ false, 189 pMedium.asOutParam()); 178 190 return rc; 179 191 } … … 200 212 } 201 213 214 #if 0 // Substitute call to FindMedium to OpenMedium 202 215 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, 203 216 pMedium.asOutParam()); 217 #endif 218 219 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 220 enmDevType, AccessMode_ReadWrite, 221 fForceNewUuidOnOpen, 222 pMedium.asOutParam()); 204 223 /* If the medium is unknown try to open it. */ 205 224 if (!pMedium) -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r41100 r41105 1462 1462 */ 1463 1463 Bstr bstrHdaFile(hdaFile); 1464 #if 0 // Substitute call to FindMedium to OpenMedium 1464 1465 pVirtualBox->FindMedium(bstrHdaFile.raw(), DeviceType_HardDisk, 1466 pMedium.asOutParam()); 1467 #endif 1468 pVirtualBox->OpenMedium(bstrHdaFile.raw(), DeviceType_HardDisk, 1469 AccessMode_ReadWrite, FALSE /* fForceNewUuid */, 1465 1470 pMedium.asOutParam()); 1466 1471 if (!pMedium) … … 1545 1550 { 1546 1551 /* try to find an existing one */ 1552 #if 0 // Substitute call to FindMedium to OpenMedium 1547 1553 rc = pVirtualBox->FindMedium(bstrFdaFile.raw(), DeviceType_Floppy, 1548 1554 pMedium.asOutParam()); 1555 #endif 1556 rc = pVirtualBox->OpenMedium(bstrFdaFile.raw(), 1557 DeviceType_Floppy, 1558 AccessMode_ReadWrite, 1559 FALSE /* fForceNewUuid */, 1560 pMedium.asOutParam()); 1549 1561 if (FAILED(rc)) 1550 1562 { … … 1626 1638 { 1627 1639 /* try to find an existing one */ 1640 #if 0 // Substitute call to FindMedium to OpenMedium 1628 1641 rc = pVirtualBox->FindMedium(bstrCdromFile.raw(), DeviceType_DVD, 1629 1642 pMedium.asOutParam()); 1643 #endif 1644 rc = pVirtualBox->OpenMedium(bstrCdromFile.raw(), DeviceType_DVD, 1645 AccessMode_ReadWrite, FALSE /* fForceNewUuid */, 1646 pMedium.asOutParam()); 1630 1647 if (FAILED(rc)) 1631 1648 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r41051 r41105 425 425 { 426 426 QString strUuid; 427 #if 0 // Substitute call to FindMedium to OpenMedium 427 428 CMedium image = vbox.FindMedium(strSource, KDeviceType_DVD); 429 #endif 430 431 CMedium image = vbox.OpenMedium(strSource, KDeviceType_DVD, KAccessMode_ReadWrite, false /* fForceNewUuid */); 428 432 if (image.isNull()) 429 433 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r41049 r41105 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 qualified1965 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 opened1969 by <link to="#openMedium"/>.1970 1971 The search is done by comparing the value of the @a location argument to1972 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>1990 1959 </param> 1991 1960 </method> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r40539 r41105 145 145 BOOL fForceNewUuid, 146 146 IMedium **aMedium); 147 STDMETHOD(FindMedium)(IN_BSTR aLocation, 148 DeviceType_T deviceType, 149 IMedium **aMedium); 147 #if 0 // Remove def of fineMedium 148 STDMETHOD(FindMedium)(IN_BSTR aLocation, 149 DeviceType_T deviceType, 150 IMedium **aMedium); 151 #endif 150 152 151 153 STDMETHOD(GetGuestOSType)(IN_BSTR aId, IGuestOSType **aType); -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r39248 r41105 626 626 * already */ 627 627 /** @todo: Maybe too cost-intensive; try to find a lighter way */ 628 while ( RTPathExists(tmpName) 629 || mVirtualBox->FindMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, &harddisk) != VBOX_E_OBJECT_NOT_FOUND 630 ) 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 ) 631 642 { 632 643 RTStrFree(tmpName); -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r40329 r41105 795 795 796 796 Log(("Finding source disk \"%ls\"\n", bstrSrcFilePath.raw())); 797 798 #if 0 // Substitute call to FindMedium to OpenMedium 797 799 HRESULT rc = mVirtualBox->FindMedium(bstrSrcFilePath.raw(), DeviceType_HardDisk, pSourceDisk.asOutParam()); 800 #endif 801 HRESULT rc = mVirtualBox->OpenMedium(bstrSrcFilePath.raw(), 802 DeviceType_HardDisk, 803 AccessMode_ReadWrite, 804 FALSE /* fForceNewUuid */, 805 pSourceDisk.asOutParam()); 798 806 if (FAILED(rc)) throw rc; 799 807 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r41026 r41105 1771 1771 } 1772 1772 1773 #if 0 // FindMedium is redundant 1773 1774 STDMETHODIMP VirtualBox::FindMedium(IN_BSTR aLocation, 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 else1795 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 else1803 rc = findDVDOrFloppyImage(aDeviceType, NULL, strLocation, true /* setError */, &pMedium);1804 break;1805 1806 default:1775 DeviceType_T aDeviceType, 1776 IMedium **aMedium) 1777 { 1778 CheckComArgStrNotEmptyOrNull(aLocation); 1779 CheckComArgOutPointerValid(aMedium); 1780 1781 AutoCaller autoCaller(this); 1782 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1783 1784 Guid id(aLocation); 1785 Utf8Str strLocation(aLocation); 1786 1787 HRESULT rc; 1788 ComObjPtr<Medium> pMedium; 1789 1790 switch (aDeviceType) 1791 { 1792 case DeviceType_HardDisk: 1793 if (!id.isEmpty()) 1794 rc = findHardDiskById(id, true /* setError */, &pMedium); 1795 else 1796 rc = findHardDiskByLocation(strLocation, true /* setError */, &pMedium); 1797 break; 1798 1799 case DeviceType_Floppy: 1800 case DeviceType_DVD: 1801 if (!id.isEmpty()) 1802 rc = findDVDOrFloppyImage(aDeviceType, &id, Utf8Str::Empty, true /* setError */, &pMedium); 1803 else 1804 rc = findDVDOrFloppyImage(aDeviceType, NULL, strLocation, true /* setError */, &pMedium); 1805 break; 1806 1807 default: 1807 1808 return setError(E_INVALIDARG, 1808 1809 tr("Invalid device type %d"), aDeviceType); 1809 } 1810 } 1811 #endif 1810 1812 1811 1813 /* the below will set *aHardDisk to NULL if hardDisk is null */ 1812 pMedium.queryInterfaceTo(aMedium);1813 1814 return rc;1815 }1814 // pMedium.queryInterfaceTo(aMedium); 1815 1816 // return rc; 1817 //} 1816 1818 1817 1819 /** @note Locks this object for reading. */
Note:
See TracChangeset
for help on using the changeset viewer.