VirtualBox

Changeset 41232 in vbox for trunk


Ignore:
Timestamp:
May 10, 2012 12:08:43 PM (13 years ago)
Author:
vboxsync
Message:

various fixes for openMedium->findMedium change 6130 inc return statuses

Location:
trunk/src/VBox
Files:
4 edited

Legend:

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

    r41120 r41232  
    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/Main/src-server/ApplianceImpl.cpp

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

    r41120 r41232  
    795795
    796796        Log(("Finding source disk \"%ls\"\n", bstrSrcFilePath.raw()));
    797         HRESULT rc = mVirtualBox->OpenMedium(bstrSrcFilePath.raw(), DeviceType_HardDisk, AccessMode_ReadWrite, FALSE /* fForceNewUuid */,  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

    r41231 r41232  
    16951695                                    IMedium **aMedium)
    16961696{
     1697    HRESULT rc = S_OK;
    16971698    CheckComArgStrNotEmptyOrNull(aLocation);
    16981699    CheckComArgOutPointerValid(aMedium);
     
    17131714    {
    17141715        case DeviceType_HardDisk:
    1715             findHardDiskByLocation(aLocation,
     1716            rc = findHardDiskByLocation(aLocation,
    17161717                                   false, /* aSetError */
    17171718                                   &pMedium);
     
    17201721        case DeviceType_Floppy:
    17211722        case DeviceType_DVD:
    1722             findDVDOrFloppyImage(deviceType,
     1723            rc = findDVDOrFloppyImage(deviceType,
    17231724                                 NULL, /* guid */
    17241725                                 aLocation,
     
    17321733
    17331734        default:
    1734             return setError(E_INVALIDARG, "Device type must be HardDisk, DVD or Floppy");
    1735     }
    1736 
    1737     HRESULT rc = S_OK;
     1735            return setError(E_INVALIDARG, "Device type must be HardDisk, DVD or Floppy %d", deviceType);
     1736    }
     1737
    17381738
    17391739    if (pMedium.isNull())
     
    17581758             * with the parent and this association needs to be broken. */
    17591759
    1760             if (FAILED(rc))
     1760            if (FAILED(rc)){
    17611761                pMedium->uninit();
    1762         }
     1762                rc = VBOX_E_OBJECT_NOT_FOUND;
     1763            }
     1764        }
     1765        else
     1766            rc = VBOX_E_OBJECT_NOT_FOUND;
    17631767    }
    17641768
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