VirtualBox

Changeset 36633 in vbox


Ignore:
Timestamp:
Apr 8, 2011 9:43:41 PM (14 years ago)
Author:
vboxsync
Message:

Storage: Small cleanup. Drops VDImageIsAsyncIOSupported, it is completely unused and the best behavior is to fail in VDOpen like we do for all the other flags

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vd-plugin.h

    r33567 r36633  
    455455
    456456    /**
    457      * Return whether asynchronous I/O operations are supported for this image.
    458      *
    459      * @returns true if asynchronous I/O is supported
    460      *          false otherwise.
    461      * @param   pBackendData     Opaque state data for this image.
    462      */
    463     DECLR3CALLBACKMEMBER(bool, pfnIsAsyncIOSupported, (void *pBackendData));
    464 
    465     /**
    466457     * Start an asynchronous read request.
    467458     *
  • trunk/include/VBox/vd.h

    r36573 r36633  
    167167#define VD_OPEN_FLAGS_INFO          RT_BIT(3)
    168168/** Open image for asynchronous access. Only available if VD_CAP_ASYNC_IO is
    169  * set. Check with VDIsAsynchonousIoSupported whether asynchronous I/O is
    170  * really supported for this file. */
     169 * set. VDOpen fails with VERR_NOT_SUPPORTED if this operation is not supported for
     170 * this kind of image. */
    171171#define VD_OPEN_FLAGS_ASYNC_IO      RT_BIT(4)
    172172/** Allow sharing of the image for writable images. May be ignored if the
     
    26102610
    26112611/**
    2612  * Query if asynchronous operations are supported for this disk.
    2613  *
    2614  * @return  VBox status code.
    2615  * @return  VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened.
    2616  * @param   pDisk           Pointer to the HDD container.
    2617  * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    2618  * @param   pfAIOSupported  Where to store if async IO is supported.
    2619  */
    2620 VBOXDDU_DECL(int) VDImageIsAsyncIOSupported(PVBOXHDD pDisk, unsigned nImage, bool *pfAIOSupported);
    2621 
    2622 
    2623 /**
    26242612 * Start an asynchronous read request.
    26252613 *
  • trunk/src/VBox/Storage/DMG.cpp

    r36513 r36633  
    24262426    /* pfnSetParentFilename */
    24272427    NULL,
    2428     /* pfnIsAsyncIOSupported */
    2429     NULL,
    24302428    /* pfnAsyncRead */
    24312429    NULL,
  • trunk/src/VBox/Storage/ISCSI.cpp

    r36230 r36633  
    51745174        iscsiMessage(pImage, "Header: cVolume=%u\n", pImage->cVolume);
    51755175    }
    5176 }
    5177 
    5178 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */
    5179 static bool iscsiIsAsyncIOSupported(void *pBackendData)
    5180 {
    5181     PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
    5182     return pImage->fCmdQueuingSupported;
    51835176}
    51845177
     
    56295622    /* pfnSetParentFilename */
    56305623    NULL,
    5631     /* pfnIsAsyncIOSupported */
    5632     iscsiIsAsyncIOSupported,
    56335624    /* pfnAsyncRead */
    56345625    iscsiAsyncRead,
  • trunk/src/VBox/Storage/Parallels.cpp

    r35486 r36633  
    11941194                    pImage->LCHSGeometry.cCylinders, pImage->LCHSGeometry.cHeads, pImage->LCHSGeometry.cSectors);
    11951195    }
    1196 }
    1197 
    1198 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */
    1199 static bool parallelsIsAsyncIOSupported(void *pBackendData)
    1200 {
    1201 #if 0 /** @todo: Remove when tested */
    1202     return true;
    1203 #else
    1204     return false;
    1205 #endif
    12061196}
    12071197
     
    14321422    /* pfnSetParentFilename */
    14331423    NULL,
    1434     /* pfnIsAsyncIOSupported */
    1435     parallelsIsAsyncIOSupported,
    14361424    /* pfnAsyncRead */
    14371425    parallelsAsyncRead,
  • trunk/src/VBox/Storage/RAW.cpp

    r35480 r36633  
    12981298                    pImage->cbSize / 512);
    12991299    }
    1300 }
    1301 
    1302 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */
    1303 static bool rawIsAsyncIOSupported(void *pBackendData)
    1304 {
    1305     return true;
    13061300}
    13071301
     
    14351429    /* pfnSetParentFilename */
    14361430    NULL,
    1437     /* pfnIsAsyncIOSupported */
    1438     rawIsAsyncIOSupported,
    14391431    /* pfnAsyncRead */
    14401432    rawAsyncRead,
  • trunk/src/VBox/Storage/VD.cpp

    r36292 r36633  
    42274227        }
    42284228
     4229        /*
     4230         * Fail if the the backend can't do async I/O but the
     4231         * flag is set.
     4232         */
     4233        if (   !(pImage->Backend->uBackendCaps & VD_CAP_ASYNC)
     4234            && (uOpenFlags & VD_OPEN_FLAGS_ASYNC_IO))
     4235        {
     4236            rc = vdError(pDisk, VERR_NOT_SUPPORTED, RT_SRC_POS,
     4237                         N_("VD: Backend '%s' does not support async I/O"), pszBackend);
     4238            break;
     4239        }
     4240
    42294241        /* Set up the I/O interface. */
    42304242        pImage->VDIo.pInterfaceIO = VDInterfaceGet(pVDIfsImage, VDINTERFACETYPE_IO);
     
    80708082}
    80718083
    8072 /**
    8073  * Query if asynchronous operations are supported for this disk.
    8074  *
    8075  * @returns VBox status code.
    8076  * @returns VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened.
    8077  * @param   pDisk           Pointer to the HDD container.
    8078  * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    8079  * @param   pfAIOSupported  Where to store if async IO is supported.
    8080  */
    8081 VBOXDDU_DECL(int) VDImageIsAsyncIOSupported(PVBOXHDD pDisk, unsigned nImage, bool *pfAIOSupported)
    8082 {
    8083     int rc = VINF_SUCCESS;
    8084     int rc2;
    8085     bool fLockRead = false;
    8086 
    8087     LogFlowFunc(("pDisk=%#p nImage=%u pfAIOSupported=%#p\n", pDisk, nImage, pfAIOSupported));
    8088     do
    8089     {
    8090         /* sanity check */
    8091         AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);
    8092         AssertMsg(pDisk->u32Signature == VBOXHDDDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
    8093 
    8094         /* Check arguments. */
    8095         AssertMsgBreakStmt(VALID_PTR(pfAIOSupported),
    8096                            ("pfAIOSupported=%#p\n", pfAIOSupported),
    8097                            rc = VERR_INVALID_PARAMETER);
    8098 
    8099         rc2 = vdThreadStartRead(pDisk);
    8100         AssertRC(rc2);
    8101         fLockRead = true;
    8102 
    8103         PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage);
    8104         AssertPtrBreakStmt(pImage, rc = VERR_VD_IMAGE_NOT_FOUND);
    8105 
    8106         if (pImage->Backend->uBackendCaps & VD_CAP_ASYNC)
    8107             *pfAIOSupported = pImage->Backend->pfnIsAsyncIOSupported(pImage->pBackendData);
    8108         else
    8109             *pfAIOSupported = false;
    8110     } while (0);
    8111 
    8112     if (RT_UNLIKELY(fLockRead))
    8113     {
    8114         rc2 = vdThreadFinishRead(pDisk);
    8115         AssertRC(rc2);
    8116     }
    8117 
    8118     LogFlowFunc(("returns %Rrc, fAIOSupported=%u\n", rc, *pfAIOSupported));
    8119     return rc;
    8120 }
    8121 
    81228084
    81238085VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead,
  • trunk/src/VBox/Storage/VDI.cpp

    r33947 r36633  
    20192019                cBadBlocks);
    20202020    }
    2021 }
    2022 
    2023 static bool vdiIsAsyncIOSupported(void *pBackendData)
    2024 {
    2025     return true;
    20262021}
    20272022
     
    27332728    /* pfnSetParentFilename */
    27342729    NULL,
    2735     /* pfnIsAsyncIOSupported */
    2736     vdiIsAsyncIOSupported,
    27372730    /* pfnAsyncRead */
    27382731    vdiAsyncRead,
  • trunk/src/VBox/Storage/VHD.cpp

    r36632 r36633  
    24582458    LogFlowFunc(("returns %Rrc\n", rc));
    24592459    return rc;
    2460 }
    2461 
    2462 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */
    2463 static bool vhdIsAsyncIOSupported(void *pBackendData)
    2464 {
    2465     return true;
    24662460}
    24672461
     
    33393333    /* pfnSetParentFilename */
    33403334    vhdSetParentFilename,
    3341     /* pfnIsAsyncIOSupported */
    3342     vhdIsAsyncIOSupported,
    33433335    /* pfnAsyncRead */
    33443336    vhdAsyncRead,
  • trunk/src/VBox/Storage/VMDK.cpp

    r36514 r36633  
    69706970}
    69716971
    6972 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */
    6973 static bool vmdkIsAsyncIOSupported(void *pBackendData)
    6974 {
    6975     PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
    6976 
    6977     /* We do not support async I/O for stream optimized VMDK images. */
    6978     return (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED) == 0;
    6979 }
    6980 
    69816972/** @copydoc VBOXHDDBACKEND::pfnAsyncRead */
    69826973static int vmdkAsyncRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
     
    73657356    /* pfnSetParentFilename */
    73667357    NULL,
    7367     /* pfnIsAsyncIOSupported */
    7368     vmdkIsAsyncIOSupported,
    73697358    /* pfnAsyncRead */
    73707359    vmdkAsyncRead,
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