vd-image-backend.h revision c5397a397db4649847120db7615898569cc41669
* Pointer to a NULL-terminated array, 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. * Check if a file is valid for the backend. * @returns VBox status code. * @param pszFilename Name of the image file. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param penmType Returns the supported device type on success. * @returns VBox status code. * @param pszFilename Name of the image file to open. Guaranteed to be available and * unchanged during the lifetime of this image. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param enmType Requested type of the image. * @param ppBackendData Opaque state data for this image. * @returns VBox status code. * @param pszFilename Name of the image file to create. Guaranteed to be available and * unchanged during the lifetime of this image. * @param cbSize Image size in bytes. * @param uImageFlags Flags specifying special image features. * @param pszComment Pointer to image comment. NULL is ok. * @param pPCHSGeometry Physical drive geometry CHS <= (16383,16,255). * @param pLCHSGeometry Logical drive geometry CHS <= (1024,255,63). * @param pUuid New UUID of the image. Not NULL. * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. * @param uPercentStart Starting value for progress percentage. * @param uPercentSpan Span for varying progress percentage. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * @param enmType Requested type of the image. * @param ppBackendData Opaque state data for this image. * Rename a disk image. Only needs to work as long as the operating * system's rename file functionality is usable. If an attempt is made to * rename an image to a location on another disk/filesystem, this function * may just fail with an appropriate error code (not changing the opened * image data at all). Also works only on images which actually refer to * regular files. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pszFilename New name of the image file. Guaranteed to be available and * unchanged during the lifetime of this image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param fDelete If true, delete the image from the host disk. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param uOffset The offset of the virtual disk to read from. * @param cbRead How many bytes to read. * @param pIoCtx I/O context associated with this request. * @param pcbActuallyRead Pointer to returned number of bytes read. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param uOffset The offset of the virtual disk to write to. * @param cbWrite How many bytes to write. * @param pIoCtx I/O context associated with this request. * @param pcbWriteProcess Pointer to returned number of bytes that could * be processed. In case the function returned * VERR_VD_BLOCK_FREE this is the number of bytes * that could be written in a full block write, * amount of (previously read) padding data. * @param pcbPreRead Pointer to the returned amount of data that must * be prefixed to perform a full block write. * @param pcbPostRead Pointer to the returned amount of data that must * be postfixed to perform a full block write. * @param fWrite Flags which affect write behavior. Combination * of the VD_WRITE_* flags. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pIoCtx I/O context associated with this request. * Discards the given amount of bytes decreasing the size of the image if possible * @returns VBox status code. * @retval VERR_VD_DISCARD_ALIGNMENT_NOT_MET if the range doesn't meet the required alignment * @param pBackendData Opaque state data for this image. * @param pIoCtx I/O context associated with this request. * @param uOffset The offset of the first byte to discard. * @param cbDiscard How many bytes to discard. * @param pcbPreAllocated Pointer to the returned amount of bytes that must * be discarded before the range to perform a full * @param pcbPostAllocated Pointer to the returned amount of bytes that must * be discarded after the range to perform a full * @param pcbActuallyDiscarded Pointer to the returned amount of bytes which * could be actually discarded. * @param ppbmAllocationBitmap Where to store the pointer to the allocation bitmap * if VERR_VD_DISCARD_ALIGNMENT_NOT_MET is returned or NULL * if the allocation bitmap should be returned. * @param fDiscard Flags which affect discard behavior. Combination * of the VD_DISCARD_* flags. * Get the version of a disk image. * @returns version of disk image. * @param pBackendData Opaque state data for this image. * Get the sector size of a disk image. * @returns size of disk image in bytes. * @param pBackendData Opaque state data for this image. * Get the capacity of a disk image. * @returns size of disk image in bytes. * @param pBackendData Opaque state data for this image. * Get the file size of a disk image. * @returns size of disk image in bytes. * @param pBackendData Opaque state data for this image. * Get virtual disk PCHS geometry stored in a disk image. * @returns VBox status code. * @returns VERR_VD_GEOMETRY_NOT_SET if no geometry present in the image. * @param pBackendData Opaque state data for this image. * @param pPCHSGeometry Where to store the geometry. Not NULL. * Set virtual disk PCHS geometry stored in a disk image. * Only called if geometry is different than before. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pPCHSGeometry Where to load the geometry from. Not NULL. * Get virtual disk LCHS geometry stored in a disk image. * @returns VBox status code. * @returns VERR_VD_GEOMETRY_NOT_SET if no geometry present in the image. * @param pBackendData Opaque state data for this image. * @param pLCHSGeometry Where to store the geometry. Not NULL. * Set virtual disk LCHS geometry stored in a disk image. * Only called if geometry is different than before. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pLCHSGeometry Where to load the geometry from. Not NULL. * Get the image flags of a disk image. * @returns image flags of disk image. * @param pBackendData Opaque state data for this image. * Get the open flags of a disk image. * @returns open flags of disk image. * @param pBackendData Opaque state data for this image. * Set the open flags of a disk image. May cause the image to be locked * in a different mode or be reopened (which can fail). * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param uOpenFlags New open flags for this image. * Get comment of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pszComment Where to store the comment. * @param cbComment Size of the comment buffer. * Set comment of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pszComment Where to get the comment from. NULL resets comment. * The comment is silently truncated if the image format * Get UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to store the image UUID. * Set UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to get the image UUID from. * Get last modification UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to store the image modification UUID. * Set last modification UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to get the image modification UUID from. * Get parent UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to store the parent image UUID. * Set parent UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to get the parent image UUID from. * Get parent modification UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to store the parent image modification UUID. * Set parent modification UUID of a disk image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pUuid Where to get the parent image modification UUID from. * Dump information about a disk image. * @param pBackendData Opaque state data for this image. * Get a time stamp of a disk image. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pTimeStamp Where to store the time stamp. * Get the parent time stamp of a disk image. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pTimeStamp Where to store the time stamp. * Set the parent time stamp of a disk image. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pTimeStamp Where to get the time stamp from. * Get the relative path to parent image. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pszParentFilename Where to store the path. * Set the relative path to parent image. May be NULL. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param pszParentFilename Where to get the path from. /** 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. */ * Compact the image. The pointer may be NULL, indicating that this * isn't supported yet (for file-based images) or not necessary. * @returns VBox status code. * @returns VERR_NOT_SUPPORTED if this image cannot be compacted yet. * @param pBackendData Opaque state data for this image. * @param uPercentStart Starting value for progress percentage. * @param uPercentSpan Span for varying progress percentage. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Resize the image. The pointer may be NULL, indicating that this * isn't supported yet (for file-based images) or not necessary. * @returns VBox status code. * @returns VERR_NOT_SUPPORTED if this image cannot be resized yet. * @param pBackendData Opaque state data for this image. * @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 uPercentStart Starting value for progress percentage. * @param uPercentSpan Span for varying progress percentage. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. * Try to repair the given image. * @returns VBox status code. * @param pszFilename Name of the image file. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param fFlags Combination of the VD_REPAIR_* flags. * Traverse all metadata of the opened image. * @returns VBox status code. * @param pBackendData Opaque state data for this image. * @param fFlags Traverse flags, combination of VD_TRAVERSE_METDATA_* defines. * @param pVDIfsDisk Pointer to the per-disk VD interface list. * @param pVDIfsImage Pointer to the per-image VD interface list. * @param pVDIfsOperation Pointer to the per-operation VD interface list. /** Pointer to VD backend. */ /** Constant pointer to VD backend. */ /** @copydoc VBOXHDDBACKEND::pfnComposeLocation */ /** @copydoc VBOXHDDBACKEND::pfnComposeName */