VirtualBox

Changeset 11444 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Aug 15, 2008 2:33:02 PM (16 years ago)
Author:
vboxsync
Message:

Storage/VBoxHDD-new: introduced VD interfaces per image and per operation, completely unifying callback handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxHDD-new.h

    r11435 r11444  
    237237    /** First valid interface. */
    238238    VDINTERFACETYPE_FIRST = 0,
    239     /** Interface to pass error message to upper layers. */
     239    /** Interface to pass error message to upper layers. Per-disk. */
    240240    VDINTERFACETYPE_ERROR = VDINTERFACETYPE_FIRST,
    241     /** Interface for asynchronous I/O operations. */
     241    /** Interface for asynchronous I/O operations. Per-disk. */
    242242    VDINTERFACETYPE_ASYNCIO,
    243     /** Interface for progress notification. */
     243    /** Interface for progress notification. Per-operation. */
    244244    VDINTERFACETYPE_PROGRESS,
    245     /** Interface for configuration information. */
     245    /** Interface for configuration information. Per-image. */
    246246    VDINTERFACETYPE_CONFIG,
    247247    /** invalid interface. */
     
    274274/**
    275275 * Helper functions to handle interface lists.
     276 *
     277 * @note These interface lists are used consistently to pass per-disk,
     278 * per-image and/or per-operation callbacks. Those three purposes are strictly
     279 * separate. See the individual interface declarations for what context they
     280 * apply to. The caller is responsible for ensuring that the lifetime of the
     281 * interface descriptors is appropriate for the category of interface.
    276282 */
    277283
     
    349355/**
    350356 * Interface to deliver error messages to upper layers.
     357 *
     358 * Per disk interface. Optional, but think twice if you want to miss the
     359 * opportunity of reporting better human-readable error messages.
    351360 */
    352361typedef struct VDINTERFACEERROR
     
    401410 * Completion callback which is called by the interface owner
    402411 * to inform the backend that a task finished.
    403  * 
     412 *
    404413 * @return  VBox status code.
    405414 * @param   pvUser          Opaque user data which is passed on request submission.
     
    412421/**
    413422 * Support interface for asynchronous I/O
     423 *
     424 * Per-disk. Optional.
    414425 */
    415426typedef struct VDINTERFACEASYNCIO
     
    551562/**
    552563 * Progress notification interface
     564 *
     565 * Per-operation. Optional.
    553566 */
    554567typedef struct VDINTERFACEPROGRESS
     
    614627/**
    615628 * Configuration information interface
     629 *
     630 * Per-image. Optional for most backends, but mandatory for images which do
     631 * not operate on files (including standard block or character devices).
    616632 */
    617633typedef struct VDINTERFACECONFIG
     
    902918 *
    903919 * @return  VBox status code.
    904  * @param   pVDIfs          Pointer to the VD interface list.
     920 * @param   pVDIfsDisk      Pointer to the per-disk VD interface list.
    905921 * @param   ppDisk          Where to store the reference to HDD container.
    906922 */
    907 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfs, PVBOXHDD *ppDisk);
     923VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfsDisk, PVBOXHDD *ppDisk);
    908924
    909925/**
     
    943959 * @param   pszFilename     Name of the image file to open.
    944960 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
     961 * @param   pVDIfsImage     Pointer to the per-image VD interface list.
    945962 */
    946963VBOXDDU_DECL(int) VDOpen(PVBOXHDD pDisk, const char *pszBackend,
    947                          const char *pszFilename, unsigned uOpenFlags);
     964                         const char *pszFilename, unsigned uOpenFlags,
     965                         PVDINTERFACE pVDIfsImage);
    948966
    949967/**
     
    962980 * @param   pUuid           New UUID of the image. If NULL, a new UUID is created.
    963981 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    964  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    965  * @param   pvUser          User argument for the progress callback.
     982 * @param   pVDIfsImage     Pointer to the per-image VD interface list.
     983 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    966984 */
    967985VBOXDDU_DECL(int) VDCreateBase(PVBOXHDD pDisk, const char *pszBackend,
     
    972990                               PCPDMMEDIAGEOMETRY pLCHSGeometry,
    973991                               PCRTUUID pUuid, unsigned uOpenFlags,
    974                                PFNVMPROGRESS pfnProgress, void *pvUser);
     992                               PVDINTERFACE pVDIfsImage,
     993                               PVDINTERFACE pVDIfsOperation);
    975994
    976995/**
     
    9861005 * @param   pUuid           New UUID of the image. If NULL, a new UUID is created.
    9871006 * @param   uOpenFlags      Image file open mode, see VD_OPEN_FLAGS_* constants.
    988  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    989  * @param   pvUser          User argument for the progress callback.
     1007 * @param   pVDIfsImage     Pointer to the per-image VD interface list.
     1008 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    9901009 */
    9911010VBOXDDU_DECL(int) VDCreateDiff(PVBOXHDD pDisk, const char *pszBackend,
    9921011                               const char *pszFilename, unsigned uImageFlags,
    9931012                               const char *pszComment, PCRTUUID pUuid,
    994                                unsigned uOpenFlags, PFNVMPROGRESS pfnProgress,
    995                                void *pvUser);
     1013                               unsigned uOpenFlags, PVDINTERFACE pVDIfsImage,
     1014                               PVDINTERFACE pVDIfsOperation);
    9961015
    9971016/**
     
    10061025 * @param   nImageFrom      Name of the image file to merge from.
    10071026 * @param   nImageTo        Name of the image file to merge to.
    1008  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    1009  * @param   pvUser          User argument for the progress callback.
     1027 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
    10101028 */
    10111029VBOXDDU_DECL(int) VDMerge(PVBOXHDD pDisk, unsigned nImageFrom,
    1012                           unsigned nImageTo, PFNVMPROGRESS pfnProgress,
    1013                           void *pvUser);
     1030                          unsigned nImageTo, PVDINTERFACE pVDIfsOperation);
    10141031
    10151032/**
     
    10321049 * @param   fMoveByRename   If true, attempt to perform a move by renaming (if successful the new size is ignored).
    10331050 * @param   cbSize          New image size (0 means leave unchanged).
    1034  * @param   pfnProgress     Progress callback. Optional. NULL if not to be used.
    1035  * @param   pvUser          User argument for the progress callback.
     1051 * @param   pVDIfsOperation Pointer to the per-operation VD interface list.
     1052 * @param   pDstVDIfsImage  Pointer to the per-image VD interface list, for the
     1053 *                          destination image.
     1054 * @param   pDstVDIfsOperation Pointer to the per-operation VD interface list,
     1055 *                          for the destination operation.
    10361056 */
    10371057VBOXDDU_DECL(int) VDCopy(PVBOXHDD pDiskFrom, unsigned nImage, PVBOXHDD pDiskTo,
    10381058                         const char *pszBackend, const char *pszFilename,
    10391059                         bool fMoveByRename, uint64_t cbSize,
    1040                          PFNVMPROGRESS pfnProgress, void *pvUser);
     1060                         PVDINTERFACE pVDIfsOperation,
     1061                         PVDINTERFACE pDstVDIfsImage,
     1062                         PVDINTERFACE pDstVDIfsOperation);
    10411063
    10421064/**
Note: See TracChangeset for help on using the changeset viewer.

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