VirtualBox

Changeset 38469 in vbox for trunk/src/VBox/Storage/ISCSI.cpp


Ignore:
Timestamp:
Aug 16, 2011 10:34:32 AM (13 years ago)
Author:
vboxsync
Message:

VD: Interface cleanup. Merge the two involved structures (generic interface descriptor and callback table) into one, remove the duplicated interface wrappers in the backends and move the interface definitions into separate headers separating public and private interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/ISCSI.cpp

    r37688 r38469  
    524524    /** Pointer to the per-disk VD interface list. */
    525525    PVDINTERFACE        pVDIfsDisk;
    526     /** Error interface. */
    527     PVDINTERFACE        pInterfaceError;
    528     /** Error interface callback table. */
    529     PVDINTERFACEERROR   pInterfaceErrorCallbacks;
    530526    /** Pointer to the per-image VD interface list. */
    531527    PVDINTERFACE        pVDIfsImage;
     528    /** Error interface. */
     529    PVDINTERFACEERROR   pIfError;
    532530    /** Config interface. */
    533     PVDINTERFACE        pInterfaceConfig;
    534     /** Config interface callback table. */
    535     PVDINTERFACECONFIG  pInterfaceConfigCallbacks;
     531    PVDINTERFACECONFIG  pIfConfig;
    536532    /** I/O interface. */
    537     PVDINTERFACE        pInterfaceIo;
    538     /** I/O interface callback table. */
    539     PVDINTERFACEIOINT   pInterfaceIoCallbacks;
     533    PVDINTERFACEIOINT   pIfIo;
    540534    /** TCP network stack interface. */
    541     PVDINTERFACE        pInterfaceNet;
    542     /** TCP network stack interface callback table. */
    543     PVDINTERFACETCPNET  pInterfaceNetCallbacks;
     535    PVDINTERFACETCPNET  pIfNet;
    544536    /** Image open flags. */
    545537    unsigned            uOpenFlags;
     
    719711}
    720712
    721 /**
    722  * Internal: signal an error to the frontend.
    723  */
    724 DECLINLINE(int) iscsiError(PISCSIIMAGE pImage, int rc, RT_SRC_POS_DECL,
    725                            const char *pszFormat, ...)
    726 {
    727     va_list va;
    728     va_start(va, pszFormat);
    729     if (pImage->pInterfaceError)
    730         pImage->pInterfaceErrorCallbacks->pfnError(pImage->pInterfaceError->pvUser, rc, RT_SRC_POS_ARGS,
    731                                                    pszFormat, va);
    732     va_end(va);
    733 
    734 #ifdef LOG_ENABLED
    735     va_start(va, pszFormat);
    736     Log(("iscsiError(%d/%s): %N\n", iLine, pszFunction, pszFormat, &va));
    737     va_end(va);
    738 #endif
    739     return rc;
    740 }
    741 
    742 /**
    743  * Internal: signal an informational message to the frontend.
    744  */
    745 DECLINLINE(int) iscsiMessage(PISCSIIMAGE pImage, const char *pszFormat, ...)
    746 {
    747     int rc = VINF_SUCCESS;
    748     va_list va;
    749     va_start(va, pszFormat);
    750     if (pImage->pInterfaceError)
    751         rc = pImage->pInterfaceErrorCallbacks->pfnMessage(pImage->pInterfaceError->pvUser,
    752                                                           pszFormat, va);
    753     va_end(va);
    754     return rc;
    755 }
    756 
    757713DECLINLINE(bool) iscsiIsClientConnected(PISCSIIMAGE pImage)
    758714{
    759715    return    pImage->Socket != NIL_VDSOCKET
    760            && pImage->pInterfaceNetCallbacks->pfnIsClientConnected(pImage->Socket);
     716           && pImage->pIfNet->pfnIsClientConnected(pImage->Socket);
    761717}
    762718
     
    871827        return VERR_NET_DEST_ADDRESS_REQUIRED;
    872828
    873     rc = pImage->pInterfaceNetCallbacks->pfnClientConnect(pImage->Socket, pImage->pszHostname, pImage->uPort);
     829    rc = pImage->pIfNet->pfnClientConnect(pImage->Socket, pImage->pszHostname, pImage->uPort);
    874830    if (RT_FAILURE(rc))
    875831    {
     
    887843
    888844    /* Disable Nagle algorithm, we want things to be sent immediately. */
    889     pImage->pInterfaceNetCallbacks->pfnSetSendCoalescing(pImage->Socket, false);
     845    pImage->pIfNet->pfnSetSendCoalescing(pImage->Socket, false);
    890846
    891847    /* Make initiator name and ISID unique on this host. */
    892848    RTNETADDR LocalAddr;
    893     rc = pImage->pInterfaceNetCallbacks->pfnGetLocalAddress(pImage->Socket,
    894                                                             &LocalAddr);
     849    rc = pImage->pIfNet->pfnGetLocalAddress(pImage->Socket, &LocalAddr);
    895850    if (RT_FAILURE(rc))
    896851        return rc;
     
    924879    {
    925880        LogRel(("iSCSI: disconnect from initiator %s with source port %u\n", pImage->pszInitiatorName, pImage->ISID & 65535));
    926         rc = pImage->pInterfaceNetCallbacks->pfnClientClose(pImage->Socket);
     881        rc = pImage->pIfNet->pfnClientClose(pImage->Socket);
    927882    }
    928883    else
     
    964919            }
    965920            Assert(cMilliesRemaining < 1000000);
    966             rc = pImage->pInterfaceNetCallbacks->pfnSelectOne(pImage->Socket,
     921            rc = pImage->pIfNet->pfnSelectOne(pImage->Socket,
    967922                                                              cMilliesRemaining);
    968923            if (RT_FAILURE(rc))
    969924                break;
    970             rc = pImage->pInterfaceNetCallbacks->pfnRead(pImage->Socket,
     925            rc = pImage->pIfNet->pfnRead(pImage->Socket,
    971926                                                         pDst, residual,
    972927                                                         &cbActuallyRead);
     
    11051060        /* Send out the request, the socket is set to send data immediately,
    11061061         * avoiding unnecessary delays. */
    1107         rc = pImage->pInterfaceNetCallbacks->pfnSgWrite(pImage->Socket, &buf);
     1062        rc = pImage->pIfNet->pfnSgWrite(pImage->Socket, &buf);
    11081063
    11091064    }
     
    22802235    }
    22812236
    2282     rc = pImage->pInterfaceNetCallbacks->pfnReadNB(pImage->Socket, pImage->pbRecvPDUBufCur,
     2237    rc = pImage->pIfNet->pfnReadNB(pImage->Socket, pImage->pbRecvPDUBufCur,
    22832238                                                   pImage->cbRecvPDUResidual, &cbActuallyRead);
    22842239    if (RT_SUCCESS(rc) && cbActuallyRead == 0)
     
    23502305
    23512306        /* Send as much as we can. */
    2352         rc = pImage->pInterfaceNetCallbacks->pfnSgWriteNB(pImage->Socket, &pImage->pIScsiPDUTxCur->SgBuf, &cbSent);
     2307        rc = pImage->pIfNet->pfnSgWriteNB(pImage->Socket, &pImage->pIScsiPDUTxCur->SgBuf, &cbSent);
    23532308        LogFlow(("SgWriteNB returned rc=%Rrc cbSent=%zu\n", rc, cbSent));
    23542309        if (RT_SUCCESS(rc))
     
    31273082DECLINLINE(int) iscsiIoThreadWait(PISCSIIMAGE pImage, RTMSINTERVAL cMillies, uint32_t fEvents, uint32_t *pfEvents)
    31283083{
    3129     return pImage->pInterfaceNetCallbacks->pfnSelectOneEx(pImage->Socket, fEvents, pfEvents, cMillies);
     3084    return pImage->pIfNet->pfnSelectOneEx(pImage->Socket, fEvents, pfEvents, cMillies);
    31303085}
    31313086
     
    31353090DECLINLINE(int) iscsiIoThreadPoke(PISCSIIMAGE pImage)
    31363091{
    3137     return pImage->pInterfaceNetCallbacks->pfnPoke(pImage->Socket);
     3092    return pImage->pIfNet->pfnPoke(pImage->Socket);
    31383093}
    31393094
     
    36433598
    36443599        /* Continue I/O context. */
    3645         pImage->pInterfaceIoCallbacks->pfnIoCtxCompleted(pImage->pInterfaceIo->pvUser,
    3646                                                          pReqAsync->pIoCtx, rcReq,
    3647                                                          cbTransfered);
     3600        pImage->pIfIo->pfnIoCtxCompleted(pImage->pIfIo->Core.pvUser,
     3601                                         pReqAsync->pIoCtx, rcReq,
     3602                                         cbTransfered);
    36483603
    36493604        RTMemFree(pScsiReq);
     
    36873642        if (pImage->Socket != NIL_VDSOCKET)
    36883643        {
    3689             pImage->pInterfaceNetCallbacks->pfnSocketDestroy(pImage->Socket);
     3644            pImage->pIfNet->pfnSocketDestroy(pImage->Socket);
    36903645        }
    36913646        if (pImage->MutexReqQueue != NIL_RTSEMMUTEX)
     
    37633718
    37643719    /* Get error signalling interface. */
    3765     pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfsDisk, VDINTERFACETYPE_ERROR);
    3766     if (pImage->pInterfaceError)
    3767         pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError);
     3720    pImage->pIfError = VDIfErrorGet(pImage->pVDIfsDisk);
    37683721
    37693722    /* Get TCP network stack interface. */
    3770     pImage->pInterfaceNet = VDInterfaceGet(pImage->pVDIfsImage, VDINTERFACETYPE_TCPNET);
    3771     if (pImage->pInterfaceNet)
    3772         pImage->pInterfaceNetCallbacks = VDGetInterfaceTcpNet(pImage->pInterfaceNet);
    3773     else
    3774     {
    3775         rc = iscsiError(pImage, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
    3776                         RT_SRC_POS, N_("iSCSI: TCP network stack interface missing"));
     3723    pImage->pIfNet = VDIfTcpNetGet(pImage->pVDIfsImage);
     3724    if (!pImage->pIfNet)
     3725    {
     3726        rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
     3727                       RT_SRC_POS, N_("iSCSI: TCP network stack interface missing"));
    37773728        goto out;
    37783729    }
    37793730
    37803731    /* Get configuration interface. */
    3781     pImage->pInterfaceConfig = VDInterfaceGet(pImage->pVDIfsImage, VDINTERFACETYPE_CONFIG);
    3782     if (pImage->pInterfaceConfig)
    3783         pImage->pInterfaceConfigCallbacks = VDGetInterfaceConfig(pImage->pInterfaceConfig);
    3784     else
    3785     {
    3786         rc = iscsiError(pImage, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
    3787                         RT_SRC_POS, N_("iSCSI: configuration interface missing"));
     3732    pImage->pIfConfig = VDIfConfigGet(pImage->pVDIfsImage);
     3733    if (!pImage->pIfConfig)
     3734    {
     3735        rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
     3736                       RT_SRC_POS, N_("iSCSI: configuration interface missing"));
    37883737        goto out;
    37893738    }
    37903739
    37913740    /* Get I/O interface. */
    3792     pImage->pInterfaceIo = VDInterfaceGet(pImage->pVDIfsImage, VDINTERFACETYPE_IOINT);
    3793     if (pImage->pInterfaceIo)
    3794         pImage->pInterfaceIoCallbacks = VDGetInterfaceIOInt(pImage->pInterfaceIo);
    3795     else
    3796     {
    3797         rc = iscsiError(pImage, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
    3798                         RT_SRC_POS, N_("iSCSI: I/O interface missing"));
     3741    pImage->pIfIo = VDIfIoIntGet(pImage->pVDIfsImage);
     3742    if (!pImage->pIfIo)
     3743    {
     3744        rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_UNKNOWN_INTERFACE,
     3745                       RT_SRC_POS, N_("iSCSI: I/O interface missing"));
    37993746        goto out;
    38003747    }
     
    38223769
    38233770    /* Validate configuration, detect unknown keys. */
    3824     if (!VDCFGAreKeysValid(pImage->pInterfaceConfigCallbacks,
    3825                            pImage->pInterfaceConfig->pvUser,
     3771    if (!VDCFGAreKeysValid(pImage->pIfConfig,
    38263772                           "TargetName\0InitiatorName\0LUN\0TargetAddress\0InitiatorUsername\0InitiatorSecret\0TargetUsername\0TargetSecret\0WriteSplit\0Timeout\0HostIPStack\0"))
    38273773    {
    3828         rc = iscsiError(pImage, VERR_VD_ISCSI_UNKNOWN_CFG_VALUES, RT_SRC_POS, N_("iSCSI: configuration error: unknown configuration keys present"));
     3774        rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_UNKNOWN_CFG_VALUES, RT_SRC_POS, N_("iSCSI: configuration error: unknown configuration keys present"));
    38293775        goto out;
    38303776    }
    38313777
    38323778    /* Query the iSCSI upper level configuration. */
    3833     rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks,
    3834                                pImage->pInterfaceConfig->pvUser,
     3779    rc = VDCFGQueryStringAlloc(pImage->pIfConfig,
    38353780                               "TargetName", &pImage->pszTargetName);
    38363781    if (RT_FAILURE(rc))
    38373782    {
    3838         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetName as string"));
     3783        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetName as string"));
    38393784        goto out;
    38403785    }
    3841     rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks,
    3842                                pImage->pInterfaceConfig->pvUser,
     3786    rc = VDCFGQueryStringAlloc(pImage->pIfConfig,
    38433787                               "InitiatorName", &pImage->pszInitiatorName);
    38443788    if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
     
    38493793    if (RT_FAILURE(rc))
    38503794    {
    3851         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorName as string"));
     3795        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorName as string"));
    38523796        goto out;
    38533797    }
    3854     rc = VDCFGQueryStringAllocDef(pImage->pInterfaceConfigCallbacks,
    3855                                   pImage->pInterfaceConfig->pvUser,
     3798    rc = VDCFGQueryStringAllocDef(pImage->pIfConfig,
    38563799                                  "LUN", &pszLUN, s_iscsiConfigDefaultLUN);
    38573800    if (RT_FAILURE(rc))
    38583801    {
    3859         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read LUN as string"));
     3802        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read LUN as string"));
    38603803        goto out;
    38613804    }
     
    38693812    if (RT_FAILURE(rc))
    38703813    {
    3871         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to convert LUN to integer"));
     3814        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to convert LUN to integer"));
    38723815        goto out;
    38733816    }
     
    38853828        {
    38863829            rc = VERR_OUT_OF_RANGE;
    3887             rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: LUN number out of range (0-16383)"));
     3830            rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: LUN number out of range (0-16383)"));
    38883831            goto out;
    38893832        }
    38903833    }
    3891     rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks,
    3892                                pImage->pInterfaceConfig->pvUser,
     3834    rc = VDCFGQueryStringAlloc(pImage->pIfConfig,
    38933835                               "TargetAddress", &pImage->pszTargetAddress);
    38943836    if (RT_FAILURE(rc))
    38953837    {
    3896         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetAddress as string"));
     3838        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetAddress as string"));
    38973839        goto out;
    38983840    }
    38993841    pImage->pszInitiatorUsername = NULL;
    3900     rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks,
    3901                                pImage->pInterfaceConfig->pvUser,
     3842    rc = VDCFGQueryStringAlloc(pImage->pIfConfig,
    39023843                               "InitiatorUsername",
    39033844                               &pImage->pszInitiatorUsername);
     
    39063847    if (RT_FAILURE(rc))
    39073848    {
    3908         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorUsername as string"));
     3849        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorUsername as string"));
    39093850        goto out;
    39103851    }
    39113852    pImage->pbInitiatorSecret = NULL;
    39123853    pImage->cbInitiatorSecret = 0;
    3913     rc = VDCFGQueryBytesAlloc(pImage->pInterfaceConfigCallbacks,
    3914                               pImage->pInterfaceConfig->pvUser,
     3854    rc = VDCFGQueryBytesAlloc(pImage->pIfConfig,
    39153855                              "InitiatorSecret",
    39163856                              (void **)&pImage->pbInitiatorSecret,
     
    39203860    if (RT_FAILURE(rc))
    39213861    {
    3922         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorSecret as byte string"));
     3862        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read InitiatorSecret as byte string"));
    39233863        goto out;
    39243864    }
    39253865    pImage->pszTargetUsername = NULL;
    3926     rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks,
    3927                                pImage->pInterfaceConfig->pvUser,
     3866    rc = VDCFGQueryStringAlloc(pImage->pIfConfig,
    39283867                               "TargetUsername",
    39293868                               &pImage->pszTargetUsername);
     
    39323871    if (RT_FAILURE(rc))
    39333872    {
    3934         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetUsername as string"));
     3873        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetUsername as string"));
    39353874        goto out;
    39363875    }
    39373876    pImage->pbTargetSecret = NULL;
    39383877    pImage->cbTargetSecret = 0;
    3939     rc = VDCFGQueryBytesAlloc(pImage->pInterfaceConfigCallbacks,
    3940                               pImage->pInterfaceConfig->pvUser,
     3878    rc = VDCFGQueryBytesAlloc(pImage->pIfConfig,
    39413879                              "TargetSecret", (void **)&pImage->pbTargetSecret,
    39423880                              &pImage->cbTargetSecret);
     
    39453883    if (RT_FAILURE(rc))
    39463884    {
    3947         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetSecret as byte string"));
     3885        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read TargetSecret as byte string"));
    39483886        goto out;
    39493887    }
    3950     rc = VDCFGQueryU32Def(pImage->pInterfaceConfigCallbacks,
    3951                           pImage->pInterfaceConfig->pvUser,
     3888    rc = VDCFGQueryU32Def(pImage->pIfConfig,
    39523889                          "WriteSplit", &pImage->cbWriteSplit,
    39533890                          uWriteSplitDef);
    39543891    if (RT_FAILURE(rc))
    39553892    {
    3956         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read WriteSplit as U32"));
     3893        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read WriteSplit as U32"));
    39573894        goto out;
    39583895    }
     
    39623899    pImage->Socket         = NIL_VDSOCKET;
    39633900    /* Query the iSCSI lower level configuration. */
    3964     rc = VDCFGQueryU32Def(pImage->pInterfaceConfigCallbacks,
    3965                           pImage->pInterfaceConfig->pvUser,
     3901    rc = VDCFGQueryU32Def(pImage->pIfConfig,
    39663902                          "Timeout", &pImage->uReadTimeout,
    39673903                          uTimeoutDef);
    39683904    if (RT_FAILURE(rc))
    39693905    {
    3970         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read Timeout as U32"));
     3906        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read Timeout as U32"));
    39713907        goto out;
    39723908    }
    3973     rc = VDCFGQueryBoolDef(pImage->pInterfaceConfigCallbacks,
    3974                            pImage->pInterfaceConfig->pvUser,
     3909    rc = VDCFGQueryBoolDef(pImage->pIfConfig,
    39753910                           "HostIPStack", &pImage->fHostIP,
    39763911                           fHostIPDef);
    39773912    if (RT_FAILURE(rc))
    39783913    {
    3979         rc = iscsiError(pImage, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read HostIPStack as boolean"));
     3914        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("iSCSI: configuration error: failed to read HostIPStack as boolean"));
    39803915        goto out;
    39813916    }
     
    39953930
    39963931    /* Create the socket structure. */
    3997     rc = pImage->pInterfaceNetCallbacks->pfnSocketCreate(VD_INTERFACETCPNET_CONNECT_EXTENDED_SELECT,
    3998                                                          &pImage->Socket);
     3932    rc = pImage->pIfNet->pfnSocketCreate(VD_INTERFACETCPNET_CONNECT_EXTENDED_SELECT,
     3933                                         &pImage->Socket);
    39993934    if (RT_SUCCESS(rc))
    40003935    {
     
    40203955        {
    40213956            pImage->fExtendedSelectSupported = false;
    4022             rc = pImage->pInterfaceNetCallbacks->pfnSocketCreate(0, &pImage->Socket);
     3957            rc = pImage->pIfNet->pfnSocketCreate(0, &pImage->Socket);
    40233958            if (RT_FAILURE(rc))
    40243959            {
     
    41244059        if (devType != SCSI_DEVTYPE_DISK)
    41254060        {
    4126             rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,
     4061            rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_INVALID_TYPE,
    41274062                            RT_SRC_POS, N_("iSCSI: target address %s, target name %s, SCSI LUN %lld reports device type=%u"),
    41284063                            pImage->pszTargetAddress, pImage->pszTargetName,
     
    42304165        if (pImage->cVolume == 0 || pImage->cbSector != 512 || pImage->cbSize < pImage->cVolume)
    42314166        {
    4232             rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,
    4233                             RT_SRC_POS, N_("iSCSI: target address %s, target name %s, SCSI LUN %lld reports media sector count=%llu sector size=%u"),
    4234                             pImage->pszTargetAddress, pImage->pszTargetName,
    4235                             pImage->LUN, pImage->cVolume, pImage->cbSector);
     4167            rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_INVALID_TYPE,
     4168                           RT_SRC_POS, N_("iSCSI: target address %s, target name %s, SCSI LUN %lld reports media sector count=%llu sector size=%u"),
     4169                           pImage->pszTargetAddress, pImage->pszTargetName,
     4170                           pImage->LUN, pImage->cVolume, pImage->cbSector);
    42364171        }
    42374172    }
     
    42764211            if (pImage->cVolume == 0 || pImage->cbSector != 512)
    42774212            {
    4278                 rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,
    4279                                 RT_SRC_POS, N_("iSCSI: fallback capacity detectio for target address %s, target name %s, SCSI LUN %lld reports media sector count=%llu sector size=%u"),
    4280                                 pImage->pszTargetAddress, pImage->pszTargetName,
    4281                                 pImage->LUN, pImage->cVolume, pImage->cbSector);
     4213                rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_INVALID_TYPE,
     4214                               RT_SRC_POS, N_("iSCSI: fallback capacity detectio for target address %s, target name %s, SCSI LUN %lld reports media sector count=%llu sector size=%u"),
     4215                               pImage->pszTargetAddress, pImage->pszTargetName,
     4216                               pImage->LUN, pImage->cVolume, pImage->cbSector);
    42824217            }
    42834218        }
     
    51725107    {
    51735108        /** @todo put something useful here */
    5174         iscsiMessage(pImage, "Header: cVolume=%u\n", pImage->cVolume);
     5109        vdIfErrorMessage(pImage->pIfError, "Header: cVolume=%u\n", pImage->cVolume);
    51755110    }
    51765111}
     
    51975132
    51985133    /* Get the number of segments. */
    5199     cbSegs = pImage->pInterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,
    5200                                                                    NULL, &cT2ISegs, cbToRead);
     5134    cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx,
     5135                                                   NULL, &cT2ISegs, cbToRead);
    52015136    Assert(cbSegs == cbToRead);
    52025137
     
    52155150            tls = (uint16_t)(cbToRead / pImage->cbSector);
    52165151
    5217             cbSegs = pImage->pInterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,
    5218                                                                            &pReqAsync->aSegs[0],
    5219                                                                            &cT2ISegs, cbToRead);
     5152            cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx,
     5153                                                           &pReqAsync->aSegs[0],
     5154                                                           &cT2ISegs, cbToRead);
    52205155            Assert(cbSegs == cbToRead);
    52215156            pReqAsync->cT2ISegs = cT2ISegs;
     
    53225257
    53235258    /* Get the number of segments. */
    5324     cbSegs = pImage->pInterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,
    5325                                                                    NULL, &cI2TSegs, cbToWrite);
     5259    cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx,
     5260                                                   NULL, &cI2TSegs, cbToWrite);
    53265261    Assert(cbSegs == cbToWrite);
    53275262
     
    53405275            tls = (uint16_t)(cbToWrite / pImage->cbSector);
    53415276
    5342             cbSegs = pImage->pInterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,
    5343                                                                            &pReqAsync->aSegs[0],
    5344                                                                            &cI2TSegs, cbToWrite);
     5277            cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx,
     5278                                                           &pReqAsync->aSegs[0],
     5279                                                           &cI2TSegs, cbToWrite);
    53455280            Assert(cbSegs == cbToWrite);
    53465281            pReqAsync->cI2TSegs = cI2TSegs;
     
    54895424    char *pszLUN     = NULL;
    54905425    char *pszAddress = NULL;
    5491     int rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "TargetName", &pszTarget);
     5426    int rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetName", &pszTarget);
    54925427    if (RT_SUCCESS(rc))
    54935428    {
    5494         rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "LUN", &pszLUN);
     5429        rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "LUN", &pszLUN);
    54955430        if (RT_SUCCESS(rc))
    54965431        {
    5497             rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "TargetAddress", &pszAddress);
     5432            rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetAddress", &pszAddress);
    54985433            if (RT_SUCCESS(rc))
    54995434            {
     
    55165451    char *pszLUN     = NULL;
    55175452    char *pszAddress = NULL;
    5518     int rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "TargetName", &pszTarget);
     5453    int rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetName", &pszTarget);
    55195454    if (RT_SUCCESS(rc))
    55205455    {
    5521         rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "LUN", &pszLUN);
     5456        rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "LUN", &pszLUN);
    55225457        if (RT_SUCCESS(rc))
    55235458        {
    5524             rc = VDCFGQueryStringAlloc(VDGetInterfaceConfig(pConfig), pConfig->pvUser, "TargetAddress", &pszAddress);
     5459            rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetAddress", &pszAddress);
    55255460            if (RT_SUCCESS(rc))
    55265461            {
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