VBoxHDD.h revision 617fbf5ba046109c0555dbafd6e9de76f76ba026
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * VBox HDD Container API.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Copyright (C) 2006-2010 Oracle Corporation
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * available from http://www.virtualbox.org. This file is free software;
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * you can redistribute it and/or modify it under the terms of the GNU
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * General Public License (GPL) as published by the Free Software
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The contents of this file may alternatively be used under the terms
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * of the Common Development and Distribution License Version 1.0
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * VirtualBox OSE distribution, in which case the provisions of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * CDDL are applicable instead of those of the GPL.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * You may elect to license modified versions of this file under the
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * terms and conditions of either the GPL or the CDDL or both.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync# error "There are no VBox HDD Container APIs available in Ring-0 Host Context!"
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** @defgroup grp_vd VBox HDD Container
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Current VMDK image version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Current VDI image major version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Current VDI image minor version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Current VDI image version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VDI_IMAGE_VERSION ((VDI_IMAGE_VERSION_MAJOR << 16) | VDI_IMAGE_VERSION_MINOR)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Get VDI major version from combined version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Get VDI minor version from combined version. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VDI_GET_VERSION_MINOR(uVer) ((uVer) & 0xffff)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Placeholder for specifying the last opened image. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @name VBox HDD container image flags
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** No flags. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Fixed image. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Diff image. Mutually exclusive with fixed image. */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** VMDK: Split image into 2GB extents. */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** VMDK: Raw disk image (giving access to a number of host partitions). */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** VMDK: stream optimized image, read only. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED (0x0004)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** VMDK: ESX variant, use in addition to other flags. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** VDI: Fill new blocks with zeroes while expanding image file. Only valid
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * for newly created images, never set for opened existing images. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Mask of valid image flags for VMDK. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VD_VMDK_IMAGE_FLAGS_MASK ( VD_IMAGE_FLAGS_FIXED | VD_IMAGE_FLAGS_DIFF | VD_IMAGE_FLAGS_NONE \
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync | VD_VMDK_IMAGE_FLAGS_SPLIT_2G | VD_VMDK_IMAGE_FLAGS_RAWDISK \
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync | VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED | VD_VMDK_IMAGE_FLAGS_ESX)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Mask of valid image flags for VDI. */
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync#define VD_VDI_IMAGE_FLAGS_MASK (VD_IMAGE_FLAGS_FIXED | VD_IMAGE_FLAGS_DIFF | VD_IMAGE_FLAGS_NONE | VD_VDI_IMAGE_FLAGS_ZERO_EXPAND)
0c4004948fca34f2db87e7b38013137e9472c306vboxsync/** Mask of all valid image flags for all formats. */
0c4004948fca34f2db87e7b38013137e9472c306vboxsync#define VD_IMAGE_FLAGS_MASK (VD_VMDK_IMAGE_FLAGS_MASK | VD_VDI_IMAGE_FLAGS_MASK)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Default image flags. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VD_IMAGE_FLAGS_DEFAULT (VD_IMAGE_FLAGS_NONE)
4569bf0ad094b40d2e177299a00d37e94d28616cvboxsync * Auxiliary type for describing partitions on raw disks. The entries must be
4569bf0ad094b40d2e177299a00d37e94d28616cvboxsync * in ascending order (as far as uStart is concerned), and must not overlap.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Note that this does not correspond 1:1 to partitions, it is describing the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * general meaning of contiguous areas on the disk.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Device to use for this partition/data area. Can be the disk device if
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * the offset field is set appropriately. If this is NULL, then this
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * partition will not be accessible to the guest. The size of the data area
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * must still be set correctly. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Pointer to the partitioning info. NULL means this is a regular data
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync * area on disk, non-NULL denotes data which should be copied to the
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync * partition data overlay. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Offset where the data starts in this device. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Offset where the data starts in the disk. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Size of the data area. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Auxiliary data structure for creating raw disks.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsynctypedef struct VBOXHDDRAW
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Signature for structure. Must be 'R', 'A', 'W', '\\0'. Actually a trick
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * to make logging of the comment string produce sensible results. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Flag whether access to full disk should be given (ignoring the
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * partition information below). */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Filename for the raw disk. Ignored for partitioned raw disks.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * For Linux e.g. /dev/sda, and for Windows e.g. \\\\.\\PhysicalDisk0. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Number of entries in the partition descriptor array. */
a9f41cb889f53e8407561a6155052c441eb0fc5fvboxsync /** Pointer to the partition descriptor array. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @name VBox HDD container image open mode flags
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Try to open image in read/write exclusive access mode if possible, or in read-only elsewhere. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Open image in read-only mode with sharing access with others. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Honor zero block writes instead of ignoring them whenever possible.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is not supported by all formats. It is silently ignored in this case. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Honor writes of the same data instead of ignoring whenever possible.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * This is handled generically, and is only meaningful for differential image
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * formats. It is silently ignored otherwise. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Do not perform the base/diff image check on open. This does NOT imply
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * opening the image as readonly (would break e.g. adding UUIDs to VMDK files
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * created by other products). Images opened with this flag should only be
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * used for querying information, and nothing else. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Open image for asynchronous access.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Only available if VD_CAP_ASYNC_IO is set
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Check with VDIsAsynchonousIoSupported wether
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * asynchronous I/O is really supported for this file. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Allow sharing of the image for writable images. May be ignored if the
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * format backend doesn't support this type of concurrent access. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Mask of valid flags. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync#define VD_OPEN_FLAGS_MASK (VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_HONOR_ZEROES | VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_ASYNC_IO | VD_OPEN_FLAGS_SHAREABLE)
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** @name VBox HDD container backend capability flags
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Supports UUIDs as expected by VirtualBox code. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Supports creating fixed size images, allocating all space instantly. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Supports creating dynamically growing images, allocating space on demand. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Supports creating images split in chunks of a bit less than 2GBytes. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** Supports being used as differencing image format backend. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync/** Supports asynchronous I/O operations for at least some configurations. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync/** The backend operates on files. The caller needs to know to handle the
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync * location appropriately. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** The backend uses the config interface. The caller needs to know how to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * provide the mandatory configuration parts this way. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync/** The backend uses the network stack interface. The caller has to provide
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * the appropriate interface. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Supported interface types.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** First valid interface. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Interface to pass error message to upper layers. Per-disk. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Interface for asynchronous I/O operations. Per-disk. */
0dd6dfbebcda0af90da4413aaea5f3b9d1817556vboxsync /** Interface for progress notification. Per-operation. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Interface for configuration information. Per-image. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /** Interface for TCP network stack. Per-disk. */
ead016c68c61b5f2e1fe4d237054eebea9327d4bvboxsync /** Interface for getting parent image state. Per-operation. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Interface for synchronizing accesses from several threads. Per-disk. */
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync /** Interface for I/O between the generic VBoxHDD code and the backend. Per-image. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync /** invalid interface. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync * Common structure for all interfaces.
64f58e4154eaa20c47782b429eeaff09070369bfvboxsynctypedef struct VDINTERFACE
64f58e4154eaa20c47782b429eeaff09070369bfvboxsync /** Human readable interface name. */
64f58e4154eaa20c47782b429eeaff09070369bfvboxsync /** The size of the struct. */
64f58e4154eaa20c47782b429eeaff09070369bfvboxsync /** Pointer to the next common interface structure. */
64f58e4154eaa20c47782b429eeaff09070369bfvboxsync /** Interface type. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync /** Opaque user data which is passed on every call. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync /** Pointer to the function call table of the interface.
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync * As this is opaque this must be casted to the right interface
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync * struct defined below based on the interface type in enmInterface. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync/** Pointer to a VDINTERFACE. */
7ccfefe49db4cd93c3701d7b60873ebf404b5b87vboxsync/** Pointer to a const VDINTERFACE. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Helper functions to handle interface lists.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @note These interface lists are used consistently to pass per-disk,
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * per-image and/or per-operation callbacks. Those three purposes are strictly
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * separate. See the individual interface declarations for what context they
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * apply to. The caller is responsible for ensuring that the lifetime of the
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * interface descriptors is appropriate for the category of interface.
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsync * Get a specific interface from a list of interfaces specified by the type.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return Pointer to the matching interface or NULL if none was found.
0dd6dfbebcda0af90da4413aaea5f3b9d1817556vboxsync * @param pVDIfs Pointer to the VD interface list.
0dd6dfbebcda0af90da4413aaea5f3b9d1817556vboxsync * @param enmInterface Interface to search for.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncDECLINLINE(PVDINTERFACE) VDInterfaceGet(PVDINTERFACE pVDIfs, VDINTERFACETYPE enmInterface)
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync AssertMsgReturn( enmInterface >= VDINTERFACETYPE_FIRST
4569bf0ad094b40d2e177299a00d37e94d28616cvboxsync /* Sanity checks. */
4569bf0ad094b40d2e177299a00d37e94d28616cvboxsync AssertMsgBreak(pVDIfs->cbSize == sizeof(VDINTERFACE),
a9f41cb889f53e8407561a6155052c441eb0fc5fvboxsync /* No matching interface was found. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Add an interface to a list of interfaces.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return VBox status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pInterface Pointer to an unitialized common interface structure.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pszName Name of the interface.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param enmInterface Type of the interface.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pCallbacks The callback table of the interface.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pvUser Opaque user data passed on every function call.
a9f41cb889f53e8407561a6155052c441eb0fc5fvboxsync * @param ppVDIfs Pointer to the VD interface list.
0dd6dfbebcda0af90da4413aaea5f3b9d1817556vboxsyncDECLINLINE(int) VDInterfaceAdd(PVDINTERFACE pInterface, const char *pszName,
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync /* Argument checks. */
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync AssertMsgReturn( enmInterface >= VDINTERFACETYPE_FIRST
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync ("enmInterface=%u", enmInterface), VERR_INVALID_PARAMETER);
4569bf0ad094b40d2e177299a00d37e94d28616cvboxsync /* Fill out interface descriptor. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Remember the new start of the list. */
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsync * Removes an interface from a list of interfaces.
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsync * @return VBox status code
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsync * @param pInterface Pointer to an initialized common interface structure to remove.
96a7e06717e2d7398642eadb5ebab1bf13fbe2dbvboxsync * @param ppVDIfs Pointer to the VD interface list to remove from.
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsyncDECLINLINE(int) VDInterfaceRemove(PVDINTERFACE pInterface, PVDINTERFACE *ppVDIfs)
fc78e01f665145ab3641c5f8095e9ae984ddcb84vboxsync /* Argument checks. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* First interface */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Interface to deliver error messages (and also informational messages)
d7125f3a1b435761c393f9ec406e85a73ae2a3e7vboxsync * to upper layers.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * Per disk interface. Optional, but think twice if you want to miss the
d7125f3a1b435761c393f9ec406e85a73ae2a3e7vboxsync * opportunity of reporting better human-readable error messages.
d7125f3a1b435761c393f9ec406e85a73ae2a3e7vboxsync * Size of the error interface.
d7125f3a1b435761c393f9ec406e85a73ae2a3e7vboxsync * Interface type.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Error message callback. Must be able to accept special IPRT format
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque data passed on container creation.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param rc The VBox error code.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param RT_SRC_POS_DECL Use RT_SRC_POS.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszFormat Error message format string.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param va Error message arguments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync DECLR3CALLBACKMEMBER(void, pfnError, (void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Informational message callback. May be NULL. Used e.g. in
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * VDDumpImages(). Must be able to accept special IPRT format strings.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return VBox status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque data passed on container creation.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszFormat Error message format string.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ... Error message arguments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync DECLR3CALLBACKMEMBER(int, pfnMessage, (void *pvUser, const char *pszFormat, ...));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Get error interface from opaque callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return Pointer to the callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pInterface Pointer to the interface descriptor.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncDECLINLINE(PVDINTERFACEERROR) VDGetInterfaceError(PVDINTERFACE pInterface)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Check that the interface descriptor is a error interface. */
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync AssertMsgReturn( pInterface->enmInterface == VDINTERFACETYPE_ERROR
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync pInterfaceError = (PVDINTERFACEERROR)pInterface->pCallbacks;
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync /* Do basic checks. */
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync AssertMsgReturn( pInterfaceError->cbSize == sizeof(VDINTERFACEERROR)
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync && pInterfaceError->enmInterface == VDINTERFACETYPE_ERROR,
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync ("A non error callback table attached to a error interface descriptor\n"), NULL);
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * Completion callback which is called by the interface owner
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * to inform the backend that a task finished.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @return VBox status code.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param pvUser Opaque user data which is passed on request submission.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param rcReq Status code of the completed request.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsynctypedef DECLCALLBACK(int) FNVDCOMPLETED(void *pvUser, int rcReq);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to FNVDCOMPLETED() */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Open the storage readonly. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define VD_INTERFACEASYNCIO_OPEN_FLAGS_READONLY RT_BIT(0)
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync/** Create the storage backend if it doesn't exist. */
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync#define VD_INTERFACEASYNCIO_OPEN_FLAGS_CREATE RT_BIT(1)
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync/** Don't write lock the opened file. */
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync#define VD_INTERFACEASYNCIO_OPEN_FLAGS_DONT_LOCK RT_BIT(2)
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * Support interface for asynchronous I/O
d7125f3a1b435761c393f9ec406e85a73ae2a3e7vboxsync * Per-disk. Optional.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * Size of the async interface.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Interface type.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * Open callback
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @return VBox status code.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param pvUser The opaque data passed on container creation.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param pszLocation Name of the location to open.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param uOpenFlags Flags for opening the backend.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * See VD_INTERFACEASYNCIO_OPEN_FLAGS_* #defines
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param pfnCompleted The callback which is called whenever a task
b0db50948c349fa76655abf252f7946b515e8204vboxsync * completed. The backend has to pass the user data
b0db50948c349fa76655abf252f7946b515e8204vboxsync * of the request initiator (ie the one who calls
b0db50948c349fa76655abf252f7946b515e8204vboxsync * VDAsyncRead or VDAsyncWrite) in pvCompletion
b0db50948c349fa76655abf252f7946b515e8204vboxsync * if this is NULL.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param pVDIfsDisk Pointer to the per-disk VD interface list.
b0db50948c349fa76655abf252f7946b515e8204vboxsync * @param ppStorage Where to store the opaque storage handle.
b0db50948c349fa76655abf252f7946b515e8204vboxsync DECLR3CALLBACKMEMBER(int, pfnOpen, (void *pvUser, const char *pszLocation,
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Close callback.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return VBox status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque data passed on container creation.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pStorage The opaque storage handle to close.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync DECLR3CALLBACKMEMBER(int, pfnClose, (void *pvUser, void *pStorage));
b0db50948c349fa76655abf252f7946b515e8204vboxsync * Returns the size of the opened storage backend.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return VBox status code.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pvUser The opaque data passed on container creation.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pStorage The opaque storage handle to close.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pcbSize Where to store the size of the storage backend.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync DECLR3CALLBACKMEMBER(int, pfnGetSize, (void *pvUser, void *pStorage, uint64_t *pcbSize));
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Sets the size of the opened storage backend if possible.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return VBox status code.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @retval VERR_NOT_SUPPORTED if the backend does not support this operation.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque data passed on container creation.
faee255cc48bfbf17cb9f72fca70c8b9d3020ec4vboxsync * @param pStorage The opaque storage handle to close.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param cbSize The new size of the image.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync DECLR3CALLBACKMEMBER(int, pfnSetSize, (void *pvUser, void *pStorage, uint64_t cbSize));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Synchronous write callback.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @return VBox status code.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @param pvUser The opaque data passed on container creation.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @param pStorage The storage handle to use.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @param uOffset The offset to start from.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param cbWrite How many bytes to write.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvBuf Pointer to the bits need to be written.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @param pcbWritten Where to store how many bytes where actually written.
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync DECLR3CALLBACKMEMBER(int, pfnWriteSync, (void *pvUser, void *pStorage, uint64_t uOffset,
0db6a029780d9f9b347500e117320a8d5661efe5vboxsync size_t cbWrite, const void *pvBuf, size_t *pcbWritten));
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * Synchronous read callback.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return VBox status code.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param pvUser The opaque data passed on container creation.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param pStorage The storage handle to use.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param uOffset The offset to start from.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param cbRead How many bytes to read.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param pvBuf Where to store the read bits.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * @param pcbRead Where to store how many bytes where actually read.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync DECLR3CALLBACKMEMBER(int, pfnReadSync, (void *pvUser, void *pStorage, uint64_t uOffset,
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync * Flush data to the storage backend.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @return VBox statis code.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param pvUser The opaque data passed on container creation.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param pStorage The storage handle to flush.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync DECLR3CALLBACKMEMBER(int, pfnFlushSync, (void *pvUser, void *pStorage));
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * Initiate a asynchronous read request.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @return VBox status code.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param pvUser The opqaue user data passed on container creation.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pStorage The storage handle.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param uOffset The offset to start reading from.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param paSegments Scatter gather list to store the data in.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param cSegments Number of segments in the list.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param cbRead How many bytes to read.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pvCompletion The opaque user data which is returned upon completion.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param ppTask Where to store the opaque task handle.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync DECLR3CALLBACKMEMBER(int, pfnReadAsync, (void *pvUser, void *pStorage, uint64_t uOffset,
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * Initiate a asynchronous write request.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @return VBox status code.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pvUser The opaque user data passed on conatiner creation.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pStorage The storage handle.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param uOffset The offset to start writing to.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param paSegments Scatter gather list of the data to write
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param cSegments Number of segments in the list.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param cbWrite How many bytes to write.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pvCompletion The opaque user data which is returned upon completion.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param ppTask Where to store the opaque task handle.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync DECLR3CALLBACKMEMBER(int, pfnWriteAsync, (void *pvUser, void *pStorage, uint64_t uOffset,
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * Initiates a async flush request.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @return VBox statis code.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param pvUser The opaque data passed on container creation.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param pStorage The storage handle to flush.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param pvCompletion The opaque user data which is returned upon completion.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsync * @param ppTask Where to store the opaque task handle.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync DECLR3CALLBACKMEMBER(int, pfnFlushAsync, (void *pvUser, void *pStorage,
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * Get async I/O interface from opaque callback table.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @return Pointer to the callback table.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * @param pInterface Pointer to the interface descriptor.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsyncDECLINLINE(PVDINTERFACEASYNCIO) VDGetInterfaceAsyncIO(PVDINTERFACE pInterface)
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync /* Check that the interface descriptor is a async I/O interface. */
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_ASYNCIO)
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync pInterfaceAsyncIO = (PVDINTERFACEASYNCIO)pInterface->pCallbacks;
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync /* Do basic checks. */
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync AssertMsgReturn( (pInterfaceAsyncIO->cbSize == sizeof(VDINTERFACEASYNCIO))
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync && (pInterfaceAsyncIO->enmInterface == VDINTERFACETYPE_ASYNCIO),
0c4004948fca34f2db87e7b38013137e9472c306vboxsync ("A non async I/O callback table attached to a async I/O interface descriptor\n"), NULL);
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync * Callback which provides progress information about a currently running
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * lengthy operation.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @return VBox status code.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param pvUser The opaque user data associated with this interface.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * @param uPercent Completion percentage.
0c4004948fca34f2db87e7b38013137e9472c306vboxsynctypedef DECLCALLBACK(int) FNVDPROGRESS(void *pvUser, unsigned uPercentage);
0c4004948fca34f2db87e7b38013137e9472c306vboxsync/** Pointer to FNVDPROGRESS() */
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync * Progress notification interface
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * Per-operation. Optional.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * Size of the progress interface.
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync * Interface type.
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync * Progress notification callbacks.
0c4004948fca34f2db87e7b38013137e9472c306vboxsync * Get progress interface from opaque callback table.
8f0fc87a72dee210b62acc9dd859a4bebf8bfb33vboxsync * @return Pointer to the callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pInterface Pointer to the interface descriptor.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncDECLINLINE(PVDINTERFACEPROGRESS) VDGetInterfaceProgress(PVDINTERFACE pInterface)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Check that the interface descriptor is a progress interface. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_PROGRESS)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync pInterfaceProgress = (PVDINTERFACEPROGRESS)pInterface->pCallbacks;
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Do basic checks. */
8cd2f2e64725096acb682f34a5568b7fb816eda7vboxsync AssertMsgReturn( (pInterfaceProgress->cbSize == sizeof(VDINTERFACEPROGRESS))
8cd2f2e64725096acb682f34a5568b7fb816eda7vboxsync && (pInterfaceProgress->enmInterface == VDINTERFACETYPE_PROGRESS),
8cd2f2e64725096acb682f34a5568b7fb816eda7vboxsync ("A non progress callback table attached to a progress interface descriptor\n"), NULL);
26947320577c481b4afefdb0afbb855181e5b2e8vboxsync * Configuration information interface
26947320577c481b4afefdb0afbb855181e5b2e8vboxsync * Per-image. Optional for most backends, but mandatory for images which do
26947320577c481b4afefdb0afbb855181e5b2e8vboxsync * not operate on files (including standard block or character devices).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Size of the configuration interface.
cba6719bd64ec749967bbe931230452664109857vboxsync * Interface type.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Validates that the keys are within a set of valid names.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @return true if all key names are found in pszzAllowed.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return false if not.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque user data associated with this interface.
a8139954a84d6e9090dd3a8371aa788351d45bc3vboxsync * @param pszzValid List of valid key names separated by '\\0' and ending with
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * a double '\\0'.
a8139954a84d6e9090dd3a8371aa788351d45bc3vboxsync DECLR3CALLBACKMEMBER(bool, pfnAreKeysValid, (void *pvUser, const char *pszzValid));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Retrieves the length of the string value associated with a key (including
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * the terminator, for compatibility with CFGMR3QuerySize).
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return VBox status code.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * VERR_CFGM_VALUE_NOT_FOUND means that the key is not known.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pvUser The opaque user data associated with this interface.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pszName Name of the key to query.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pcbValue Where to store the value length. Non-NULL.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync DECLR3CALLBACKMEMBER(int, pfnQuerySize, (void *pvUser, const char *pszName, size_t *pcbValue));
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * Query the string value associated with a key.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @return VBox status code.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * VERR_CFGM_VALUE_NOT_FOUND means that the key is not known.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * VERR_CFGM_NOT_ENOUGH_SPACE means that the buffer is not big enough.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pvUser The opaque user data associated with this interface.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pszName Name of the key to query.
4c42ef40805493bd6d76103b90f71bcd6dbc0f00vboxsync * @param pszValue Pointer to buffer where to store value.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param cchValue Length of value buffer.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync DECLR3CALLBACKMEMBER(int, pfnQuery, (void *pvUser, const char *pszName, char *pszValue, size_t cchValue));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Get configuration information interface from opaque callback table.
da3503c04ce76e653401396fe2795a9bc2427a1dvboxsync * @return Pointer to the callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pInterface Pointer to the interface descriptor.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncDECLINLINE(PVDINTERFACECONFIG) VDGetInterfaceConfig(PVDINTERFACE pInterface)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Check that the interface descriptor is a config interface. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_CONFIG)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync pInterfaceConfig = (PVDINTERFACECONFIG)pInterface->pCallbacks;
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /* Do basic checks. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync AssertMsgReturn( (pInterfaceConfig->cbSize == sizeof(VDINTERFACECONFIG))
da3503c04ce76e653401396fe2795a9bc2427a1dvboxsync && (pInterfaceConfig->enmInterface == VDINTERFACETYPE_CONFIG),
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync ("A non config callback table attached to a config interface descriptor\n"), NULL);
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * Query configuration, validates that the keys are within a set of valid names.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return true if all key names are found in pszzAllowed.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @return false if not.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pCfgIf Pointer to configuration callback table.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pvUser The opaque user data associated with this interface.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * @param pszzValid List of valid names separated by '\\0' and ending with
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsync * a double '\\0'.
ea779b55cc87f3e3fadddca4672c6697c82606edvboxsyncDECLINLINE(bool) VDCFGAreKeysValid(PVDINTERFACECONFIG pCfgIf, void *pvUser,
9b789c281103a2489742bf32f6ab500e38b2ecd5vboxsync * Query configuration, unsigned 64-bit integer value with default.
c91345f92b829d3fba05ce7a97206d83c5183ce0vboxsync * @return VBox status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pCfgIf Pointer to configuration callback table.
c91345f92b829d3fba05ce7a97206d83c5183ce0vboxsync * @param pvUser The opaque user data associated with this interface.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName Name of an integer value
44a2ecaf2d0fc196ab76cab13b3f909299e386d1vboxsync * @param pu64 Where to store the value. Set to default on failure.
44a2ecaf2d0fc196ab76cab13b3f909299e386d1vboxsync * @param u64Def The default value.
44a2ecaf2d0fc196ab76cab13b3f909299e386d1vboxsyncDECLINLINE(int) VDCFGQueryU64Def(PVDINTERFACECONFIG pCfgIf, void *pvUser,
71f6a34b72f9cc873da208630959de49df1a28a5vboxsync int rc = pCfgIf->pfnQuery(pvUser, pszName, aszBuf, sizeof(aszBuf));
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query configuration, unsigned 32-bit integer value with default.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return VBox status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pCfgIf Pointer to configuration callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque user data associated with this interface.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName Name of an integer value
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pu32 Where to store the value. Set to default on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param u32Def The default value.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncDECLINLINE(int) VDCFGQueryU32Def(PVDINTERFACECONFIG pCfgIf, void *pvUser,
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync int rc = VDCFGQueryU64Def(pCfgIf, pvUser, pszName, &u64, u32Def);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query configuration, bool value with default.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * @return VBox status code.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * @param pCfgIf Pointer to configuration callback table.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pvUser The opaque user data associated with this interface.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName Name of an integer value
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pf Where to store the value. Set to default on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fDef The default value.
d4e9ccea0ea1ed303b5708ff94f6c202755f0dc6vboxsyncDECLINLINE(int) VDCFGQueryBoolDef(PVDINTERFACECONFIG pCfgIf, void *pvUser,
cba6719bd64ec749967bbe931230452664109857vboxsync int rc = VDCFGQueryU64Def(pCfgIf, pvUser, pszName, &u64, fDef);
cba6719bd64ec749967bbe931230452664109857vboxsync * Query configuration, dynamically allocated (RTMemAlloc) zero terminated
cba6719bd64ec749967bbe931230452664109857vboxsync * character value.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @return VBox status code.
44a2ecaf2d0fc196ab76cab13b3f909299e386d1vboxsync * @param pCfgIf Pointer to configuration callback table.
char **ppszString)
if (pszString)
return rc;
char **ppszString,
const char *pszDef)
if (pszString)
return rc;
char *pbData;
if (pbData)
return rc;
typedef struct VDINTERFACETCPNET
DECLR3CALLBACKMEMBER(int, pfnClientConnect, (VDSOCKET Sock, const char *pszAddress, uint32_t uPort));
DECLR3CALLBACKMEMBER(int, pfnRead, (VDSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead));
DECLR3CALLBACKMEMBER(int, pfnReadNB, (VDSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead));
DECLR3CALLBACKMEMBER(int, pfnWriteNB, (VDSOCKET Sock, const void *pvBuffer, size_t cbBuffer, size_t *pcbWritten));
("A non TCP network stack callback table attached to a TCP network stack interface descriptor\n"), NULL);
return pInterfaceTcpNet;
typedef struct VDINTERFACEPARENTSTATE
DECLR3CALLBACKMEMBER(int, pfnParentRead, (void *pvUser, uint64_t uOffset, void *pvBuf, size_t cbRead));
return pInterfaceParentState;
typedef struct VDINTERFACETHREADSYNC
("A non thread synchronization callback table attached to a thread synchronization interface descriptor\n"), NULL);
return pInterfaceThreadSync;
typedef enum VDCFGVALUETYPE
typedef struct VDCONFIGINFO
const char *pszKey;
const char *pszDefaultValue;
} VDCONFIGINFO;
typedef struct VDBACKENDINFO
const char *pszBackend;
const char * const *papszFileExtensions;
typedef DECLCALLBACK(int) FNVDXFERCOMPLETED(void *pvBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq);
typedef struct VDINTERFACEIO
* @param pIoCtx I/O context passed in VDAsyncRead/Write.
* @param pIoCtx I/O context passed in VDAsyncRead/Write
void *pvCompleteUser));
void *pvCompleteUser));
void *pvCompleteUser));
void *pvCompleteUser));
return pInterfaceIO;
struct VBOXHDD;
unsigned *pcEntriesUsed);
* @param pszBackend Name of the image file backend to use (may be NULL to use the same as the source, case insensitive).
* @param fMoveByRename If true, attempt to perform a move by renaming (if successful the new size is ignored).
unsigned *puVersion);
unsigned *puOpenFlags);
unsigned uOpenFlags);
const char *pszComment);