VirtualBox

Changeset 76154 in vbox for trunk


Ignore:
Timestamp:
Dec 11, 2018 9:01:30 AM (6 years ago)
Author:
vboxsync
Message:

Main: bugref:9324: Added new error for "medium shrink is not allowed"

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r75853 r76154  
    16771677/** The size of the raw floppy image is too big (>2.88MB) */
    16781678#define VERR_VD_RAW_SIZE_FLOPPY_TOO_BIG             (-3289)
    1679 
     1679/** Reducing the size is not supported */
     1680#define VERR_VD_SHRINK_NOT_SUPPORTED                (-3290)
    16801681/** @} */
    16811682
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r74829 r76154  
    765765        if (FAILED(rc))
    766766        {
    767             if (rc == E_NOTIMPL)
     767            if (!pProgress.isNull())
     768                CHECK_PROGRESS_ERROR(pProgress, ("Failed to resize medium"));
     769            else if (rc == E_NOTIMPL)
    768770                RTMsgError("Resize medium operation is not implemented!");
    769771            else if (rc == VBOX_E_NOT_SUPPORTED)
    770772                RTMsgError("Resize medium operation for this format is not implemented yet!");
    771             else if (!pProgress.isNull())
    772                 CHECK_PROGRESS_ERROR(pProgress, ("Failed to resize medium"));
    773773            else
    774774                RTMsgError("Failed to resize medium!");
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r75373 r76154  
    1001210012            if (RT_FAILURE(vrc))
    1001310013            {
     10014                if (vrc == VERR_VD_SHRINK_NOT_SUPPORTED)
     10015                    throw setErrorBoth(VBOX_E_NOT_SUPPORTED, vrc,
     10016                                       tr("Shrinking is not yet supported for medium '%s'"),
     10017                                       location.c_str());
    1001410018                if (vrc == VERR_NOT_SUPPORTED)
    1001510019                    throw setErrorBoth(VBOX_E_NOT_SUPPORTED, vrc,
  • trunk/src/VBox/Storage/VDI.cpp

    r69500 r76154  
    25272527    /** @todo implement making the image smaller, it is the responsibility of
    25282528     * the user to know what he's doing. */
    2529     if (   cbSize < getImageDiskSize(&pImage->Header)
    2530         || GET_MAJOR_HEADER_VERSION(&pImage->Header) == 0
    2531         || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
     2529    if (cbSize < getImageDiskSize(&pImage->Header))
     2530        rc = VERR_VD_SHRINK_NOT_SUPPORTED;
     2531    else if (   GET_MAJOR_HEADER_VERSION(&pImage->Header) == 0
     2532             || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
    25322533        rc = VERR_NOT_SUPPORTED;
    25332534    else if (cbSize > getImageDiskSize(&pImage->Header))
  • trunk/src/VBox/Storage/VHD.cpp

    r73097 r76154  
    25462546
    25472547    /* Making the image smaller is not supported at the moment. */
    2548     if (   cbSize < pImage->cbSize
    2549         || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
     2548    if (cbSize < pImage->cbSize)
     2549        rc = VERR_VD_SHRINK_NOT_SUPPORTED;
     2550    else if (pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
    25502551        rc = VERR_NOT_SUPPORTED;
    25512552    else if (cbSize > pImage->cbSize)
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