vd.h revision cd701ca689d9ee34b7cc9e66b84a70a06d944a3f
2N/A * VBox HDD Container API. 2N/A * Copyright (C) 2006-2014 Oracle Corporation 2N/A * This file is part of VirtualBox Open Source Edition (OSE), as 2N/A * you can redistribute it and/or modify it under the terms of the GNU 2N/A * General Public License (GPL) as published by the Free Software 2N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 2N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 2N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 2N/A * The contents of this file may alternatively be used under the terms 2N/A * of the Common Development and Distribution License Version 1.0 2N/A * (CDDL) only, as it comes in the "COPYING.CDDL" file of the 2N/A * VirtualBox OSE distribution, in which case the provisions of the 2N/A * CDDL are applicable instead of those of the GPL. 2N/A * You may elect to license modified versions of this file under the 2N/A * terms and conditions of either the GPL or the CDDL or both. 2N/A#
error "There are no VBox HDD Container APIs available in Ring-0 Host Context!" 2N/A/** @defgroup grp_vd VBox HDD Container /** Current VMDK image version. */ /** Current VDI image major version. */ /** Current VDI image minor version. */ /** Current VDI image version. */ /** Get VDI major version from combined version. */ /** Get VDI minor version from combined version. */ /** Placeholder for specifying the last opened image. */ /** Placeholder for VDCopyEx to indicate that the image content is unknown. */ /** @name VBox HDD container image flags /** Diff image. Mutually exclusive with fixed image. */ /** VMDK: Split image into 2GB extents. */ /** VMDK: Raw disk image (giving access to a number of host partitions). */ /** VMDK: stream optimized image, read only. */ /** VMDK: ESX variant, use in addition to other flags. */ /** VDI: Fill new blocks with zeroes while expanding image file. Only valid * for newly created images, never set for opened existing images. */ /** Mask of valid image flags for VMDK. */ /** Mask of valid image flags for VDI. */ /** Mask of all valid image flags for all formats. */ /** Default image flags. */ /** @name VD image repair flags /** Don't repair the image but check what needs to be done. */ /** Mask of all valid repair flags. */ /** @name VD image VFS file flags /** Destroy the VD disk container when the VFS file is released. */ /** Mask of all valid repair flags. */ * Auxiliary type for describing partitions on raw disks. The entries must be * in ascending order (as far as uStart is concerned), and must not overlap. * Note that this does not correspond 1:1 to partitions, it is describing the * general meaning of contiguous areas on the disk. /** Device to use for this partition/data area. Can be the disk device if * the offset field is set appropriately. If this is NULL, then this * partition will not be accessible to the guest. The size of the data area * must still be set correctly. */ /** Pointer to the partitioning info. NULL means this is a regular data * area on disk, non-NULL denotes data which should be copied to the * partition data overlay. */ /** Offset where the data starts in this device. */ /** Offset where the data starts in the disk. */ /** Size of the data area. */ * Auxiliary data structure for difference between GPT and MBR * Auxiliary data structure for creating raw disks. /** Signature for structure. Must be 'R', 'A', 'W', '\\0'. Actually a trick * to make logging of the comment string produce sensible results. */ /** Flag whether access to full disk should be given (ignoring the * partition information below). */ /** Filename for the raw disk. Ignored for partitioned raw disks. * For Linux e.g. /dev/sda, and for Windows e.g. \\\\.\\PhysicalDisk0. */ /** Number of entries in the partition descriptor array. */ /** Pointer to the partition descriptor array. */ /** Partitioning type of the disk */ /** @name VBox HDD container image open mode flags /** Try to open image in read/write exclusive access mode if possible, or in read-only elsewhere. */ /** Open image in read-only mode with sharing access with others. */ /** Honor zero block writes instead of ignoring them whenever possible. * This is not supported by all formats. It is silently ignored in this case. */ /** Honor writes of the same data instead of ignoring whenever possible. * This is handled generically, and is only meaningful for differential image * formats. It is silently ignored otherwise. */ /** Do not perform the base/diff image check on open. This does NOT imply * opening the image as readonly (would break e.g. adding UUIDs to VMDK files * created by other products). Images opened with this flag should only be * used for querying information, and nothing else. */ /** Open image for asynchronous access. Only available if VD_CAP_ASYNC_IO is * set. VDOpen fails with VERR_NOT_SUPPORTED if this operation is not supported for /** Allow sharing of the image for writable images. May be ignored if the * format backend doesn't support this type of concurrent access. */ /** Ask the backend to switch to sequential accesses if possible. Opening * will not fail if it cannot do this, the flag will be simply ignored. */ /** Allow the discard operation if supported. Only available if VD_CAP_DISCARD * is set. VDOpen fails with VERR_VD_DISCARD_NOT_SUPPORTED if discarding is not /** Ignore all flush requests to workaround certain filesystems which are slow * when writing a lot of cached data to the medium. * Use with extreme care as a host crash can result in completely corrupted and * Return VINF_VD_NEW_ZEROED_BLOCK for reads from unallocated blocks. * The caller who uses the flag has to make sure that the read doesn't cross * a block boundary. Because the block size can differ between images reading one * sector at a time is the safest solution. * Don't do unnecessary consistency checks when opening the image. * Only valid when the image is opened in readonly because inconsistencies * can lead to corrupted images in read-write mode. /** Mask of valid flags. */ * Helper functions to handle open flags. * Translate VD_OPEN_FLAGS_* to RTFile open flags. * @return RTFile open flags. * @param uOpenFlags VD_OPEN_FLAGS_* open flags. * @param fCreate Flag that the file should be created. /** @name VBox HDD container backend capability flags /** Supports UUIDs as expected by VirtualBox code. */ /** Supports creating fixed size images, allocating all space instantly. */ /** Supports creating dynamically growing images, allocating space on demand. */ /** Supports creating images split in chunks of a bit less than 2GBytes. */ /** Supports being used as differencing image format backend. */ /** Supports asynchronous I/O operations for at least some configurations. */ /** The backend operates on files. The caller needs to know to handle the * location appropriately. */ /** The backend uses the config interface. The caller needs to know how to * provide the mandatory configuration parts this way. */ /** The backend uses the network stack interface. The caller has to provide * the appropriate interface. */ /** The backend supports VFS (virtual filesystem) functionality since it uses * VDINTERFACEIO exclusively for all file operations. */ /** The backend supports the discard operation. */ /** @name VBox HDD container type. /** @name Configuration interface key handling flags. /** Mandatory config key. Not providing a value for this key will cause * the backend to fail. */ /** Expert config key. Not showing it by default in the GUI is is probably * a good idea, as the average user won't understand it easily. */ * Configuration value type for configuration information interface. * through the config interface. /** Key name of the configuration. */ /** Pointer to default value (descriptor). NULL if no useful default value /** Value type for this key. */ /** Key handling flags (a combination of VD_CFGKEY_* flags). */ /** Pointer to structure describing configuration keys. */ /** Pointer to const structure describing configuration keys. */ * Structure describing a file extension. /** Pointer to the NULL-terminated string containing the extension. */ /** The device type the extension supports. */ /** Pointer to a structure describing a file extension. */ /** Pointer to a const structure describing a file extension. */ * Data structure for returning a list of backend capabilities. /** Name of the backend. Must be unique even with case insensitive comparison. */ /** Capabilities of the backend (a combination of the VD_CAP_* flags). */ /** Pointer to a NULL-terminated array of strings, containing the supported * file extensions. Note that some backends do not work on files, so this * pointer may just contain NULL. */ /** Pointer to an array of structs describing each supported config key. * Terminated by a NULL config key. Note that some backends do not support * the configuration interface, so this pointer may just contain NULL. * Mandatory if the backend sets VD_CAP_CONFIG. */ /** Returns a human readable hard disk location string given a * set of hard disk configuration keys. The returned string is an * equivalent of the full file path for image-based hard disks. * Mandatory for backends with no VD_CAP_FILE and NULL otherwise. */ /** Returns a human readable hard disk name string given a * set of hard disk configuration keys. The returned string is an * equivalent of the file name part in the full file path for * image-based hard disks. Mandatory for backends with no * VD_CAP_FILE and NULL otherwise. */ * Data structure for returning a list of filter capabilities. /** Name of the filter. Must be unique even with case insensitive comparison. */ /** Pointer to an array of structs describing each supported config key. * Terminated by a NULL config key. Note that some filters do not support * the configuration interface, so this pointer may just contain NULL. */ * Request completion callback for the async read/write API. /** Pointer to a transfer compelte callback. */ /** Number of cylinders. */ /** Number of sectors. */ /** Pointer to disk geometry. */ /** Pointer to constant disk geometry. */ * VBox HDD Container main structure. /* Forward declaration, VBOXHDD structure is visible only inside VBox HDD module. */ * Initializes HDD backends. * @returns VBox status code. * Destroys loaded HDD backends. * @returns VBox status code. * Loads a single plugin given by filename. * @returns VBox status code. * @param pszFilename The plugin filename to load. * Load all plugins from a given path. * @returns VBox statuse code. * @param pszPath The path to load plugins from. * Unloads a single plugin given by filename. * @returns VBox status code. * @param pszFilename The plugin filename to unload. * Unload all plugins from a given path. * @returns VBox statuse code. * @param pszPath The path to unload plugins from. * Lists all HDD backends and their capabilities in a caller-provided buffer. * @return VBox status code. * VERR_BUFFER_OVERFLOW if not enough space is passed. * @param cEntriesAlloc Number of list entries available. * @param pEntries Pointer to array for the entries. * @param pcEntriesUsed Number of entries returned. * Lists the capabilities of a backend identified by its name. * @return VBox status code. * @param pszBackend The backend name (case insensitive). * @param pEntries Pointer to an entry. * Lists all filters and their capabilities in a caller-provided buffer. * @return VBox status code. * VERR_BUFFER_OVERFLOW if not enough space is passed. * @param cEntriesAlloc Number of list entries available. * @param pEntries Pointer to array for the entries. * @param pcEntriesUsed Number of entries returned. * Lists the capabilities of a filter identified by its name. * @return VBox status code. * @param pszFilter The filter name (case insensitive). * @param pEntries Pointer to an entry. * Allocates and initializes an empty HDD container. * No image files are opened. * @return VBox status code. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param enmType Type of the image container. * @param ppDisk Where to store the reference to HDD container. * Destroys HDD container. * If container has opened image files they will be closed. * @return VBox status code. * @param pDisk Pointer to HDD container. * Try to get the backend name which can use this image. * @return VBox status code. * VINF_SUCCESS if a plugin was found. * ppszFormat contains the string which can be used as backend name. * VERR_NOT_SUPPORTED if no backend was found. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pszFilename Name of the image file for which the backend is queried. * @param ppszFormat Receives pointer of the UTF-8 string which contains the format name. * The returned pointer must be freed using RTStrFree(). * @param penmType Where to store the type of the image. * The first opened image file in HDD container must have a base image type, * others (next opened images) must be differencing or undo images. * Linkage is checked for differencing image to be consistent with the previously opened image. * When another differencing image is opened and the last image was opened in read/write access * mode, then the last image is reopened in read-only with deny write sharing mode. This allows * other processes to use images in read-only mode too. * Note that the image is opened in read-only mode if a read/write open is not possible. * Use VDIsReadOnly to check open mode. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param pszBackend Name of the image file backend to use (case insensitive). * @param pszFilename Name of the image file to open. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsImage Pointer to the per-image VD interface list. * @return VBox status code. * @param pDisk Pointer to the HDD container which should use the cache image. * @param pszBackend Name of the cache file backend to use (case insensitive). * @param pszFilename Name of the cache image to open. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsCache Pointer to the per-cache VD interface list. * Adds a filter to the disk. * @returns VBox status code. * @param pDisk Pointer to the HDD container which should use the filter. * @param pszFilter Name of the filter backend to use (case insensitive). * @param pVDIfsFilter Pointer to the per-filter VD interface list. * Creates and opens a new base image file. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param pszBackend Name of the image file backend to use (case insensitive). * @param pszFilename Name of the image file to create. * @param cbSize Image size in bytes. * @param uImageFlags Flags specifying special image features. * @param pszComment Pointer to image comment. NULL is ok. * @param pPCHSGeometry Pointer to physical disk geometry <= (16383,16,63). Not NULL. * @param pLCHSGeometry Pointer to logical disk geometry <= (x,255,63). Not NULL. * @param pUuid New UUID of the image. If NULL, a new UUID is created. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Creates and opens a new differencing image file in HDD container. * See comments for VDOpen function about differencing images. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param pszBackend Name of the image file backend to use (case insensitive). * @param pszFilename Name of the differencing image file to create. * @param uImageFlags Flags specifying special image features. * @param pszComment Pointer to image comment. NULL is ok. * @param pUuid New UUID of the image. If NULL, a new UUID is created. * @param pParentUuid New parent UUID of the image. If NULL, the UUID is queried automatically. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Creates and opens new cache image file in HDD container. * @return VBox status code. * @param pDisk Name of the cache file backend to use (case insensitive). * @param pszFilename Name of the differencing cache file to create. * @param cbSize Maximum size of the cache. * @param uImageFlags Flags specifying special cache features. * @param pszComment Pointer to image comment. NULL is ok. * @param pUuid New UUID of the image. If NULL, a new UUID is created. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsCache Pointer to the per-cache VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Merges two images (not necessarily with direct parent/child relationship). * As a side effect the source image and potentially the other images which * are also merged to the destination are deleted from both the disk and the * images in the HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImageFrom Image number to merge from, counts from 0. 0 is always base image of container. * @param nImageTo Image number to merge to, counts from 0. 0 is always base image of container. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Copies an image from one HDD container to another - extended version. * The copy is opened in the target HDD container. * It is possible to convert between different image formats, because the * backend for the destination may be different from the source. * If both the source and destination reference the same HDD container, * then the image is moved (by copying/deleting or renaming) to the new location. * The source container is unchanged if the move operation fails, otherwise * the image at the new location is opened in the same way as the old one was. * @note The read/write accesses across disks are not synchronized, just the * accesses to each disk. Once there is a use case which requires a defined * read/write behavior in this situation this needs to be extended. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDiskFrom Pointer to source HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pDiskTo Pointer to destination HDD container. * @param pszBackend Name of the image file backend to use (may be NULL to use the same as the source, case insensitive). * @param pszFilename New name of the image (may be NULL to specify that the * copy destination is the destination container, or * if pDiskFrom == pDiskTo, i.e. when moving). * @param fMoveByRename If true, attempt to perform a move by renaming (if successful the new size is ignored). * @param cbSize New image size (0 means leave unchanged). * @param nImageSameFrom The number of the last image in the source chain having the same content as the * image in the destination chain given by nImageSameTo or * VD_IMAGE_CONTENT_UNKNOWN to indicate that the content of both containers is unknown. * See the notes for further information. * @param nImageSameTo The number of the last image in the destination chain having the same content as the * image in the source chain given by nImageSameFrom or * VD_IMAGE_CONTENT_UNKNOWN to indicate that the content of both containers is unknown. * See the notes for further information. * @param uImageFlags Flags specifying special destination image features. * @param pDstUuid New UUID of the destination image. If NULL, a new UUID is created. * This parameter is used if and only if a true copy is created. * In all rename/move cases or copy to existing image cases the modification UUIDs are copied over. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * Only used if the destination image is created. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * @param pDstVDIfsImage Pointer to the per-image VD interface list, for the * @param pDstVDIfsOperation Pointer to the per-operation VD interface list, * for the destination operation. * @note Using nImageSameFrom and nImageSameTo can lead to a significant speedup * when copying an image but can also lead to a corrupted copy if used incorrectly. * It is mainly useful when cloning a chain of images and it is known that * the virtual disk content of the two chains is exactly the same upto a certain image. * Imagine the chain of images which consist of a base and one diff image. * Copying the chain starts with the base image. When copying the first * diff image VDCopy() will read the data from the diff of the source chain * and probably from the base image again in case the diff doesn't has data * for the block. However the block will be optimized away because VDCopy() * reads data from the base image of the destination chain compares the to * and suppresses the write because the data is unchanged. * For a lot of diff images this will be a huge waste of I/O bandwidth if * the diff images contain only few changes. * Because it is known that the base image of the source and the destination chain * have the same content it is enough to check the diff image for changed data * and copy it to the destination diff image which is achieved with * nImageSameFrom and nImageSameTo. Setting both to 0 can suppress a lot of I/O. * Copies an image from one HDD container to another. * The copy is opened in the target HDD container. * It is possible to convert between different image formats, because the * backend for the destination may be different from the source. * If both the source and destination reference the same HDD container, * then the image is moved (by copying/deleting or renaming) to the new location. * The source container is unchanged if the move operation fails, otherwise * the image at the new location is opened in the same way as the old one was. * @note The read/write accesses across disks are not synchronized, just the * accesses to each disk. Once there is a use case which requires a defined * read/write behavior in this situation this needs to be extended. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDiskFrom Pointer to source HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pDiskTo Pointer to destination HDD container. * @param pszBackend Name of the image file backend to use (may be NULL to use the same as the source, case insensitive). * @param pszFilename New name of the image (may be NULL to specify that the * copy destination is the destination container, or * if pDiskFrom == pDiskTo, i.e. when moving). * @param fMoveByRename If true, attempt to perform a move by renaming (if successful the new size is ignored). * @param cbSize New image size (0 means leave unchanged). * @param uImageFlags Flags specifying special destination image features. * @param pDstUuid New UUID of the destination image. If NULL, a new UUID is created. * This parameter is used if and only if a true copy is created. * In all rename/move cases or copy to existing image cases the modification UUIDs are copied over. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * Only used if the destination image is created. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * @param pDstVDIfsImage Pointer to the per-image VD interface list, for the * @param pDstVDIfsOperation Pointer to the per-operation VD interface list, * for the destination operation. * Optimizes the storage consumption of an image. Typically the unused blocks * have to be wiped with zeroes to achieve a substantial reduced storage use. * Another optimization done is reordering the image blocks, which can provide * a significant performance boost, as reads and writes tend to use less random * @note Compaction is treated as a single operation with regard to thread * synchronization, which means that it potentially blocks other activities for * a long time. The complexity of compaction would grow even more if concurrent * accesses have to be handled. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @return VERR_VD_IMAGE_READ_ONLY if image is not writable. * @return VERR_NOT_SUPPORTED if this kind of image can be compacted, but * this isn't supported yet. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Resizes the given disk image to the given size. It is OK if there are * multiple images open in the container. In this case the last disk image * @return VERR_VD_IMAGE_READ_ONLY if image is not writable. * @return VERR_NOT_SUPPORTED if this kind of image can be compacted, but * @param pDisk Pointer to the HDD container. * @param cbSize New size of the image. * @param pPCHSGeometry Pointer to the new physical disk geometry <= (16383,16,63). Not NULL. * @param pLCHSGeometry Pointer to the new logical disk geometry <= (x,255,63). Not NULL. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Closes the last opened image file in HDD container. * If previous image file was opened in read-only mode (the normal case) and * the last opened image is in read-write mode then the previous image will be * @return VBox status code. * @return VERR_VD_NOT_OPENED if no image is opened in HDD container. * @param pDisk Pointer to HDD container. * @param fDelete If true, delete the image from the host disk. * Removes the last added filter in the HDD container. * @return VBox status code. * @retval VERR_VD_NOT_OPENED if no filter is present for the disk. * @param pDisk Pointer to HDD container. * Closes the currently opened cache image file in HDD container. * @return VBox status code. * @return VERR_VD_NOT_OPENED if no cache is opened in HDD container. * @param pDisk Pointer to HDD container. * @param fDelete If true, delete the image from the host disk. * Closes all opened image files in HDD container. * @return VBox status code. * @param pDisk Pointer to HDD container. * Removes all filters of the given HDD container. * @return VBox status code. * @param pDisk Pointer to HDD container. * Read data from virtual HDD. * @return VBox status code. * @return VERR_VD_NOT_OPENED if no image is opened in HDD container. * @param pDisk Pointer to HDD container. * @param uOffset Offset of first reading byte from start of disk. * Must be aligned to a sector boundary. * @param pvBuffer Pointer to buffer for reading data. * @param cbBuffer Number of bytes to read. * Must be aligned to a sector boundary. * Write data to virtual HDD. * @return VBox status code. * @return VERR_VD_NOT_OPENED if no image is opened in HDD container. * @param pDisk Pointer to HDD container. * @param uOffset Offset of first writing byte from start of disk. * Must be aligned to a sector boundary. * @param pvBuffer Pointer to buffer for writing data. * @param cbBuffer Number of bytes to write. * Must be aligned to a sector boundary. * Make sure the on disk representation of a virtual HDD is up to date. * @return VBox status code. * @return VERR_VD_NOT_OPENED if no image is opened in HDD container. * @param pDisk Pointer to HDD container. * Get number of opened images in HDD container. * @return Number of opened images for HDD container. 0 if no images have been opened. * @param pDisk Pointer to HDD container. * @return Virtual disk ReadOnly status. * @return true if no image is opened in HDD container. * @param pDisk Pointer to HDD container. * Get sector size of an image in HDD container. * @return Virtual disk sector size in bytes. * @return 0 if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * Get total capacity of an image in HDD container. * @return Virtual disk size in bytes. * @return 0 if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * Get total file size of an image in HDD container. * @return Virtual disk size in bytes. * @return 0 if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * Get virtual disk PCHS geometry of an image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @return VERR_VD_GEOMETRY_NOT_SET if no geometry present in the HDD container. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pPCHSGeometry Where to store PCHS geometry. Not NULL. * Store virtual disk PCHS geometry of an image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pPCHSGeometry Where to load PCHS geometry from. Not NULL. * Get virtual disk LCHS geometry of an image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @return VERR_VD_GEOMETRY_NOT_SET if no geometry present in the HDD container. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pLCHSGeometry Where to store LCHS geometry. Not NULL. * Store virtual disk LCHS geometry of an image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pLCHSGeometry Where to load LCHS geometry from. Not NULL. * Get version of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param puVersion Where to store the image version. * List the capabilities of image backend in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to the HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pbackendInfo Where to store the backend information. * Get flags of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param puImageFlags Where to store the image flags. * Get open flags of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param puOpenFlags Where to store the image open flags. * Set open flags of image in HDD container. * This operation may cause file locking changes and/or files being reopened. * Note that in case of unrecoverable error all images in HDD container will be closed. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * Get base filename of image in HDD container. Some image formats use * other filenames as well, so don't use this for anything but informational * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @return VERR_BUFFER_OVERFLOW if pszFilename buffer too small to hold filename. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pszFilename Where to store the image file name. * @param cbFilename Size of buffer pszFilename points to. * Get the comment line of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @return VERR_BUFFER_OVERFLOW if pszComment buffer too small to hold comment text. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pszComment Where to store the comment string of image. NULL is ok. * @param cbComment The size of pszComment buffer. 0 is ok. * Changes the comment line of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pszComment New comment string (UTF-8). NULL is allowed to reset the comment. * Get UUID of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pUuid Where to store the image UUID. * Set the image's UUID. Should not be used by normal applications. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pUuid New UUID of the image. If NULL, a new UUID is created. * Get last modification UUID of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pUuid Where to store the image modification UUID. * Set the image's last modification UUID. Should not be used by normal applications. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pUuid New modification UUID of the image. If NULL, a new UUID is created. * Get parent UUID of image in HDD container. * @return VBox status code. * @return VERR_VD_IMAGE_NOT_FOUND if image with specified number was not opened. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of the container. * @param pUuid Where to store the parent image UUID. * Set the image's parent UUID. Should not be used by normal applications. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param nImage Image number, counts from 0. 0 is always base image of container. * @param pUuid New parent UUID of the image. If NULL, a new UUID is created. * Debug helper - dumps all opened images in HDD container into the log file. * @param pDisk Pointer to HDD container. * Discards unused ranges given as a list. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param paRanges The array of ranges to discard. * @param cRanges Number of entries in the array. * @note In contrast to VDCompact() the ranges are always discarded even if they * appear to contain data. This method is mainly used to implement TRIM support. * Start an asynchronous read request. * @return VBox status code. * @param pDisk Pointer to the HDD container. * @param uOffset The offset of the virtual disk to read from. * @param cbRead How many bytes to read. * @param pcSgBuf Pointer to the S/G buffer to read into. * @param pfnComplete Completion callback. * @param pvUser User data which is passed on completion * Start an asynchronous write request. * @return VBox status code. * @param pDisk Pointer to the HDD container. * @param uOffset The offset of the virtual disk to write to. * @param cbWrtie How many bytes to write. * @param pcSgBuf Pointer to the S/G buffer to write from. * @param pfnComplete Completion callback. * @param pvUser User data which is passed on completion. * Start an asynchronous flush request. * @return VBox status code. * @param pDisk Pointer to the HDD container. * @param pfnComplete Completion callback. * @param pvUser User data which is passed on completion. * Start an asynchronous discard request. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param paRanges The array of ranges to discard. * @param cRanges Number of entries in the array. * @param pfnComplete Completion callback. * @param pvUser1 User data which is passed on completion. * @param pvUser2 User data which is passed on completion. * Tries to repair a corrupted image. * @return VBox status code. * @retval VERR_VD_IMAGE_REPAIR_NOT_SUPPORTED if the backend does not support repairing the image. * @retval VERR_VD_IMAGE_REPAIR_IMPOSSIBLE if the corruption is to severe to repair the image. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pszFilename Name of the image file to repair. * @param pszFormat The backend to use. * @param fFlags Combination of the VD_REPAIR_* flags. * Create a VFS file handle from the given HDD container. * @return VBox status code. * @param pDisk Pointer to HDD container. * @param fFlags Combination of the VD_VFSFILE_* flags. * @param phVfsFile Where to store the handle to the VFS file on