Changeset 39519 in vbox
- Timestamp:
- Dec 2, 2011 9:12:21 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75197
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r39405 r39519 1522 1522 /** The discard operation is not supported for this image. */ 1523 1523 #define VERR_VD_DISCARD_NOT_SUPPORTED (-3278) 1524 /** The image is the correct format but is corrupted. */ 1525 #define VERR_VD_IMAGE_CORRUPTED (-3279) 1526 /** Repairing the image is not supported. */ 1527 #define VERR_VD_IMAGE_REPAIR_NOT_SUPPORTED (-3280) 1528 /** Repairing the image is not possible because the corruption is to severe. */ 1529 #define VERR_VD_IMAGE_REPAIR_IMPOSSIBLE (-3281) 1524 1530 /** @} */ 1525 1531 -
trunk/include/VBox/vd-plugin.h
r38876 r39519 634 634 unsigned fDiscard)); 635 635 636 /** 637 * Try to repair the given image. 638 * 639 * @returns VBox status code. 640 * @param pszFilename Name of the image file. 641 * @param pVDIfsDisk Pointer to the per-disk VD interface list. 642 * @param pVDIfsImage Pointer to the per-image VD interface list. 643 * @param fFlags Combination of the VD_REPAIR_* flags. 644 */ 645 DECLR3CALLBACKMEMBER(int, pfnRepair, (const char *pszFilename, PVDINTERFACE pVDIfsDisk, 646 PVDINTERFACE pVDIfsImage, uint32_t fFlags)); 647 636 648 } VBOXHDDBACKEND; 637 649 -
trunk/include/VBox/vd.h
r38876 r39519 105 105 /** @} */ 106 106 107 /** @name VD image repair flags 108 * @{ 109 */ 110 /** Don't repair the image but check what needs to be done. */ 111 #define VD_REPAIR_DRY_RUN RT_BIT_32(0) 112 113 /** Mask of all valid repair flags. */ 114 #define VD_REPAIR_FLAGS_MASK (VD_REPAIR_DRY_RUN) 115 /** @} */ 107 116 108 117 /** … … 1170 1179 void *pvUser1, void *pvUser); 1171 1180 1181 /** 1182 * Tries to repair a corrupted image. 1183 * 1184 * @return VBox status code. 1185 * @retval VERR_VD_IMAGE_REPAIR_NOT_SUPPORTED if the backend does not support repairing the image. 1186 * @retval VERR_VD_IMAGE_REPAIR_IMPOSSIBLE if the corruption is to severe to repair the image. 1187 * @param pVDIfsDisk Pointer to the per-disk VD interface list. 1188 * @param pVDIfsImage Pointer to the per-image VD interface list. 1189 * @param pszFilename Name of the image file to repair. 1190 * @param pszFormat The backend to use. 1191 * @param fFlags Combination of the VD_REPAIR_* flags. 1192 */ 1193 VBOXDDU_DECL(int) VDRepair(PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage, 1194 const char *pszFilename, const char *pszBackend, 1195 uint32_t fFlags); 1196 1172 1197 RT_C_DECLS_END 1173 1198 -
trunk/src/VBox/Storage/DMG.cpp
r38876 r39519 2336 2336 NULL, 2337 2337 /* pfnAsyncDiscard */ 2338 NULL, 2339 /* pfnRepair */ 2338 2340 NULL 2339 2341 }; -
trunk/src/VBox/Storage/ISCSI.cpp
r38876 r39519 5574 5574 NULL, 5575 5575 /* pfnAsyncDiscard */ 5576 NULL, 5577 /* pfnRepair */ 5576 5578 NULL 5577 5579 }; -
trunk/src/VBox/Storage/QCOW.cpp
r38876 r39519 2856 2856 NULL, 2857 2857 /* pfnAsyncDiscard */ 2858 NULL, 2859 /* pfnRepair */ 2858 2860 NULL 2859 2861 }; -
trunk/src/VBox/Storage/QED.cpp
r38876 r39519 2923 2923 NULL, 2924 2924 /* pfnAsyncDiscard */ 2925 NULL, 2926 /* pfnRepair */ 2925 2927 NULL 2926 2928 }; -
trunk/src/VBox/Storage/RAW.cpp
r38876 r39519 1294 1294 NULL, 1295 1295 /* pfnAsyncDiscard */ 1296 NULL, 1297 /* pfnRepair */ 1296 1298 NULL 1297 1299 }; -
trunk/src/VBox/Storage/VD.cpp
r39413 r39519 4981 4981 ("ppszFormat=%#p\n", ppszFormat), 4982 4982 VERR_INVALID_PARAMETER); 4983 AssertMsgReturn(VALID_PTR(p pszFormat),4983 AssertMsgReturn(VALID_PTR(penmType), 4984 4984 ("penmType=%#p\n", penmType), 4985 4985 VERR_INVALID_PARAMETER); … … 9322 9322 } 9323 9323 9324 VBOXDDU_DECL(int) VDRepair(PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage, 9325 const char *pszFilename, const char *pszBackend, 9326 uint32_t fFlags) 9327 { 9328 int rc = VERR_NOT_SUPPORTED; 9329 PCVBOXHDDBACKEND pBackend = NULL; 9330 VDINTERFACEIOINT VDIfIoInt; 9331 VDINTERFACEIO VDIfIoFallback; 9332 PVDINTERFACEIO pInterfaceIo; 9333 9334 LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename)); 9335 /* Check arguments. */ 9336 AssertMsgReturn(VALID_PTR(pszFilename) && *pszFilename, 9337 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 9338 VERR_INVALID_PARAMETER); 9339 AssertMsgReturn(VALID_PTR(pszBackend), 9340 ("pszBackend=%#p\n", pszBackend), 9341 VERR_INVALID_PARAMETER); 9342 AssertMsgReturn((fFlags & ~VD_REPAIR_FLAGS_MASK) == 0, 9343 ("fFlags=%#x\n", fFlags), 9344 VERR_INVALID_PARAMETER); 9345 9346 pInterfaceIo = VDIfIoGet(pVDIfsImage); 9347 if (!pInterfaceIo) 9348 { 9349 /* 9350 * Caller doesn't provide an I/O interface, create our own using the 9351 * native file API. 9352 */ 9353 vdIfIoFallbackCallbacksSetup(&VDIfIoFallback); 9354 pInterfaceIo = &VDIfIoFallback; 9355 } 9356 9357 /* Set up the internal I/O interface. */ 9358 AssertReturn(!VDIfIoIntGet(pVDIfsImage), VERR_INVALID_PARAMETER); 9359 VDIfIoInt.pfnOpen = vdIOIntOpenLimited; 9360 VDIfIoInt.pfnClose = vdIOIntCloseLimited; 9361 VDIfIoInt.pfnDelete = vdIOIntDeleteLimited; 9362 VDIfIoInt.pfnMove = vdIOIntMoveLimited; 9363 VDIfIoInt.pfnGetFreeSpace = vdIOIntGetFreeSpaceLimited; 9364 VDIfIoInt.pfnGetModificationTime = vdIOIntGetModificationTimeLimited; 9365 VDIfIoInt.pfnGetSize = vdIOIntGetSizeLimited; 9366 VDIfIoInt.pfnSetSize = vdIOIntSetSizeLimited; 9367 VDIfIoInt.pfnReadSync = vdIOIntReadSyncLimited; 9368 VDIfIoInt.pfnWriteSync = vdIOIntWriteSyncLimited; 9369 VDIfIoInt.pfnFlushSync = vdIOIntFlushSyncLimited; 9370 VDIfIoInt.pfnReadUserAsync = NULL; 9371 VDIfIoInt.pfnWriteUserAsync = NULL; 9372 VDIfIoInt.pfnReadMetaAsync = NULL; 9373 VDIfIoInt.pfnWriteMetaAsync = NULL; 9374 VDIfIoInt.pfnFlushAsync = NULL; 9375 rc = VDInterfaceAdd(&VDIfIoInt.Core, "VD_IOINT", VDINTERFACETYPE_IOINT, 9376 pInterfaceIo, sizeof(VDINTERFACEIOINT), &pVDIfsImage); 9377 AssertRC(rc); 9378 9379 rc = vdFindBackend(pszBackend, &pBackend); 9380 if (RT_SUCCESS(rc)) 9381 { 9382 if (pBackend->pfnRepair) 9383 rc = pBackend->pfnRepair(pszFilename, pVDIfsDisk, pVDIfsImage, fFlags); 9384 else 9385 rc = VERR_VD_IMAGE_REPAIR_NOT_SUPPORTED; 9386 } 9387 9388 LogFlowFunc(("returns %Rrc\n", rc)); 9389 return rc; 9390 } 9391 -
trunk/src/VBox/Storage/VDI.cpp
r38876 r39519 3180 3180 vdiDiscard, 3181 3181 /* pfnAsyncDiscard */ 3182 vdiAsyncDiscard 3182 vdiAsyncDiscard, 3183 /* pfnRepair */ 3184 NULL 3183 3185 }; -
trunk/src/VBox/Storage/VHD.cpp
r38876 r39519 3143 3143 NULL, 3144 3144 /* pfnAsyncDiscard */ 3145 NULL, 3146 /* pfnRepair */ 3145 3147 NULL 3146 3148 }; -
trunk/src/VBox/Storage/VMDK.cpp
r39052 r39519 32 32 #include <iprt/zip.h> 33 33 #include <iprt/asm.h> 34 35 34 36 35 /******************************************************************************* … … 5299 5298 { 5300 5299 int rc; 5300 5301 LogFlowFunc(("pImage=%#p pExtent=%#p uSector=%llu pvBuf=%#p cbRead=%llu\n", 5302 pImage, pExtent, uSector, pvBuf, cbRead)); 5301 5303 5302 5304 /* Do not allow to go back. */ … … 5429 5431 /* The next data block we have is not for this area, so just return 5430 5432 * that there is no data. */ 5433 LogFlowFunc(("returns VERR_VD_BLOCK_FREE\n")); 5431 5434 return VERR_VD_BLOCK_FREE; 5432 5435 } … … 5436 5439 (uint8_t *)pExtent->pvGrain + VMDK_SECTOR2BYTE(uSectorInGrain), 5437 5440 cbRead); 5441 LogFlowFunc(("returns VINF_SUCCESS\n")); 5438 5442 return VINF_SUCCESS; 5439 5443 } … … 7198 7202 NULL, 7199 7203 /* pfnAsyncDiscard */ 7204 NULL, 7205 /* pfnRepair */ 7200 7206 NULL 7201 7207 };
Note:
See TracChangeset
for help on using the changeset viewer.