Changeset 36633 in vbox
- Timestamp:
- Apr 8, 2011 9:43:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd-plugin.h
r33567 r36633 455 455 456 456 /** 457 * Return whether asynchronous I/O operations are supported for this image.458 *459 * @returns true if asynchronous I/O is supported460 * false otherwise.461 * @param pBackendData Opaque state data for this image.462 */463 DECLR3CALLBACKMEMBER(bool, pfnIsAsyncIOSupported, (void *pBackendData));464 465 /**466 457 * Start an asynchronous read request. 467 458 * -
trunk/include/VBox/vd.h
r36573 r36633 167 167 #define VD_OPEN_FLAGS_INFO RT_BIT(3) 168 168 /** Open image for asynchronous access. Only available if VD_CAP_ASYNC_IO is 169 * set. Check with VDIsAsynchonousIoSupported whether asynchronous I/O is170 * 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. */ 171 171 #define VD_OPEN_FLAGS_ASYNC_IO RT_BIT(4) 172 172 /** Allow sharing of the image for writable images. May be ignored if the … … 2610 2610 2611 2611 /** 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 /**2624 2612 * Start an asynchronous read request. 2625 2613 * -
trunk/src/VBox/Storage/DMG.cpp
r36513 r36633 2426 2426 /* pfnSetParentFilename */ 2427 2427 NULL, 2428 /* pfnIsAsyncIOSupported */2429 NULL,2430 2428 /* pfnAsyncRead */ 2431 2429 NULL, -
trunk/src/VBox/Storage/ISCSI.cpp
r36230 r36633 5174 5174 iscsiMessage(pImage, "Header: cVolume=%u\n", pImage->cVolume); 5175 5175 } 5176 }5177 5178 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */5179 static bool iscsiIsAsyncIOSupported(void *pBackendData)5180 {5181 PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;5182 return pImage->fCmdQueuingSupported;5183 5176 } 5184 5177 … … 5629 5622 /* pfnSetParentFilename */ 5630 5623 NULL, 5631 /* pfnIsAsyncIOSupported */5632 iscsiIsAsyncIOSupported,5633 5624 /* pfnAsyncRead */ 5634 5625 iscsiAsyncRead, -
trunk/src/VBox/Storage/Parallels.cpp
r35486 r36633 1194 1194 pImage->LCHSGeometry.cCylinders, pImage->LCHSGeometry.cHeads, pImage->LCHSGeometry.cSectors); 1195 1195 } 1196 }1197 1198 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */1199 static bool parallelsIsAsyncIOSupported(void *pBackendData)1200 {1201 #if 0 /** @todo: Remove when tested */1202 return true;1203 #else1204 return false;1205 #endif1206 1196 } 1207 1197 … … 1432 1422 /* pfnSetParentFilename */ 1433 1423 NULL, 1434 /* pfnIsAsyncIOSupported */1435 parallelsIsAsyncIOSupported,1436 1424 /* pfnAsyncRead */ 1437 1425 parallelsAsyncRead, -
trunk/src/VBox/Storage/RAW.cpp
r35480 r36633 1298 1298 pImage->cbSize / 512); 1299 1299 } 1300 }1301 1302 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */1303 static bool rawIsAsyncIOSupported(void *pBackendData)1304 {1305 return true;1306 1300 } 1307 1301 … … 1435 1429 /* pfnSetParentFilename */ 1436 1430 NULL, 1437 /* pfnIsAsyncIOSupported */1438 rawIsAsyncIOSupported,1439 1431 /* pfnAsyncRead */ 1440 1432 rawAsyncRead, -
trunk/src/VBox/Storage/VD.cpp
r36292 r36633 4227 4227 } 4228 4228 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 4229 4241 /* Set up the I/O interface. */ 4230 4242 pImage->VDIo.pInterfaceIO = VDInterfaceGet(pVDIfsImage, VDINTERFACETYPE_IO); … … 8070 8082 } 8071 8083 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 do8089 {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 else8109 *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 8122 8084 8123 8085 VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead, -
trunk/src/VBox/Storage/VDI.cpp
r33947 r36633 2019 2019 cBadBlocks); 2020 2020 } 2021 }2022 2023 static bool vdiIsAsyncIOSupported(void *pBackendData)2024 {2025 return true;2026 2021 } 2027 2022 … … 2733 2728 /* pfnSetParentFilename */ 2734 2729 NULL, 2735 /* pfnIsAsyncIOSupported */2736 vdiIsAsyncIOSupported,2737 2730 /* pfnAsyncRead */ 2738 2731 vdiAsyncRead, -
trunk/src/VBox/Storage/VHD.cpp
r36632 r36633 2458 2458 LogFlowFunc(("returns %Rrc\n", rc)); 2459 2459 return rc; 2460 }2461 2462 /** @copydoc VBOXHDDBACKEND::pfnIsAsyncIOSupported */2463 static bool vhdIsAsyncIOSupported(void *pBackendData)2464 {2465 return true;2466 2460 } 2467 2461 … … 3339 3333 /* pfnSetParentFilename */ 3340 3334 vhdSetParentFilename, 3341 /* pfnIsAsyncIOSupported */3342 vhdIsAsyncIOSupported,3343 3335 /* pfnAsyncRead */ 3344 3336 vhdAsyncRead, -
trunk/src/VBox/Storage/VMDK.cpp
r36514 r36633 6970 6970 } 6971 6971 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 6981 6972 /** @copydoc VBOXHDDBACKEND::pfnAsyncRead */ 6982 6973 static int vmdkAsyncRead(void *pBackendData, uint64_t uOffset, size_t cbRead, … … 7365 7356 /* pfnSetParentFilename */ 7366 7357 NULL, 7367 /* pfnIsAsyncIOSupported */7368 vmdkIsAsyncIOSupported,7369 7358 /* pfnAsyncRead */ 7370 7359 vmdkAsyncRead,
Note:
See TracChangeset
for help on using the changeset viewer.