VirtualBox

Changeset 18127 in vbox for trunk/src


Ignore:
Timestamp:
Mar 23, 2009 9:20:31 AM (16 years ago)
Author:
vboxsync
Message:

DrvVD: fail if a VD image was forced to be opened in read-only mode

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r13303 r18127  
    873873    if (RT_FAILURE(rc))
    874874        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    875                                    N_("Failed to attach driver below us! rc=%Rra\n"), rc);
     875                                   N_("Failed to attach driver below us! %Rrf"), rc);
    876876
    877877    pThis->pDrvMedia = (PPDMIMEDIA)pBase->pfnQueryInterface(pBase, PDMINTERFACE_MEDIA);
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r17796 r18127  
    10101010
    10111011        if (RT_SUCCESS(rc))
     1012        {
    10121013            Log(("%s: %d - Opened '%s' in %s mode\n", __FUNCTION__,
    10131014                 iLevel, pszName,
    10141015                 VDIsReadOnly(pThis->pDisk) ? "read-only" : "read-write"));
     1016            if (   VDIsReadOnly(pThis->pDisk)
     1017                && !fReadOnly)
     1018            {
     1019                rc = PDMDrvHlpVMSetError(pDrvIns, VERR_VD_IMAGE_READ_ONLY, RT_SRC_POS,
     1020                                         N_("Failed to open image '%s' for writing due to wrong "
     1021                                            "permissions"), pszName);
     1022                break;
     1023            }
     1024        }
    10151025        else
    10161026        {
    10171027           rc = PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    1018                                     N_("Failed to open image '%s' in %s mode rc=%Rrc\n"), pszName,
     1028                                    N_("Failed to open image '%s' in %s mode rc=%Rrc"), pszName,
    10191029                                    (uOpenFlags & VD_OPEN_FLAGS_READONLY) ? "readonly" : "read-write", rc);
    10201030           break;
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