VirtualBox

Changeset 41120 in vbox


Ignore:
Timestamp:
May 2, 2012 2:55:59 PM (13 years ago)
Author:
vboxsync
Message:

Replace calls of findMedium with openMedium, remove findMedium references in idl and definitions/declarations

Location:
trunk/src/VBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r41106 r41120  
    226226/* VBoxManageDisk.cpp */
    227227HRESULT 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);
    230230HRESULT findOrOpenMedium(HandlerArg *a, const char *pszFilenameOrUuid,
    231231                         DeviceType_T enmDevType, ComPtr<IMedium> &pMedium,
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r41106 r41120  
    171171
    172172    if (!fSilent)
    173         CHECK_ERROR(a->virtualBox, FindMedium(Bstr(pszFilenameOrUuid).raw(),
    174                                               enmDevType, pMedium.asOutParam()));
     173        CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(pszFilenameOrUuid).raw(),
     174                                              enmDevType, AccessMode_ReadWrite,
     175                                              /* fForceNewUuidOnOpen */ false,
     176                                              pMedium.asOutParam()));
    175177    else
    176         rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(),
    177                                        enmDevType, pMedium.asOutParam());
     178        rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(),
     179                                              enmDevType, AccessMode_ReadWrite,
     180                                              /* fForceNewUuidOnOpen */ false,
     181                                              pMedium.asOutParam());
    178182    return rc;
    179183}
     
    200204    }
    201205
    202     rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType,
     206    rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(),
     207                                   enmDevType, AccessMode_ReadWrite,
     208                                   /* fForceNewUuidOnOpen */ false,
    203209                                   pMedium.asOutParam());
    204210    /* If the medium is unknown try to open it. */
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r41106 r41120  
    14621462         */
    14631463        Bstr bstrHdaFile(hdaFile);
    1464         pVirtualBox->FindMedium(bstrHdaFile.raw(), DeviceType_HardDisk,
     1464        pVirtualBox->OpenMedium(bstrHdaFile.raw(), DeviceType_HardDisk,
     1465                                AccessMode_ReadWrite, FALSE /* fForceNewUuid */,
    14651466                                pMedium.asOutParam());
    14661467        if (!pMedium)
     
    15451546            {
    15461547                /* try to find an existing one */
    1547                 rc = pVirtualBox->FindMedium(bstrFdaFile.raw(), DeviceType_Floppy,
     1548                rc = pVirtualBox->OpenMedium(bstrFdaFile.raw(),
     1549                                             DeviceType_Floppy,
     1550                                             AccessMode_ReadWrite,
     1551                                             FALSE /* fForceNewUuid */,
    15481552                                             pMedium.asOutParam());
    15491553                if (FAILED(rc))
     
    16261630            {
    16271631                /* try to find an existing one */
    1628                 rc = pVirtualBox->FindMedium(bstrCdromFile.raw(), DeviceType_DVD,
    1629                                              pMedium.asOutParam());
     1632                rc = pVirtualBox->OpenMedium(bstrCdromFile.raw(),
     1633                                            DeviceType_DVD,
     1634                                            AccessMode_ReadWrite,
     1635                                            FALSE /* fForceNewUuid */,
     1636                                            pMedium.asOutParam());
    16301637                if (FAILED(rc))
    16311638                {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r41107 r41120  
    425425    {
    426426        QString strUuid;
    427         CMedium image = vbox.FindMedium(strSource, KDeviceType_DVD);
     427        CMedium image = vbox.OpenMedium(strSource, KDeviceType_DVD, KAccessMode_ReadWrite, false /* fForceNewUuid */);
    428428        if (image.isNull())
    429429        {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r41113 r41120  
    19581958      <param name="medium" type="IMedium" dir="return">
    19591959        <desc>Opened medium object.</desc>
    1960       </param>
    1961     </method>
    1962 
    1963     <method name="findMedium">
    1964       <desc>
    1965         Returns a medium of the given type that uses the given fully qualified
    1966         location or UUID to store medium data.
    1967 
    1968         The given medium must be known to this VirtualBox installation, i.e.
    1969         it must be previously created by <link to="#createHardDisk"/> or opened
    1970         by <link to="#openMedium"/>.
    1971 
    1972         The search is done by comparing the value of the @a location argument to
    1973         the <link to="IMedium::location"/> and <link to="IMedium::id" />
    1974         attributes of each known medium.
    1975 
    1976         On case sensitive file systems, a case sensitive comparison is performed,
    1977         otherwise the case of symbols in the file path is ignored.
    1978 
    1979         <result name="VBOX_E_OBJECT_NOT_FOUND">
    1980           No medium object matching @a location found.
    1981         </result>
    1982       </desc>
    1983       <param name="location" type="wstring" dir="in">
    1984         <desc>What to search for. This can either be the UUID or the location string of an open medium.</desc>
    1985       </param>
    1986       <param name="type" type="DeviceType" dir="in">
    1987         <desc>Device type (must be HardDisk, DVD or Floppy)</desc>
    1988       </param>
    1989       <param name="medium" type="IMedium" dir="return">
    1990         <desc>Medium object, if found.</desc>
    19911960      </param>
    19921961    </method>
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r41106 r41120  
    145145                          BOOL fForceNewUuid,
    146146                          IMedium **aMedium);
    147     STDMETHOD(FindMedium)(IN_BSTR aLocation,
    148                           DeviceType_T deviceType,
    149                           IMedium **aMedium);
    150147
    151148    STDMETHOD(GetGuestOSType)(IN_BSTR aId, IGuestOSType **aType);
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r41106 r41120  
    627627    /** @todo: Maybe too cost-intensive; try to find a lighter way */
    628628    while (    RTPathExists(tmpName)
    629             || mVirtualBox->FindMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, &harddisk) != VBOX_E_OBJECT_NOT_FOUND
     629            || mVirtualBox->OpenMedium(Bstr(tmpName).raw(), DeviceType_HardDisk, AccessMode_ReadWrite, FALSE /* fForceNewUuid */,  &harddisk)
    630630          )
    631631    {
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r41106 r41120  
    795795
    796796        Log(("Finding source disk \"%ls\"\n", bstrSrcFilePath.raw()));
    797         HRESULT rc = mVirtualBox->FindMedium(bstrSrcFilePath.raw(), DeviceType_HardDisk, pSourceDisk.asOutParam());
     797        HRESULT rc = mVirtualBox->OpenMedium(bstrSrcFilePath.raw(), DeviceType_HardDisk, AccessMode_ReadWrite, FALSE /* fForceNewUuid */, pSourceDisk.asOutParam());
    798798        if (FAILED(rc)) throw rc;
    799799
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r41106 r41120  
    17711771}
    17721772
    1773 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             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:
    1807             return setError(E_INVALIDARG,
    1808                             tr("Invalid device type %d"), aDeviceType);
    1809     }
    1810 
    1811     /* the below will set *aHardDisk to NULL if hardDisk is null */
    1812     pMedium.queryInterfaceTo(aMedium);
    1813 
    1814     return rc;
    1815 }
    18161773
    18171774/** @note Locks this object for reading. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette