Changeset 66192 in vbox
- Timestamp:
- Mar 22, 2017 12:45:37 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114104
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd.h
r66139 r66192 4 4 5 5 /* 6 * Copyright (C) 2006-201 6Oracle Corporation6 * Copyright (C) 2006-2017 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 #include <VBox/types.h> 38 38 #include <VBox/err.h> 39 #include <VBox/vdmedia.h> 39 40 #include <VBox/vd-ifs.h> 40 41 … … 342 343 /** @}*/ 343 344 344 /** @name VBox HDD container type.345 * @{346 */347 typedef enum VDTYPE348 {349 /** Invalid. */350 VDTYPE_INVALID = 0,351 /** HardDisk */352 VDTYPE_HDD,353 /** CD/DVD */354 VDTYPE_DVD,355 /** Floppy. */356 VDTYPE_FLOPPY357 } VDTYPE;358 /** @}*/359 360 361 345 /** @name Configuration interface key handling flags. 362 346 * @{ … … 476 460 /** Pointer to a transfer compelte callback. */ 477 461 typedef FNVDASYNCTRANSFERCOMPLETE *PFNVDASYNCTRANSFERCOMPLETE; 478 479 /**480 * Disk geometry.481 */482 typedef struct VDGEOMETRY483 {484 /** Number of cylinders. */485 uint32_t cCylinders;486 /** Number of heads. */487 uint32_t cHeads;488 /** Number of sectors. */489 uint32_t cSectors;490 } VDGEOMETRY;491 492 /** Pointer to disk geometry. */493 typedef VDGEOMETRY *PVDGEOMETRY;494 /** Pointer to constant disk geometry. */495 typedef const VDGEOMETRY *PCVDGEOMETRY;496 497 /**498 * Disk region data form known to us from various standards.499 */500 typedef enum VDREGIONDATAFORM501 {502 /** Invalid data form. */503 VDREGIONDATAFORM_INVALID = 0,504 /** Raw data, no standardized format. */505 VDREGIONDATAFORM_RAW,506 /** CD-DA (audio CD), 2352 bytes of data. */507 VDREGIONDATAFORM_CDDA,508 /** CDDA data is pause. */509 VDREGIONDATAFORM_CDDA_PAUSE,510 /** Mode 1 with 2048 bytes sector size. */511 VDREGIONDATAFORM_MODE1_2048,512 /** Mode 1 with 2352 bytes sector size. */513 VDREGIONDATAFORM_MODE1_2352,514 /** Mode 1 with 0 bytes sector size (generated by the drive). */515 VDREGIONDATAFORM_MODE1_0,516 /** XA Mode with 2336 bytes sector size. */517 VDREGIONDATAFORM_XA_2336,518 /** XA Mode with 2352 bytes sector size. */519 VDREGIONDATAFORM_XA_2352,520 /** XA Mode with 0 bytes sector size (generated by the drive). */521 VDREGIONDATAFORM_XA_0,522 /** Mode 2 with 2336 bytes sector size. */523 VDREGIONDATAFORM_MODE2_2336,524 /** Mode 2 with 2352 bytes sector size. */525 VDREGIONDATAFORM_MODE2_2352,526 /** Mode 2 with 0 bytes sector size (generated by the drive). */527 VDREGIONDATAFORM_MODE2_0528 } VDREGIONDATAFORM;529 530 /**531 * Disk region metadata forms known to us.532 */533 typedef enum VDREGIONMETADATAFORM534 {535 /** Invalid metadata form. */536 VDREGIONMETADATAFORM_INVALID = 0,537 /** No metadata assined to the region. */538 VDREGIONMETADATAFORM_NONE,539 /** Raw metadata, no standardized format. */540 VDREGIONMETADATAFORM_RAW541 } VDREGIONMETADATAFORM;542 543 /**544 * Disk region descriptor.545 */546 typedef struct VDREGIONDESC547 {548 /** Start of the region in bytes or LBA number (depending on the flag in the549 * list header). */550 uint64_t offRegion;551 /** Overall size of the region in bytes or number of blocks (depending on the552 * flag in the list header). */553 uint64_t cRegionBlocksOrBytes;554 /** Size of one block in bytes, containing user and metadata. */555 uint64_t cbBlock;556 /** User data form of the block. */557 VDREGIONDATAFORM enmDataForm;558 /** Metadata form of the block. */559 VDREGIONMETADATAFORM enmMetadataForm;560 /** Size of the data block in bytes. */561 uint64_t cbData;562 /** Size of the metadata in a block in bytes. */563 uint64_t cbMetadata;564 } VDREGIONDESC;565 /** Pointer to a region descriptor. */566 typedef VDREGIONDESC *PVDREGIONDESC;567 /** Pointer to a constant region descriptor. */568 typedef const VDREGIONDESC *PCVDREGIONDESC;569 570 /**571 * Disk region list.572 */573 typedef struct VDREGIONLIST574 {575 /** Flags valid for the region list. */576 uint32_t fFlags;577 /** Number of regions in the descriptor array. */578 uint32_t cRegions;579 /** Region descriptors - variable in size. */580 VDREGIONDESC aRegions[RT_FLEXIBLE_ARRAY];581 } VDREGIONLIST;582 /** Pointer to a region list. */583 typedef VDREGIONLIST *PVDREGIONLIST;584 /** Pointer to a constant region list. */585 typedef const VDREGIONLIST *PCVDREGIONLIST;586 /** Pointer to a region list pointer. */587 typedef PVDREGIONLIST *PPVDREGIONLIST;588 589 /** @name Valid region list flags.590 * @{591 */592 /** When set the region start offset and size are given in numbers of blocks593 * instead of byte offsets and sizes. */594 #define VD_REGION_LIST_F_LOC_SIZE_BLOCKS RT_BIT_32(0)595 /** Mask of all valid flags. */596 #define VD_REGION_LIST_F_VALID (VD_REGION_LIST_F_LOC_SIZE_BLOCKS)597 /** @} */598 462 599 463 /** -
trunk/include/VBox/vmm/pdmstorageifs.h
r66166 r66192 29 29 #include <iprt/sg.h> 30 30 #include <VBox/types.h> 31 #include <VBox/vdmedia.h> 31 32 32 33 RT_C_DECLS_BEGIN … … 203 204 typedef const PDMMEDIAGEOMETRY *PCPDMMEDIAGEOMETRY; 204 205 205 /**206 * Region data forms known to us from various standards.207 */208 typedef enum PDMMEDIAREGIONDATAFORM209 {210 /** Invalid data form. */211 PDMMEDIAREGIONDATAFORM_INVALID = 0,212 /** Raw data, no standardized format. */213 PDMMEDIAREGIONDATAFORM_RAW,214 /** CD-DA (audio CD), 2352 bytes of data. */215 PDMMEDIAREGIONDATAFORM_CDDA,216 /** CDDA data is pause. */217 PDMMEDIAREGIONDATAFORM_CDDA_PAUSE,218 /** Mode 1 with 2048 bytes sector size. */219 PDMMEDIAREGIONDATAFORM_MODE1_2048,220 /** Mode 1 with 2352 bytes sector size. */221 PDMMEDIAREGIONDATAFORM_MODE1_2352,222 /** Mode 1 with 0 bytes sector size (generated by the drive). */223 PDMMEDIAREGIONDATAFORM_MODE1_0,224 /** XA Mode with 2336 bytes sector size. */225 PDMMEDIAREGIONDATAFORM_XA_2336,226 /** XA Mode with 2352 bytes sector size. */227 PDMMEDIAREGIONDATAFORM_XA_2352,228 /** XA Mode with 0 bytes sector size (generated by the drive). */229 PDMMEDIAREGIONDATAFORM_XA_0,230 /** Mode 2 with 2336 bytes sector size. */231 PDMMEDIAREGIONDATAFORM_MODE2_2336,232 /** Mode 2 with 2352 bytes sector size. */233 PDMMEDIAREGIONDATAFORM_MODE2_2352,234 /** Mode 2 with 0 bytes sector size (generated by the drive). */235 PDMMEDIAREGIONDATAFORM_MODE2_0236 } PDMMEDIAREGIONDATAFORM;237 /** Pointer to a region data form. */238 typedef PDMMEDIAREGIONDATAFORM *PPDMMEDIAREGIONDATAFORM;239 240 206 /** Pointer to a media port interface. */ 241 207 typedef struct PDMIMEDIAPORT *PPDMIMEDIAPORT; … … 518 484 DECLR3CALLBACKMEMBER(int, pfnQueryRegionProperties,(PPDMIMEDIA pInterface, uint32_t uRegion, uint64_t *pu64LbaStart, 519 485 uint64_t *pcBlocks, uint64_t *pcbBlock, 520 P PDMMEDIAREGIONDATAFORM penmDataForm));486 PVDREGIONDATAFORM penmDataForm)); 521 487 522 488 /** … … 533 499 DECLR3CALLBACKMEMBER(int, pfnQueryRegionPropertiesForLba,(PPDMIMEDIA pInterface, uint64_t u64LbaStart, 534 500 uint64_t *pcBlocks, uint64_t *pcbBlock, 535 P PDMMEDIAREGIONDATAFORM penmDataForm));501 PVDREGIONDATAFORM penmDataForm)); 536 502 537 503 } PDMIMEDIA; -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r66165 r66192 358 358 static DECLCALLBACK(int) drvHostBaseQueryRegionProperties(PPDMIMEDIA pInterface, uint32_t uRegion, uint64_t *pu64LbaStart, 359 359 uint64_t *pcBlocks, uint64_t *pcbBlock, 360 P PDMMEDIAREGIONDATAFORM penmDataForm)360 PVDREGIONDATAFORM penmDataForm) 361 361 { 362 362 LogFlowFunc(("\n")); … … 384 384 *pcbBlock = cbBlock; 385 385 if (penmDataForm) 386 *penmDataForm = PDMMEDIAREGIONDATAFORM_RAW;386 *penmDataForm = VDREGIONDATAFORM_RAW; 387 387 } 388 388 } … … 397 397 static DECLCALLBACK(int) drvHostBaseQueryRegionPropertiesForLba(PPDMIMEDIA pInterface, uint64_t u64LbaStart, 398 398 uint64_t *pcBlocks, uint64_t *pcbBlock, 399 P PDMMEDIAREGIONDATAFORM penmDataForm)399 PVDREGIONDATAFORM penmDataForm) 400 400 { 401 401 LogFlowFunc(("\n")); … … 421 421 *pcbBlock = cbBlock; 422 422 if (penmDataForm) 423 *penmDataForm = PDMMEDIAREGIONDATAFORM_RAW;423 *penmDataForm = VDREGIONDATAFORM_RAW; 424 424 } 425 425 else -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r66166 r66192 537 537 } 538 538 539 /**540 * Converts from VD region data form enum to the PDM variant.541 *542 * @returns PDM media region data form.543 * @param enmDataForm The VD region data form.544 */545 static PDMMEDIAREGIONDATAFORM drvvdVDRegionForm2PdmDataForm(VDREGIONDATAFORM enmDataForm)546 {547 switch (enmDataForm)548 {549 #define VDDATAFORM2PDM(tag) case VDREGIONDATAFORM_##tag: return PDMMEDIAREGIONDATAFORM_##tag550 551 VDDATAFORM2PDM(INVALID);552 VDDATAFORM2PDM(RAW);553 VDDATAFORM2PDM(CDDA);554 VDDATAFORM2PDM(CDDA_PAUSE);555 VDDATAFORM2PDM(MODE1_2048);556 VDDATAFORM2PDM(MODE1_2352);557 VDDATAFORM2PDM(MODE1_0);558 VDDATAFORM2PDM(XA_2336);559 VDDATAFORM2PDM(XA_2352);560 VDDATAFORM2PDM(XA_0);561 VDDATAFORM2PDM(MODE2_2336);562 VDDATAFORM2PDM(MODE2_2352);563 VDDATAFORM2PDM(MODE2_0);564 565 #undef VDDATAFORM2PDM566 567 default:568 {569 AssertMsgFailed(("Unknown data form %d! forgot to add it to the switch?\n", enmDataForm));570 return PDMMEDIAREGIONDATAFORM_INVALID;571 }572 }573 }574 575 539 /********************************************************************************************************************************* 576 540 * Error reporting callback * … … 2531 2495 static DECLCALLBACK(int) drvvdQueryRegionProperties(PPDMIMEDIA pInterface, uint32_t uRegion, uint64_t *pu64LbaStart, 2532 2496 uint64_t *pcBlocks, uint64_t *pcbBlock, 2533 P PDMMEDIAREGIONDATAFORM penmDataForm)2497 PVDREGIONDATAFORM penmDataForm) 2534 2498 { 2535 2499 LogFlowFunc(("\n")); … … 2549 2513 *pcbBlock = pRegion->cbBlock; 2550 2514 if (penmDataForm) 2551 *penmDataForm = drvvdVDRegionForm2PdmDataForm(pRegion->enmDataForm);2515 *penmDataForm = pRegion->enmDataForm; 2552 2516 } 2553 2517 else … … 2561 2525 static DECLCALLBACK(int) drvvdQueryRegionPropertiesForLba(PPDMIMEDIA pInterface, uint64_t u64LbaStart, 2562 2526 uint64_t *pcBlocks, uint64_t *pcbBlock, 2563 P PDMMEDIAREGIONDATAFORM penmDataForm)2527 PVDREGIONDATAFORM penmDataForm) 2564 2528 { 2565 2529 LogFlowFunc(("\n")); … … 2588 2552 *pcbBlock = pRegion->cbBlock; 2589 2553 if (penmDataForm) 2590 *penmDataForm = drvvdVDRegionForm2PdmDataForm(pRegion->enmDataForm);2554 *penmDataForm = pRegion->enmDataForm; 2591 2555 2592 2556 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.