VirtualBox

Ignore:
Timestamp:
Aug 14, 2008 6:23:31 PM (16 years ago)
Author:
vboxsync
Message:

Storage: big cleanup of the VD interfaces, especially hide the linked list better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r11287 r11435  
    8989    /** Flag whether suspend has changed image open mode to read only. */
    9090    bool               fTempReadOnly;
     91    /** Pointer to list of VD interfaces. */
     92    PVDINTERFACE       pVDIfs;
    9193    /** Common structure for the supported error interface. */
    9294    VDINTERFACE        VDIError;
     
    535537
    536538    /* Initialize supported VD interfaces. */
     539    pThis->pVDIfs = NULL;
     540
    537541    pThis->VDIErrorCallbacks.cbSize       = sizeof(VDINTERFACEERROR);
    538542    pThis->VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR;
    539543    pThis->VDIErrorCallbacks.pfnError     = drvvdErrorCallback;
    540544
    541     rc = VDInterfaceCreate(&pThis->VDIError, "DrvVD_VDIError", VDINTERFACETYPE_ERROR,
    542                            &pThis->VDIErrorCallbacks, pDrvIns, NULL);
     545    rc = VDInterfaceAdd(&pThis->VDIError, "DrvVD_VDIError", VDINTERFACETYPE_ERROR,
     546                        &pThis->VDIErrorCallbacks, pDrvIns, &pThis->pVDIfs);
    543547    AssertRC(rc);
    544548
     
    554558    pThis->VDIAsyncIOCallbacks.pfnTasksSubmit          = drvvdAsyncIOTasksSubmit;
    555559
    556     rc = VDInterfaceCreate(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO,
    557                            &pThis->VDIAsyncIOCallbacks, pThis, &pThis->VDIError);
     560    rc = VDInterfaceAdd(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO,
     561                        &pThis->VDIAsyncIOCallbacks, pThis, &pThis->pVDIfs);
    558562    AssertRC(rc);
    559563
     
    573577     * At the moment this is harmless, as iSCSI can only be used as a base
    574578     * image, and no other backend uses the private data for these callbacks. */
    575     rc = VDInterfaceCreate(&pThis->VDIConfig, "DrvVD_Config", VDINTERFACETYPE_CONFIG,
    576                            &pThis->VDIConfigCallbacks, NULL /**< @todo TEMP */, &pThis->VDIAsyncIO);
     579    rc = VDInterfaceAdd(&pThis->VDIConfig, "DrvVD_Config", VDINTERFACETYPE_CONFIG,
     580                        &pThis->VDIConfigCallbacks, NULL /**< @todo TEMP */, &pThis->pVDIfs);
    577581    AssertRC(rc);
    578582
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