VirtualBox

Changeset 1901 in vbox


Ignore:
Timestamp:
Apr 3, 2007 4:51:17 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20150
Message:

VMDK container API, first version (as similar as possible to the VDI
one).

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VmdkHDD.h

    r1828 r1901  
    11/** @file
    2  * VBox HDD Container, Virtual Disk Image (VDI) API.
     2 * VBox VMDK HDD Container API.
    33 */
    44
     
    1919 */
    2020
    21 #ifndef __VBox_VBoxHDD_h__
    22 #define __VBox_VBoxHDD_h__
     21#ifndef __VBox_VmdkHDD_h__
     22#define __VBox_VmdkHDD_h__
    2323
    2424#include <VBox/cdefs.h>
     
    3131
    3232#ifdef IN_RING0
    33 # error "There are no VDI APIs available in Ring-0 Host Context!"
     33# error "There are no VMDK APIs available in Ring-0 Host Context!"
    3434#endif
    3535
    36 /** @defgroup grp_vbox_hdd     VBox HDD Container
     36/** @defgroup grp_vmdk_hdd     VBox VMDK HDD Container
    3737 * @{
    3838 */
    3939
    40 /** Image info, not handled anyhow.
    41  *  Must be less than 64 bytes in length, including the trailing 0.
    42  */
    43 #define VDI_IMAGE_FILE_INFO   "<<< InnoTek VirtualBox Disk Image >>>\n"
    44 
    45 /** Current image major version. */
    46 #define VDI_IMAGE_VERSION_MAJOR    (0x0001)
    47 /** Current image minor version. */
    48 #define VDI_IMAGE_VERSION_MINOR    (0x0001)
    4940/** Current image version. */
    50 #define VDI_IMAGE_VERSION          ((VDI_IMAGE_VERSION_MAJOR << 16) | VDI_IMAGE_VERSION_MINOR)
    51 
    52 /** Get major version from combined version. */
    53 #define VDI_GET_VERSION_MAJOR(uVer)    ((uVer) >> 16)
    54 /** Get minor version from combined version. */
    55 #define VDI_GET_VERSION_MINOR(uVer)    ((uVer) & 0xffff)
    56 
    57 /** @name VDI image types
     41#define VMDK_IMAGE_VERSION      (0x0001)
     42
     43/** @name VMDK image types
    5844 * @{ */
    59 typedef enum VDIIMAGETYPE
     45typedef enum VMDKIMAGETYPE
    6046{
    6147    /** Normal dynamically growing base image file. */
    62     VDI_IMAGE_TYPE_NORMAL = 1,
     48    VMDK_IMAGE_TYPE_NORMAL = 1,
    6349    /** Preallocated base image file of a fixed size. */
    64     VDI_IMAGE_TYPE_FIXED,
     50    VMDK_IMAGE_TYPE_FIXED,
    6551    /** Dynamically growing image file for undo/commit changes support. */
    66     VDI_IMAGE_TYPE_UNDO,
     52    VMDK_IMAGE_TYPE_UNDO,
    6753    /** Dynamically growing image file for differencing support. */
    68     VDI_IMAGE_TYPE_DIFF,
     54    VMDK_IMAGE_TYPE_DIFF,
    6955
    7056    /** First valid image type value. */
    71     VDI_IMAGE_TYPE_FIRST  = VDI_IMAGE_TYPE_NORMAL,
     57    VMDK_IMAGE_TYPE_FIRST   = VMDK_IMAGE_TYPE_NORMAL,
    7258    /** Last valid image type value. */
    73     VDI_IMAGE_TYPE_LAST   = VDI_IMAGE_TYPE_DIFF
    74 } VDIIMAGETYPE;
    75 /** Pointer to VDI image type. */
    76 typedef VDIIMAGETYPE *PVDIIMAGETYPE;
     59    VMDK_IMAGE_TYPE_LAST    = VMDK_IMAGE_TYPE_DIFF
     60} VMDKIMAGETYPE;
     61/** Pointer to VMDK image type. */
     62typedef VMDKIMAGETYPE *PVMDKIMAGETYPE;
    7763/** @} */
    7864
    79 /** @name VDI image flags
    80  * @{  */
     65/** @name VMDK image flags
     66 * @{
     67 */
    8168/** No flags. */
    82 #define VDI_IMAGE_FLAGS_NONE          (0x00)
    83 /** Fill new blocks with zeroes while expanding image file. */
    84 #define VDI_IMAGE_FLAGS_ZERO_EXPAND   (0x01)
     69#define VMDK_IMAGE_FLAGS_NONE           (0)
     70/** Split image into 2GB extents. */
     71#define VMDK_IMAGE_FLAGS_SPLIT_2G       (1)
     72/** Split image into 2GB extents. */
     73#define VMDK_IMAGE_FLAGS_RAWDISK        (2)
    8574
    8675/** Mask of valid image flags. */
    87 #define VDI_IMAGE_FLAGS_MASK          (VDI_IMAGE_FLAGS_NONE | VDI_IMAGE_FLAGS_ZERO_EXPAND)
    88 
    89 /** Default image flags. */
    90 #define VDI_IMAGE_FLAGS_DEFAULT       (VDI_IMAGE_FLAGS_NONE)
     76#define VMDK_IMAGE_FLAGS_MASK           (VMDK_IMAGE_FLAGS_SPLIT_2G | VMDK_IMAGE_FLAGS_RAWDISK)
     77
     78/** Default image flafs. */
     79#define VMDK_IMAGE_FLAGS_DEFAULT        (VMDK_IMAGE_FLAGS_NONE)
    9180/** @} */
    9281
    93 /** @name VDI image open mode flags
     82/** @name VMDK image open mode flags
    9483 * @{
    9584 */
    9685/** Try to open image in read/write exclusive access mode if possible, or in read-only elsewhere. */
    97 #define VDI_OPEN_FLAGS_NORMAL     (0)
     86#define VMDK_OPEN_FLAGS_NORMAL          (0)
    9887/** Open image in read-only mode with sharing access with others. */
    99 #define VDI_OPEN_FLAGS_READONLY   (1)
     88#define VMDK_OPEN_FLAGS_READONLY        (1)
     89/** Honor zero block writes instead of ignoring them if possible. */
     90#define VMDK_OPEN_FLAGS_HONOR_ZEROES    (2)
    10091/** Mask of valid flags. */
    101 #define VDI_OPEN_FLAGS_MASK (VDI_OPEN_FLAGS_NORMAL | VDI_OPEN_FLAGS_READONLY)
     92#define VMDK_OPEN_FLAGS_MASK            (VMDK_OPEN_FLAGS_NORMAL | VMDK_OPEN_FLAGS_READONLY | VMDK_OPEN_FLAGS_HONOR_ZEROES)
    10293/** @}*/
    10394
    10495/**
    105  * VBox VDI disk Container main structure.
    106  */
    107 /* Forward declaration, VDIDISK structure is visible only inside VDI module. */
    108 struct VDIDISK;
    109 typedef struct VDIDISK VDIDISK;
    110 typedef VDIDISK *PVDIDISK;
     96 * VBox VMDK HDD Container main structure.
     97 */
     98/* Forward declaration, VMDKDISK structure is visible only inside VMDK module. */
     99struct VMDKDISK;
     100typedef struct VMDKDISK VMDKDISK;
     101typedef VMDKDISK *PVMDKDISK;
    111102
    112103/**
     
    117108 * @param   enmType         Image type, only base image types are acceptable.
    118109 * @param   cbSize          Image size in bytes.
     110 * @param   uImageFlags     Flags specifying special image features.
    119111 * @param   pszComment      Pointer to image comment. NULL is ok.
    120112 * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    121113 * @param   pvUser          User argument for the progress callback.
    122114 */
    123 VBOXDDU_DECL(int) VDICreateBaseImage(const char *pszFilename, VDIIMAGETYPE enmType, uint64_t cbSize, const char *pszComment,
    124                                      PFNVMPROGRESS pfnProgress, void *pvUser);
     115VBOXDDU_DECL(int) VMDKCreateBaseImage(const char *pszFilename, VMDKIMAGETYPE enmType,
     116                                      uint64_t cbSize, unsigned uImageFlags, const char *pszComment,
     117                                      PFNVMPROGRESS pfnProgress, void *pvUser);
    125118
    126119/**
     
    130123 * @param   pszFilename     Name of the differencing image file to create.
    131124 * @param   pszParent       Name of the parent image file. May be base or diff image type.
     125 * @param   uImageFlags     Flags specifying special image features.
    132126 * @param   pszComment      Pointer to image comment. NULL is ok.
    133127 * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    134128 * @param   pvUser          User argument for the progress callback.
    135129 */
    136 VBOXDDU_DECL(int) VDICreateDifferenceImage(const char *pszFilename, const char *pszParent, const char *pszComment,
    137                                            PFNVMPROGRESS pfnProgress, void *pvUser);
     130VBOXDDU_DECL(int) VMDKCreateDifferenceImage(const char *pszFilename, const char *pszParent,
     131                                            unsigned uImageFlags, const char *pszComment,
     132                                            PFNVMPROGRESS pfnProgress, void *pvUser);
    138133
    139134/**
     
    150145 * @param   cbComment       The size of pszComment buffer. 0 is ok.
    151146 */
    152 VBOXDDU_DECL(int) VDICheckImage(const char *pszFilename,
    153                                 unsigned *puVersion,
    154                                 PVDIIMAGETYPE penmType,
    155                                 uint64_t *pcbSize,
    156                                 PRTUUID pUuid,
    157                                 PRTUUID pParentUuid,
    158                                 char *pszComment,
    159                                 unsigned cbComment);
     147VBOXDDU_DECL(int) VMDKCheckImage(const char *pszFilename, unsigned *puVersion,
     148                                 PVMDKIMAGETYPE penmType, uint64_t *pcbSize,
     149                                 PRTUUID pUuid, PRTUUID pParentUuid,
     150                                 char *pszComment, unsigned cbComment);
    160151
    161152/**
     
    166157 * @param   pszComment      New comment string (UTF-8). NULL is allowed to reset the comment.
    167158 */
    168 VBOXDDU_DECL(int) VDISetImageComment(const char *pszFilename, const char *pszComment);
     159VBOXDDU_DECL(int) VMDKSetImageComment(const char *pszFilename, const char *pszComment);
    169160
    170161/**
     
    174165 * @param   pszFilename     Name of the image file to check.
    175166 */
    176 VBOXDDU_DECL(int) VDIDeleteImage(const char *pszFilename);
     167VBOXDDU_DECL(int) VMDKDeleteImage(const char *pszFilename);
    177168
    178169/**
     
    187178 * @param   pvUser          User argument for the progress callback.
    188179 */
    189 VBOXDDU_DECL(int) VDICopyImage(const char *pszDstFilename, const char *pszSrcFilename, const char *pszComment,
     180VBOXDDU_DECL(int) VMDKCopyImage(const char *pszDstFilename, const char *pszSrcFilename, const char *pszComment,
    190181                               PFNVMPROGRESS pfnProgress, void *pvUser);
    191 
    192 /**
    193  * Converts image file from older VDI formats to current one.
    194  *
    195  * @returns VBox status code.
    196  * @param   pszFilename     Name of the image file to convert.
    197  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    198  * @param   pvUser          User argument for the progress callback.
    199  */
    200 VBOXDDU_DECL(int) VDIConvertImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
    201182
    202183/**
     
    208189 * @param   pvUser          User argument for the progress callback.
    209190 */
    210 VBOXDDU_DECL(int) VDIShrinkImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
     191VBOXDDU_DECL(int) VMDKShrinkImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
    211192
    212193/**
     
    220201 * @param   pParentModificationUuid Where to store parent modification UUID (can be NULL).
    221202 */
    222 VBOXDDU_DECL(int) VDIGetImageUUIDs(const char *pszFilename,
     203VBOXDDU_DECL(int) VMDKGetImageUUIDs(const char *pszFilename,
    223204                                   PRTUUID pUuid, PRTUUID pModificationUuid,
    224205                                   PRTUUID pParentUuid, PRTUUID pParentModificationUuid);
     
    235216 * @param   pParentModificationUuid Optional parameter, new parent modification UUID of the image.
    236217 */
    237 VBOXDDU_DECL(int) VDISetImageUUIDs(const char *pszFilename,
     218VBOXDDU_DECL(int) VMDKSetImageUUIDs(const char *pszFilename,
    238219                                   PCRTUUID pUuid, PCRTUUID pModificationUuid,
    239220                                   PCRTUUID pParentUuid, PCRTUUID pParentModificationUuid);
     
    245226 * @param   pszFilenameFrom         Name of the image file to merge from.
    246227 * @param   pszFilenameTo           Name of the image file to merge into.
    247  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    248  * @param   pvUser          User argument for the progress callback.
    249  */
    250 VBOXDDU_DECL(int) VDIMergeImage(const char *pszFilenameFrom, const char *pszFilenameTo,
     228 * @param   pfnProgress             Progress callback. Optional. NULL if not to be used.
     229 * @param   pvUser                  User argument for the progress callback.
     230 */
     231VBOXDDU_DECL(int) VMDKMergeImage(const char *pszFilenameFrom, const char *pszFilenameTo,
    251232                                PFNVMPROGRESS pfnProgress, void *pvUser);
    252233
    253234
    254235/**
    255  * Allocates and initializes an empty VDI HDD container.
     236 * Allocates and initializes an empty VMDK HDD container.
    256237 * No image files are opened.
    257238 *
     
    259240 * @returns NULL on failure, typically out of memory.
    260241 */
    261 VBOXDDU_DECL(PVDIDISK) VDIDiskCreate(void);
    262 
    263 /**
    264  * Destroys the VDI HDD container. If container has opened image files they will be closed.
    265  *
    266  * @param   pDisk           Pointer to VDI HDD container.
    267  */
    268 VBOXDDU_DECL(void) VDIDiskDestroy(PVDIDISK pDisk);
     242VBOXDDU_DECL(PVMDKDISK) VMDKDiskCreate(void);
     243
     244/**
     245 * Destroys the VMDK HDD container. If container has opened image files they will be closed.
     246 *
     247 * @param   pDisk           Pointer to VMDK HDD container.
     248 */
     249VBOXDDU_DECL(void) VMDKDiskDestroy(PVMDKDISK pDisk);
    269250
    270251/**
     
    279260 *
    280261 * Note that the image can be opened in read-only mode if a read/write open is not possible.
    281  * Use VDIDiskIsReadOnly to check open mode.
    282  *
    283  * @returns VBox status code.
    284  * @param   pDisk           Pointer to VDI HDD container.
     262 * Use VMDKDiskIsReadOnly to check open mode.
     263 *
     264 * @returns VBox status code.
     265 * @param   pDisk           Pointer to VMDK HDD container.
    285266 * @param   pszFilename     Name of the image file to open.
    286  * @param   fOpen           Image file open mode, see VDI_OPEN_FLAGS_* constants.
    287  */
    288 VBOXDDU_DECL(int) VDIDiskOpenImage(PVDIDISK pDisk, const char *pszFilename, unsigned fOpen);
     267 * @param   fOpen           Image file open mode, see VMDK_OPEN_FLAGS_* constants.
     268 */
     269VBOXDDU_DECL(int) VMDKDiskOpenImage(PVMDKDISK pDisk, const char *pszFilename, unsigned fOpen);
    289270
    290271/**
    291272 * Creates and opens a new differencing image file in HDD container.
    292  * See comments for VDIDiskOpenImage function about differencing images.
    293  *
    294  * @returns VBox status code.
    295  * @param   pDisk           Pointer to VDI HDD container.
     273 * See comments for VMDKDiskOpenImage function about differencing images.
     274 *
     275 * @returns VBox status code.
     276 * @param   pDisk           Pointer to VMDK HDD container.
    296277 * @param   pszFilename     Name of the image file to create and open.
    297278 * @param   pszComment      Pointer to image comment. NULL is ok.
     
    299280 * @param   pvUser          User argument for the progress callback.
    300281 */
    301 VBOXDDU_DECL(int) VDIDiskCreateOpenDifferenceImage(PVDIDISK pDisk, const char *pszFilename, const char *pszComment,
     282VBOXDDU_DECL(int) VMDKDiskCreateOpenDifferenceImage(PVMDKDISK pDisk, const char *pszFilename, const char *pszComment,
    302283                                                   PFNVMPROGRESS pfnProgress, void *pvUser);
    303284
     
    308289 * will be reopened in read/write mode.
    309290 *
    310  * @param   pDisk           Pointer to VDI HDD container.
    311  */
    312 VBOXDDU_DECL(void) VDIDiskCloseImage(PVDIDISK pDisk);
     291 * @param   pDisk           Pointer to VMDK HDD container.
     292 */
     293VBOXDDU_DECL(void) VMDKDiskCloseImage(PVMDKDISK pDisk);
    313294
    314295/**
    315296 * Closes all opened image files in HDD container.
    316297 *
    317  * @param   pDisk           Pointer to VDI HDD container.
    318  */
    319 VBOXDDU_DECL(void) VDIDiskCloseAllImages(PVDIDISK pDisk);
     298 * @param   pDisk           Pointer to VMDK HDD container.
     299 */
     300VBOXDDU_DECL(void) VMDKDiskCloseAllImages(PVMDKDISK pDisk);
    320301
    321302/**
     
    325306 * After successfull commit the previous image file again reopened in read-only mode, last opened
    326307 * image file is cleared of data and remains open and active in HDD container.
    327  * If you want to delete image after commit you must do it manually by VDIDiskCloseImage and
    328  * VDIDeleteImage calls.
     308 * If you want to delete image after commit you must do it manually by VMDKDiskCloseImage and
     309 * VMDKDeleteImage calls.
    329310 *
    330311 * Note that in case of unrecoverable error all images of HDD container will be closed.
    331312 *
    332313 * @returns VBox status code.
    333  * @param   pDisk           Pointer to VDI HDD container.
     314 * @param   pDisk           Pointer to VMDK HDD container.
    334315 * @param   pfnProgress     Progress callback. Optional.
    335316 * @param   pvUser          User argument for the progress callback.
    336317 */
    337 VBOXDDU_DECL(int) VDIDiskCommitLastDiff(PVDIDISK pDisk, PFNVMPROGRESS pfnProgress, void *pvUser);
    338 
    339 /**
    340  * Get read/write mode of VDI HDD.
     318VBOXDDU_DECL(int) VMDKDiskCommitLastDiff(PVMDKDISK pDisk, PFNVMPROGRESS pfnProgress, void *pvUser);
     319
     320/**
     321 * Get read/write mode of VMDK HDD.
    341322 *
    342323 * @returns Disk ReadOnly status.
    343  * @returns true if no one VDI image is opened in HDD container.
    344  */
    345 VBOXDDU_DECL(bool) VDIDiskIsReadOnly(PVDIDISK pDisk);
    346 
    347 /**
    348  * Get total disk size of the VDI HDD container.
     324 * @returns true if no VMDK image is opened in HDD container.
     325 */
     326VBOXDDU_DECL(bool) VMDKDiskIsReadOnly(PVMDKDISK pDisk);
     327
     328/**
     329 * Get total disk size of the VMDK HDD container.
    349330 *
    350331 * @returns Virtual disk size in bytes.
    351  * @returns 0 if no one VDI image is opened in HDD container.
    352  */
    353 VBOXDDU_DECL(uint64_t) VDIDiskGetSize(PVDIDISK pDisk);
    354 
    355 /**
    356  * Get block size of the VDI HDD container.
    357  *
    358  * @returns VDI image block size in bytes.
    359  * @returns 0 if no one VDI image is opened in HDD container.
    360  */
    361 VBOXDDU_DECL(unsigned) VDIDiskGetBlockSize(PVDIDISK pDisk);
    362 
    363 /**
    364  * Get working buffer size of the VDI HDD container.
     332 * @returns 0 if no VMDK image is opened in HDD container.
     333 */
     334VBOXDDU_DECL(uint64_t) VMDKDiskGetSize(PVMDKDISK pDisk);
     335
     336/**
     337 * Get block size of the VMDK HDD container.
     338 *
     339 * @returns VMDK image block size in bytes.
     340 * @returns 0 if no VMDK image is opened in HDD container.
     341 */
     342VBOXDDU_DECL(unsigned) VMDKDiskGetBlockSize(PVMDKDISK pDisk);
     343
     344/**
     345 * Get working buffer size of the VMDK HDD container.
    365346 *
    366347 * @returns Working buffer size in bytes.
    367348 */
    368 VBOXDDU_DECL(unsigned) VDIDiskGetBufferSize(PVDIDISK pDisk);
     349VBOXDDU_DECL(unsigned) VMDKDiskGetBufferSize(PVMDKDISK pDisk);
    369350
    370351/**
     
    372353 *
    373354 * @returns VBox status code.
    374  * @returns VERR_VDI_NOT_OPENED if no one VDI image is opened in HDD container.
     355 * @returns VERR_VDI_NOT_OPENED if no VMDK image is opened in HDD container.
    375356 * @returns VERR_VDI_GEOMETRY_NOT_SET if no geometry present in the HDD container.
    376  * @param   pDisk           Pointer to VDI HDD container.
     357 * @param   pDisk           Pointer to VMDK HDD container.
    377358 * @param   pcCylinders     Where to store the number of cylinders. NULL is ok.
    378359 * @param   pcHeads         Where to store the number of heads. NULL is ok.
    379360 * @param   pcSectors       Where to store the number of sectors. NULL is ok.
    380361 */
    381 VBOXDDU_DECL(int) VDIDiskGetGeometry(PVDIDISK pDisk, unsigned *pcCylinders, unsigned *pcHeads, unsigned *pcSectors);
     362VBOXDDU_DECL(int) VMDKDiskGetGeometry(PVMDKDISK pDisk, unsigned *pcCylinders, unsigned *pcHeads, unsigned *pcSectors);
    382363
    383364/**
     
    387368 *
    388369 * @returns VBox status code.
    389  * @returns VERR_VDI_NOT_OPENED if no one VDI image is opened in HDD container.
    390  * @param   pDisk           Pointer to VDI HDD container.
     370 * @returns VERR_VDI_NOT_OPENED if no VMDK image is opened in HDD container.
     371 * @param   pDisk           Pointer to VMDK HDD container.
    391372 * @param   cCylinders      Number of cylinders.
    392373 * @param   cHeads          Number of heads.
    393374 * @param   cSectors        Number of sectors.
    394375 */
    395 VBOXDDU_DECL(int) VDIDiskSetGeometry(PVDIDISK pDisk, unsigned cCylinders, unsigned cHeads, unsigned cSectors);
     376VBOXDDU_DECL(int) VMDKDiskSetGeometry(PVMDKDISK pDisk, unsigned cCylinders, unsigned cHeads, unsigned cSectors);
    396377
    397378/**
     
    399380 *
    400381 * @returns VBox status code.
    401  * @returns VERR_VDI_NOT_OPENED if no one VDI image is opened in HDD container.
    402  * @param   pDisk           Pointer to VDI HDD container.
     382 * @returns VERR_VDI_NOT_OPENED if no VMDK image is opened in HDD container.
     383 * @param   pDisk           Pointer to VMDK HDD container.
    403384 * @param   penmTranslation Where to store the translation mode (see pdm.h).
    404385 */
    405 VBOXDDU_DECL(int) VDIDiskGetTranslation(PVDIDISK pDisk, PPDMBIOSTRANSLATION penmTranslation);
     386VBOXDDU_DECL(int) VMDKDiskGetTranslation(PVMDKDISK pDisk, PPDMBIOSTRANSLATION penmTranslation);
    406387
    407388/**
     
    411392 *
    412393 * @returns VBox status code.
    413  * @returns VERR_VDI_NOT_OPENED if no one VDI image is opened in HDD container.
    414  * @param   pDisk           Pointer to VDI HDD container.
     394 * @returns VERR_VDI_NOT_OPENED if no VMDK image is opened in HDD container.
     395 * @param   pDisk           Pointer to VMDK HDD container.
    415396 * @param   enmTranslation  Translation mode (see pdm.h).
    416397 */
    417 VBOXDDU_DECL(int) VDIDiskSetTranslation(PVDIDISK pDisk, PDMBIOSTRANSLATION enmTranslation);
     398VBOXDDU_DECL(int) VMDKDiskSetTranslation(PVMDKDISK pDisk, PDMBIOSTRANSLATION enmTranslation);
    418399
    419400/**
     
    421402 *
    422403 * @returns Number of opened images for HDD container. 0 if no images has been opened.
    423  * @param   pDisk           Pointer to VDI HDD container.
    424  */
    425 VBOXDDU_DECL(int) VDIDiskGetImagesCount(PVDIDISK pDisk);
     404 * @param   pDisk           Pointer to VMDK HDD container.
     405 */
     406VBOXDDU_DECL(int) VMDKDiskGetImagesCount(PVMDKDISK pDisk);
    426407
    427408/**
     
    430411 * @returns VBox status code.
    431412 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    432  * @param   pDisk           Pointer to VDI HDD container.
     413 * @param   pDisk           Pointer to VMDK HDD container.
    433414 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    434415 * @param   puVersion       Where to store the image version.
    435416 */
    436 VBOXDDU_DECL(int) VDIDiskGetImageVersion(PVDIDISK pDisk, int nImage, unsigned *puVersion);
     417VBOXDDU_DECL(int) VMDKDiskGetImageVersion(PVMDKDISK pDisk, int nImage, unsigned *puVersion);
    437418
    438419/**
     
    441422 * @returns VBox status code.
    442423 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    443  * @param   pDisk           Pointer to VDI HDD container.
     424 * @param   pDisk           Pointer to VMDK HDD container.
    444425 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    445426 * @param   penmType        Where to store the image type.
    446427 */
    447 VBOXDDU_DECL(int) VDIDiskGetImageType(PVDIDISK pDisk, int nImage, PVDIIMAGETYPE penmType);
     428VBOXDDU_DECL(int) VMDKDiskGetImageType(PVMDKDISK pDisk, int nImage, PVMDKIMAGETYPE penmType);
    448429
    449430/**
     
    452433 * @returns VBox status code.
    453434 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    454  * @param   pDisk           Pointer to VDI HDD container.
     435 * @param   pDisk           Pointer to VMDK HDD container.
    455436 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    456437 * @param   pfFlags         Where to store the image flags.
    457438 */
    458 VBOXDDU_DECL(int) VDIDiskGetImageFlags(PVDIDISK pDisk, int nImage, unsigned *pfFlags);
    459 
    460 /**
    461  * Get filename of opened image of HDD container.
     439VBOXDDU_DECL(int) VMDKDiskGetImageFlags(PVMDKDISK pDisk, int nImage, unsigned *pfFlags);
     440
     441/**
     442 * Get base filename of opened image of HDD container.
    462443 *
    463444 * @returns VBox status code.
    464445 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    465446 * @returns VERR_BUFFER_OVERFLOW if pszFilename buffer too small to hold filename.
    466  * @param   pDisk           Pointer to VDI HDD container.
     447 * @param   pDisk           Pointer to VMDK HDD container.
    467448 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    468449 * @param   pszFilename     Where to store the image file name.
    469450 * @param   cbFilename      Size of buffer pszFilename points to.
    470451 */
    471 VBOXDDU_DECL(int) VDIDiskGetImageFilename(PVDIDISK pDisk, int nImage, char *pszFilename, unsigned cbFilename);
     452VBOXDDU_DECL(int) VMDKDiskGetImageFilename(PVMDKDISK pDisk, int nImage, char *pszFilename, unsigned cbFilename);
    472453
    473454/**
     
    477458 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    478459 * @returns VERR_BUFFER_OVERFLOW if pszComment buffer too small to hold comment text.
    479  * @param   pDisk           Pointer to VDI HDD container.
     460 * @param   pDisk           Pointer to VMDK HDD container.
    480461 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    481462 * @param   pszComment      Where to store the comment string of image. NULL is ok.
    482463 * @param   cbComment       The size of pszComment buffer. 0 is ok.
    483464 */
    484 VBOXDDU_DECL(int) VDIDiskGetImageComment(PVDIDISK pDisk, int nImage, char *pszComment, unsigned cbComment);
     465VBOXDDU_DECL(int) VMDKDiskGetImageComment(PVMDKDISK pDisk, int nImage, char *pszComment, unsigned cbComment);
    485466
    486467/**
     
    489470 * @returns VBox status code.
    490471 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    491  * @param   pDisk           Pointer to VDI HDD container.
     472 * @param   pDisk           Pointer to VMDK HDD container.
    492473 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    493474 * @param   pUuid           Where to store the image creation uuid.
    494475 */
    495 VBOXDDU_DECL(int) VDIDiskGetImageUuid(PVDIDISK pDisk, int nImage, PRTUUID pUuid);
     476VBOXDDU_DECL(int) VMDKDiskGetImageUuid(PVMDKDISK pDisk, int nImage, PRTUUID pUuid);
    496477
    497478/**
     
    500481 * @returns VBox status code.
    501482 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    502  * @param   pDisk           Pointer to VDI HDD container.
     483 * @param   pDisk           Pointer to VMDK HDD container.
    503484 * @param   nImage          Image number, counts from 0. 0 is always base image of container.
    504485 * @param   pUuid           Where to store the image modification uuid.
    505486 */
    506 VBOXDDU_DECL(int) VDIDiskGetImageModificationUuid(PVDIDISK pDisk, int nImage, PRTUUID pUuid);
     487VBOXDDU_DECL(int) VMDKDiskGetImageModificationUuid(PVMDKDISK pDisk, int nImage, PRTUUID pUuid);
    507488
    508489/**
     
    511492 * @returns VBox status code.
    512493 * @returns VERR_VDI_IMAGE_NOT_FOUND if image with specified number was not opened.
    513  * @param   pDisk           Pointer to VDI HDD container.
     494 * @param   pDisk           Pointer to VMDK HDD container.
    514495 * @param   nImage          Image number, counts from 0. 0 is always base image of the container.
    515496 * @param   pUuid           Where to store the image creation uuid.
    516497 */
    517 VBOXDDU_DECL(int) VDIDiskGetParentImageUuid(PVDIDISK pDisk, int nImage, PRTUUID pUuid);
     498VBOXDDU_DECL(int) VMDKDiskGetParentImageUuid(PVMDKDISK pDisk, int nImage, PRTUUID pUuid);
    518499
    519500/**
     
    521502 *
    522503 * @returns VBox status code.
    523  * @param   pDisk           Pointer to VDI HDD container.
     504 * @param   pDisk           Pointer to VMDK HDD container.
    524505 * @param   offStart        Offset of first reading byte from start of disk.
    525506 * @param   pvBuf           Pointer to buffer for reading data.
    526507 * @param   cbToRead        Number of bytes to read.
    527508 */
    528 VBOXDDU_DECL(int) VDIDiskRead(PVDIDISK pDisk, uint64_t offStart, void *pvBuf, unsigned cbToRead);
     509VBOXDDU_DECL(int) VMDKDiskRead(PVMDKDISK pDisk, uint64_t offStart, void *pvBuf, unsigned cbToRead);
    529510
    530511/**
     
    532513 *
    533514 * @returns VBox status code.
    534  * @param   pDisk           Pointer to VDI HDD container.
     515 * @param   pDisk           Pointer to VMDK HDD container.
    535516 * @param   offStart        Offset of first writing byte from start of HDD.
    536517 * @param   pvBuf           Pointer to buffer of writing data.
    537518 * @param   cbToWrite       Number of bytes to write.
    538519 */
    539 VBOXDDU_DECL(int) VDIDiskWrite(PVDIDISK pDisk, uint64_t offStart, const void *pvBuf, unsigned cbToWrite);
     520VBOXDDU_DECL(int) VMDKDiskWrite(PVMDKDISK pDisk, uint64_t offStart, const void *pvBuf, unsigned cbToWrite);
    540521
    541522
     
    544525 * Debug helper - dumps all opened images of HDD container into the log file.
    545526 *
    546  * @param   pDisk           Pointer to VDI HDD container.
    547  */
    548 VBOXDDU_DECL(void) VDIDiskDumpImages(PVDIDISK pDisk);
     527 * @param   pDisk           Pointer to VMDK HDD container.
     528 */
     529VBOXDDU_DECL(void) VMDKDiskDumpImages(PVMDKDISK pDisk);
    549530
    550531__END_DECLS
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette