VirtualBox

Changeset 34433 in vbox


Ignore:
Timestamp:
Nov 27, 2010 11:09:38 AM (14 years ago)
Author:
vboxsync
Message:

Storage: Introduce interface to query the location of a medium (device + instance + LUN) in a VM to generate IDs which are constant for saved states

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmifs.h

    r34126 r34433  
    838838
    839839
     840/** Pointer to a block port interface. */
     841typedef struct PDMIBLOCKPORT *PPDMIBLOCKPORT;
    840842/**
    841843 * Block notify interface (down).
    842844 * Pair with PDMIBLOCK.
    843845 */
    844 typedef PDMIDUMMY PDMIBLOCKPORT;
     846typedef struct PDMIBLOCKPORT
     847{
     848    /**
     849     * Returns the storage controller name, instance and LUN of the attached medium.
     850     *
     851     * @returns VBox status.
     852     * @param   pInterface      Pointer to this interface.
     853     * @param   ppcszController Where to store the name of the storage controller.
     854     * @param   piInstance      Where to store the instance number of the controller.
     855     * @param   piLUN           Where to store the LUN of the attached device.
     856     */
     857    DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIBLOCKPORT pInterface, const char **ppcszController,
     858                                                       uint32_t *piInstance, uint32_t *piLUN));
     859
     860} PDMIBLOCKPORT;
    845861/** PDMIBLOCKPORT interface ID. */
    846 #define PDMIBLOCKPORT_IID                 "e87fa1ab-92d5-4100-8712-fe2a0c042faf"
    847 /** Pointer to a block notify interface (dummy). */
    848 typedef PDMIBLOCKPORT *PPDMIBLOCKPORT;
     862#define PDMIBLOCKPORT_IID                 "bbbed4cf-0862-4ffd-b60c-f7a65ef8e8ff"
    849863
    850864
     
    11301144/** Pointer to constant media geometry structure. */
    11311145typedef const PDMMEDIAGEOMETRY *PCPDMMEDIAGEOMETRY;
     1146
     1147/** Pointer to a media port interface. */
     1148typedef struct PDMIMEDIAPORT *PPDMIMEDIAPORT;
     1149/**
     1150 * Media port interface (down).
     1151 */
     1152typedef struct PDMIMEDIAPORT
     1153{
     1154    /**
     1155     * Returns the storage controller name, instance and LUN of the attached medium.
     1156     *
     1157     * @returns VBox status.
     1158     * @param   pInterface      Pointer to this interface.
     1159     * @param   ppcszController Where to store the name of the storage controller.
     1160     * @param   piInstance      Where to store the instance number of the controller.
     1161     * @param   piLUN           Where to store the LUN of the attached device.
     1162     */
     1163    DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMIMEDIAPORT pInterface, const char **ppcszController,
     1164                                                       uint32_t *piInstance, uint32_t *piLUN));
     1165
     1166} PDMIMEDIAPORT;
     1167/** PDMIMEDIAPORT interface ID. */
     1168#define PDMIMEDIAPORT_IID                           "9f7e8c9e-6d35-4453-bbef-1f78033174d6"
    11321169
    11331170/** Pointer to a media interface. */
     
    26862723                                                         int rcCompletion, bool fRedo, int rcReq));
    26872724
     2725    /**
     2726     * Returns the storage controller name, instance and LUN of the attached medium.
     2727     *
     2728     * @returns VBox status.
     2729     * @param   pInterface      Pointer to this interface.
     2730     * @param   ppcszController Where to store the name of the storage controller.
     2731     * @param   piInstance      Where to store the instance number of the controller.
     2732     * @param   piLUN           Where to store the LUN of the attached device.
     2733     */
     2734    DECLR3CALLBACKMEMBER(int, pfnQueryDeviceLocation, (PPDMISCSIPORT pInterface, const char **ppcszController,
     2735                                                       uint32_t *piInstance, uint32_t *piLUN));
     2736
    26882737} PDMISCSIPORT;
    26892738/** PDMISCSIPORT interface ID. */
    2690 #define PDMISCSIPORT_IID                        "9d185b3b-1051-41f6-83ad-2a2a23f04e40"
     2739#define PDMISCSIPORT_IID                        "05d9fc3b-e38c-4b30-8344-a323feebcfe5"
    26912740
    26922741
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r34142 r34433  
    890890#define PDMIMOUNTNOTIFY_2_PAHCIPORT(pInterface)  ( (PAHCIPort)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCIPort, IMountNotify)) )
    891891#define PDMIBASE_2_PAHCIPORT(pInterface)         ( (PAHCIPort)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCIPort, IBase)) )
     892#define PDMIBLOCKPORT_2_PAHCIPORT(pInterface)    ( (PAHCIPort)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCIPort, IPort)) )
    892893#define PDMIBASE_2_PAHCI(pInterface)             ( (PAHCI)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCI, IBase)) )
    893894#define PDMILEDPORTS_2_PAHCI(pInterface)         ( (PAHCI)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCI, ILeds)) )
     
    24162417    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUNTNOTIFY, &pAhciPort->IMountNotify);
    24172418    return NULL;
     2419}
     2420
     2421static DECLCALLBACK(int) ahciR3PortQueryDeviceLocation(PPDMIBLOCKPORT pInterface, const char **ppcszController,
     2422                                                       uint32_t *piInstance, uint32_t *piLUN)
     2423{
     2424    PAHCIPort pAhciPort = PDMIBLOCKPORT_2_PAHCIPORT(pInterface);
     2425    PPDMDEVINS pDevIns = pAhciPort->CTX_SUFF(pDevIns);
     2426
     2427    AssertPtrReturn(ppcszController, VERR_INVALID_POINTER);
     2428    AssertPtrReturn(piInstance, VERR_INVALID_POINTER);
     2429    AssertPtrReturn(piLUN, VERR_INVALID_POINTER);
     2430
     2431    *ppcszController = pDevIns->pReg->szName;
     2432    *piInstance = pDevIns->iInstance;
     2433    *piLUN = pAhciPort->iLUN;
     2434
     2435    return VINF_SUCCESS;
    24182436}
    24192437
     
    79287946        pAhciPort->IBase.pfnQueryInterface           = ahciR3PortQueryInterface;
    79297947        pAhciPort->IPortAsync.pfnTransferCompleteNotify  = ahciTransferCompleteNotify;
     7948        pAhciPort->IPort.pfnQueryDeviceLocation          = ahciR3PortQueryDeviceLocation;
    79307949        pAhciPort->IMountNotify.pfnMountNotify       = ahciMountNotify;
    79317950        pAhciPort->IMountNotify.pfnUnmountNotify     = ahciUnmountNotify;
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r33540 r34433  
    506506#define CONTROLLER_2_DEVINS(pController)       ( (pController)->CTX_SUFF(pDevIns) )
    507507#define PDMIBASE_2_ATASTATE(pInterface)        ( (ATADevState *)((uintptr_t)(pInterface) - RT_OFFSETOF(ATADevState, IBase)) )
     508#define PDMIBLOCKPORT_2_ATASTATE(pInterface)   ( (ATADevState *)((uintptr_t)(pInterface) - RT_OFFSETOF(ATADevState, IPort)) )
    508509
    509510#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     
    53725373}
    53735374
     5375
     5376/* -=-=-=-=-=- ATADevState::IPort  -=-=-=-=-=- */
     5377
     5378/**
     5379 * @interface_method_impl{PDMIBLOCKPORT,pfnQueryDeviceLocation}
     5380 */
     5381static DECLCALLBACK(int) ataR3QueryDeviceLocation(PPDMIBLOCKPORT pInterface, const char **ppcszController,
     5382                                                  uint32_t *piInstance, uint32_t *piLUN)
     5383{
     5384    ATADevState *pIf = PDMIBLOCKPORT_2_ATASTATE(pInterface);
     5385    PPDMDEVINS pDevIns = pIf->CTX_SUFF(pDevIns);
     5386
     5387    AssertPtrReturn(ppcszController, VERR_INVALID_POINTER);
     5388    AssertPtrReturn(piInstance, VERR_INVALID_POINTER);
     5389    AssertPtrReturn(piLUN, VERR_INVALID_POINTER);
     5390
     5391    *ppcszController = pDevIns->pReg->szName;
     5392    *piInstance = pDevIns->iInstance;
     5393    *piLUN = pIf->iLUN;
     5394
     5395    return VINF_SUCCESS;
     5396}
    53745397#endif /* IN_RING3 */
    53755398
     
    67376760            pIf->IMountNotify.pfnMountNotify   = ataMountNotify;
    67386761            pIf->IMountNotify.pfnUnmountNotify = ataUnmountNotify;
     6762            pIf->IPort.pfnQueryDeviceLocation  = ataR3QueryDeviceLocation;
    67396763            pIf->Led.u32Magic                  = PDMLED_MAGIC;
    67406764        }
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r34009 r34433  
    21402140}
    21412141
     2142static DECLCALLBACK(int) buslogicQueryDeviceLocation(PPDMISCSIPORT pInterface, const char **ppcszController,
     2143                                                     uint32_t *piInstance, uint32_t *piLUN)
     2144{
     2145    PBUSLOGICDEVICE pBusLogicDevice = PDMISCSIPORT_2_PBUSLOGICDEVICE(pInterface);
     2146    PPDMDEVINS pDevIns = pBusLogicDevice->CTX_SUFF(pBusLogic)->CTX_SUFF(pDevIns);
     2147
     2148    AssertPtrReturn(ppcszController, VERR_INVALID_POINTER);
     2149    AssertPtrReturn(piInstance, VERR_INVALID_POINTER);
     2150    AssertPtrReturn(piLUN, VERR_INVALID_POINTER);
     2151
     2152    *ppcszController = pDevIns->pReg->szName;
     2153    *piInstance = pDevIns->iInstance;
     2154    *piLUN = pBusLogicDevice->iLUN;
     2155
     2156    return VINF_SUCCESS;
     2157}
     2158
    21422159static int buslogicDeviceSCSIRequestSetup(PBUSLOGIC pBusLogic, PBUSLOGICTASKSTATE pTaskState)
    21432160{
     
    30723089        pDevice->IBase.pfnQueryInterface           = buslogicDeviceQueryInterface;
    30733090        pDevice->ISCSIPort.pfnSCSIRequestCompleted = buslogicDeviceSCSIRequestCompleted;
     3091        pDevice->ISCSIPort.pfnQueryDeviceLocation  = buslogicQueryDeviceLocation;
    30743092        pDevice->ILed.pfnQueryStatusLed            = buslogicDeviceQueryStatusLed;
    30753093
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r34014 r34433  
    21812181}
    21822182
     2183static DECLCALLBACK(int) lsilogicQueryDeviceLocation(PPDMISCSIPORT pInterface, const char **ppcszController,
     2184                                                     uint32_t *piInstance, uint32_t *piLUN)
     2185{
     2186    PLSILOGICDEVICE pLsiLogicDevice = PDMISCSIPORT_2_PLSILOGICDEVICE(pInterface);
     2187    PPDMDEVINS pDevIns = pLsiLogicDevice->CTX_SUFF(pLsiLogic)->CTX_SUFF(pDevIns);
     2188
     2189    AssertPtrReturn(ppcszController, VERR_INVALID_POINTER);
     2190    AssertPtrReturn(piInstance, VERR_INVALID_POINTER);
     2191    AssertPtrReturn(piLUN, VERR_INVALID_POINTER);
     2192
     2193    *ppcszController = pDevIns->pReg->szName;
     2194    *piInstance = pDevIns->iInstance;
     2195    *piLUN = pLsiLogicDevice->iLUN;
     2196
     2197    return VINF_SUCCESS;
     2198}
     2199
    21832200/**
    21842201 * Return the configuration page header and data
     
    51765193        pDevice->IBase.pfnQueryInterface           = lsilogicDeviceQueryInterface;
    51775194        pDevice->ISCSIPort.pfnSCSIRequestCompleted = lsilogicDeviceSCSIRequestCompleted;
     5195        pDevice->ISCSIPort.pfnQueryDeviceLocation  = lsilogicQueryDeviceLocation;
    51785196        pDevice->ILed.pfnQueryStatusLed            = lsilogicDeviceQueryStatusLed;
    51795197
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r32139 r34433  
    101101    /** Our mountable interface. */
    102102    PDMIMOUNT               IMount;
     103    /** Our media port interface. */
     104    PDMIMEDIAPORT           IMediaPort;
    103105
    104106    /** Pointer to the async media driver below us.
     
    698700
    699701
     702
     703/* -=-=-=-=- IMediaPort -=-=-=-=- */
     704
     705/** Makes a PDRVBLOCK out of a PPDMIMEDIAPORT. */
     706#define PDMIMEDIAPORT_2_DRVBLOCK(pInterface)    ( (PDRVBLOCK((uintptr_t)pInterface - RT_OFFSETOF(DRVBLOCK, IMediaPort))) )
     707
     708/**
     709 * @interface_method_impl{PDMIMEDIAPORT,pfnQueryDeviceLocation}
     710 */
     711static DECLCALLBACK(int) drvblockQueryDeviceLocation(PPDMIMEDIAPORT pInterface, const char **ppcszController,
     712                                                     uint32_t *piInstance, uint32_t *piLUN)
     713{
     714    PDRVBLOCK pThis = PDMIMEDIAPORT_2_DRVBLOCK(pInterface);
     715
     716    return pThis->pDrvBlockPort->pfnQueryDeviceLocation(pThis->pDrvBlockPort, ppcszController,
     717                                                        piInstance, piLUN);
     718}
     719
    700720/* -=-=-=-=- IBase -=-=-=-=- */
    701721
     
    714734    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBLOCKASYNC, pThis->pDrvMediaAsync ? &pThis->IBlockAsync : NULL);
    715735    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAASYNCPORT, pThis->pDrvBlockAsyncPort ? &pThis->IMediaAsyncPort : NULL);
     736    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAPORT, &pThis->IMediaPort);
    716737    return NULL;
    717738}
     
    804825    /* IMediaAsyncPort. */
    805826    pThis->IMediaAsyncPort.pfnTransferCompleteNotify  = drvblockAsyncTransferCompleteNotify;
     827
     828    /* IMediaPort */
     829    pThis->IMediaPort.pfnQueryDeviceLocation = drvblockQueryDeviceLocation;
    806830
    807831    /*
  • trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp

    r33540 r34433  
    134134    PDMIMEDIA               IMedia;
    135135
     136    /** The media port interface above. */
     137    PPDMIMEDIAPORT          pDrvMediaPort;
     138    /** Media port interface */
     139    PDMIMEDIAPORT           IMediaPort;
     140
    136141    /** Pointer to the media async driver below us.
    137142     * This is NULL if the media is not mounted. */
     
    769774}
    770775
     776/* -=-=-=-=- IMediaPort -=-=-=-=- */
     777
     778/** Makes a PDRVBLOCK out of a PPDMIMEDIAPORT. */
     779#define PDMIMEDIAPORT_2_DRVDISKINTEGRITY(pInterface)    ( (PDRVDISKINTEGRITY((uintptr_t)pInterface - RT_OFFSETOF(DRVDISKINTEGRITY, IMediaPort))) )
     780
     781/**
     782 * @interface_method_impl{PDMIMEDIAPORT,pfnQueryDeviceLocation}
     783 */
     784static DECLCALLBACK(int) drvdiskintQueryDeviceLocation(PPDMIMEDIAPORT pInterface, const char **ppcszController,
     785                                                       uint32_t *piInstance, uint32_t *piLUN)
     786{
     787    PDRVDISKINTEGRITY pThis = PDMIMEDIAPORT_2_DRVDISKINTEGRITY(pInterface);
     788
     789    return pThis->pDrvMediaPort->pfnQueryDeviceLocation(pThis->pDrvMediaPort, ppcszController,
     790                                                        piInstance, piLUN);
     791}
     792
    771793/* -=-=-=-=- IBase -=-=-=-=- */
    772794
     
    783805    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAASYNC, pThis->pDrvMediaAsync ? &pThis->IMediaAsync : NULL);
    784806    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAASYNCPORT, &pThis->IMediaAsyncPort);
     807    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMEDIAPORT, &pThis->IMediaPort);
    785808    return NULL;
    786809}
     
    894917    pThis->IMediaAsyncPort.pfnTransferCompleteNotify  = drvdiskintAsyncTransferCompleteNotify;
    895918
     919    /* IMediaPort. */
     920    pThis->IMediaPort.pfnQueryDeviceLocation = drvdiskintQueryDeviceLocation;
     921
     922    /* Query the media port interface above us. */
     923    pThis->pDrvMediaPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAPORT);
     924    if (!pThis->pDrvMediaPort)
     925        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_BELOW,
     926                                N_("No media port inrerface above"));
     927
     928    /* Try to attach async media port interface above.*/
     929    pThis->pDrvMediaAsyncPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAASYNCPORT);
     930
    896931    /*
    897932     * Try attach driver below and query it's media interface.
     
    909944
    910945    pThis->pDrvMediaAsync = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIAASYNC);
    911 
    912     /* Try to attach async media port interface above.*/
    913     pThis->pDrvMediaAsyncPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAASYNCPORT);
    914946
    915947    if (pThis->fCheckConsistency)
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r34148 r34433  
    108108
    109109/** Converts a pointer to DRVSCSI::ISCSIConnector to a PDRVSCSI. */
    110 #define PDMISCSICONNECTOR_2_DRVSCSI(pInterface) ( (PDRVSCSI)((uintptr_t)pInterface - RT_OFFSETOF(DRVSCSI, ISCSIConnector)) )
     110#define PDMISCSICONNECTOR_2_DRVSCSI(pInterface)  ( (PDRVSCSI)((uintptr_t)pInterface - RT_OFFSETOF(DRVSCSI, ISCSIConnector)) )
    111111/** Converts a pointer to DRVSCSI::IPortAsync to a PDRVSCSI. */
    112112#define PDMIBLOCKASYNCPORT_2_DRVSCSI(pInterface) ( (PDRVSCSI)((uintptr_t)pInterface - RT_OFFSETOF(DRVSCSI, IPortAsync)) )
     113/** Converts a pointer to DRVSCSI::IPort to a PDRVSCSI. */
     114#define PDMIBLOCKPORT_2_DRVSCSI(pInterface)      ( (PDRVSCSI)((uintptr_t)pInterface - RT_OFFSETOF(DRVSCSI, IPort)) )
    113115
    114116static bool drvscsiIsRedoPossible(int rc)
     
    558560}
    559561
     562static DECLCALLBACK(int) drvscsiQueryDeviceLocation(PPDMIBLOCKPORT pInterface, const char **ppcszController,
     563                                                    uint32_t *piInstance, uint32_t *piLUN)
     564{
     565    PDRVSCSI pThis = PDMIBLOCKPORT_2_DRVSCSI(pInterface);
     566
     567    return pThis->pDevScsiPort->pfnQueryDeviceLocation(pThis->pDevScsiPort, ppcszController,
     568                                                       piInstance, piLUN);
     569}
     570
    560571/**
    561572 * Worker for drvscsiReset, drvscsiSuspend and drvscsiPowerOff.
     
    736747    pDrvIns->IBase.pfnQueryInterface         = drvscsiQueryInterface;
    737748
     749    pThis->IPort.pfnQueryDeviceLocation         = drvscsiQueryDeviceLocation;
    738750    pThis->IPortAsync.pfnTransferCompleteNotify = drvscsiTransferCompleteNotify;
    739751
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r34247 r34433  
    128128    /** The media interface. */
    129129    PDMIMEDIA          IMedia;
     130    /** Media port. */
     131    PPDMIMEDIAPORT     pDrvMediaPort;
    130132    /** Pointer to the driver instance. */
    131133    PPDMDRVINS         pDrvIns;
     
    20972099    pThis->pImages = NULL;
    20982100
     2101    pThis->pDrvMediaPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAPORT);
     2102    if (!pThis->pDrvMediaPort)
     2103        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE,
     2104                                N_("No media port interface above"));
     2105
    20992106    /* Try to attach async media port interface above.*/
    21002107    pThis->pDrvMediaAsyncPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAASYNCPORT);
     
    26272634    /* Create the block cache if enabled. */
    26282635    if (   fUseBlockCache
     2636        && !pThis->fShareable
    26292637        && RT_SUCCESS(rc))
    26302638    {
    2631         /* Create a unique ID from the UUID of the last image in the chain. */
    2632         char achUuid[RTUUID_STR_LENGTH + 1];
    2633         RTUUID Uuid;
    2634 
    2635         /** @todo: Images without UUIDs. */
    2636         rc = VDGetUuid(pThis->pDisk, VDGetCount(pThis->pDisk) - 1, &Uuid);
    2637         AssertRC(rc);
    2638 
    2639         memset(achUuid, 0, sizeof(achUuid));
    2640         rc = RTUuidToStr(&Uuid, achUuid, RTUUID_STR_LENGTH);
    2641         AssertRC(rc);
    2642 
    2643         rc = PDMDrvHlpBlkCacheRetain(pDrvIns, &pThis->pBlkCache,
    2644                                      drvvdBlkCacheXferComplete,
    2645                                      drvvdBlkCacheXferEnqueue,
    2646                                      achUuid);
    2647         if (rc == VERR_NOT_SUPPORTED)
    2648         {
    2649             LogRel(("VD: Block cache is not supported\n"));
    2650             rc = VINF_SUCCESS;
    2651         }
     2639        /*
     2640         * We need a unique ID for the block cache (to identify the owner of data
     2641         * blocks in a saved state). UUIDs are not really suitable because
     2642         * there are image formats which don't support them. Furthermore it is
     2643         * possible that a new diff image was attached after a saved state
     2644         * which changes the UUID.
     2645         * However the device "name + device instance + LUN" triple the disk is
     2646         * attached to is always constant for saved states.
     2647         */
     2648        char *pszId = NULL;
     2649        uint32_t iInstance, iLUN;
     2650        const char *pcszController;
     2651
     2652        rc = pThis->pDrvMediaPort->pfnQueryDeviceLocation(pThis->pDrvMediaPort, &pcszController,
     2653                                                          &iInstance, &iLUN);
     2654        if (RT_FAILURE(rc))
     2655            rc = PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRIVER_INVALID_PROPERTIES,
     2656                                  N_("DrvVD: Configuration error: Could not query device data"));
    26522657        else
    2653             AssertRC(rc);
     2658        {
     2659            int cbStr = RTStrAPrintf(&pszId, "%s-%d-%d", pcszController, iInstance, iLUN);
     2660
     2661            if (cbStr > 0)
     2662            {
     2663                rc = PDMDrvHlpBlkCacheRetain(pDrvIns, &pThis->pBlkCache,
     2664                                             drvvdBlkCacheXferComplete,
     2665                                             drvvdBlkCacheXferEnqueue,
     2666                                             pszId);
     2667                if (rc == VERR_NOT_SUPPORTED)
     2668                {
     2669                    LogRel(("VD: Block cache is not supported\n"));
     2670                    rc = VINF_SUCCESS;
     2671                }
     2672                else
     2673                    AssertRC(rc);
     2674
     2675                RTStrFree(pszId);
     2676            }
     2677            else
     2678                rc = PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRIVER_INVALID_PROPERTIES,
     2679                                      N_("DrvVD: Out of memory when creating block cache"));
     2680        }
    26542681    }
    26552682
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