Changeset 38469 in vbox for trunk/src/VBox/Storage/ISCSI.cpp
- Timestamp:
- Aug 16, 2011 10:34:32 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/ISCSI.cpp
r37688 r38469 524 524 /** Pointer to the per-disk VD interface list. */ 525 525 PVDINTERFACE pVDIfsDisk; 526 /** Error interface. */527 PVDINTERFACE pInterfaceError;528 /** Error interface callback table. */529 PVDINTERFACEERROR pInterfaceErrorCallbacks;530 526 /** Pointer to the per-image VD interface list. */ 531 527 PVDINTERFACE pVDIfsImage; 528 /** Error interface. */ 529 PVDINTERFACEERROR pIfError; 532 530 /** Config interface. */ 533 PVDINTERFACE pInterfaceConfig; 534 /** Config interface callback table. */ 535 PVDINTERFACECONFIG pInterfaceConfigCallbacks; 531 PVDINTERFACECONFIG pIfConfig; 536 532 /** I/O interface. */ 537 PVDINTERFACE pInterfaceIo; 538 /** I/O interface callback table. */ 539 PVDINTERFACEIOINT pInterfaceIoCallbacks; 533 PVDINTERFACEIOINT pIfIo; 540 534 /** TCP network stack interface. */ 541 PVDINTERFACE pInterfaceNet; 542 /** TCP network stack interface callback table. */ 543 PVDINTERFACETCPNET pInterfaceNetCallbacks; 535 PVDINTERFACETCPNET pIfNet; 544 536 /** Image open flags. */ 545 537 unsigned uOpenFlags; … … 719 711 } 720 712 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_ENABLED735 va_start(va, pszFormat);736 Log(("iscsiError(%d/%s): %N\n", iLine, pszFunction, pszFormat, &va));737 va_end(va);738 #endif739 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 757 713 DECLINLINE(bool) iscsiIsClientConnected(PISCSIIMAGE pImage) 758 714 { 759 715 return pImage->Socket != NIL_VDSOCKET 760 && pImage->pI nterfaceNetCallbacks->pfnIsClientConnected(pImage->Socket);716 && pImage->pIfNet->pfnIsClientConnected(pImage->Socket); 761 717 } 762 718 … … 871 827 return VERR_NET_DEST_ADDRESS_REQUIRED; 872 828 873 rc = pImage->pI nterfaceNetCallbacks->pfnClientConnect(pImage->Socket, pImage->pszHostname, pImage->uPort);829 rc = pImage->pIfNet->pfnClientConnect(pImage->Socket, pImage->pszHostname, pImage->uPort); 874 830 if (RT_FAILURE(rc)) 875 831 { … … 887 843 888 844 /* Disable Nagle algorithm, we want things to be sent immediately. */ 889 pImage->pI nterfaceNetCallbacks->pfnSetSendCoalescing(pImage->Socket, false);845 pImage->pIfNet->pfnSetSendCoalescing(pImage->Socket, false); 890 846 891 847 /* Make initiator name and ISID unique on this host. */ 892 848 RTNETADDR LocalAddr; 893 rc = pImage->pInterfaceNetCallbacks->pfnGetLocalAddress(pImage->Socket, 894 &LocalAddr); 849 rc = pImage->pIfNet->pfnGetLocalAddress(pImage->Socket, &LocalAddr); 895 850 if (RT_FAILURE(rc)) 896 851 return rc; … … 924 879 { 925 880 LogRel(("iSCSI: disconnect from initiator %s with source port %u\n", pImage->pszInitiatorName, pImage->ISID & 65535)); 926 rc = pImage->pI nterfaceNetCallbacks->pfnClientClose(pImage->Socket);881 rc = pImage->pIfNet->pfnClientClose(pImage->Socket); 927 882 } 928 883 else … … 964 919 } 965 920 Assert(cMilliesRemaining < 1000000); 966 rc = pImage->pI nterfaceNetCallbacks->pfnSelectOne(pImage->Socket,921 rc = pImage->pIfNet->pfnSelectOne(pImage->Socket, 967 922 cMilliesRemaining); 968 923 if (RT_FAILURE(rc)) 969 924 break; 970 rc = pImage->pI nterfaceNetCallbacks->pfnRead(pImage->Socket,925 rc = pImage->pIfNet->pfnRead(pImage->Socket, 971 926 pDst, residual, 972 927 &cbActuallyRead); … … 1105 1060 /* Send out the request, the socket is set to send data immediately, 1106 1061 * avoiding unnecessary delays. */ 1107 rc = pImage->pI nterfaceNetCallbacks->pfnSgWrite(pImage->Socket, &buf);1062 rc = pImage->pIfNet->pfnSgWrite(pImage->Socket, &buf); 1108 1063 1109 1064 } … … 2280 2235 } 2281 2236 2282 rc = pImage->pI nterfaceNetCallbacks->pfnReadNB(pImage->Socket, pImage->pbRecvPDUBufCur,2237 rc = pImage->pIfNet->pfnReadNB(pImage->Socket, pImage->pbRecvPDUBufCur, 2283 2238 pImage->cbRecvPDUResidual, &cbActuallyRead); 2284 2239 if (RT_SUCCESS(rc) && cbActuallyRead == 0) … … 2350 2305 2351 2306 /* Send as much as we can. */ 2352 rc = pImage->pI nterfaceNetCallbacks->pfnSgWriteNB(pImage->Socket, &pImage->pIScsiPDUTxCur->SgBuf, &cbSent);2307 rc = pImage->pIfNet->pfnSgWriteNB(pImage->Socket, &pImage->pIScsiPDUTxCur->SgBuf, &cbSent); 2353 2308 LogFlow(("SgWriteNB returned rc=%Rrc cbSent=%zu\n", rc, cbSent)); 2354 2309 if (RT_SUCCESS(rc)) … … 3127 3082 DECLINLINE(int) iscsiIoThreadWait(PISCSIIMAGE pImage, RTMSINTERVAL cMillies, uint32_t fEvents, uint32_t *pfEvents) 3128 3083 { 3129 return pImage->pI nterfaceNetCallbacks->pfnSelectOneEx(pImage->Socket, fEvents, pfEvents, cMillies);3084 return pImage->pIfNet->pfnSelectOneEx(pImage->Socket, fEvents, pfEvents, cMillies); 3130 3085 } 3131 3086 … … 3135 3090 DECLINLINE(int) iscsiIoThreadPoke(PISCSIIMAGE pImage) 3136 3091 { 3137 return pImage->pI nterfaceNetCallbacks->pfnPoke(pImage->Socket);3092 return pImage->pIfNet->pfnPoke(pImage->Socket); 3138 3093 } 3139 3094 … … 3643 3598 3644 3599 /* Continue I/O context. */ 3645 pImage->pI nterfaceIoCallbacks->pfnIoCtxCompleted(pImage->pInterfaceIo->pvUser,3646 3647 3600 pImage->pIfIo->pfnIoCtxCompleted(pImage->pIfIo->Core.pvUser, 3601 pReqAsync->pIoCtx, rcReq, 3602 cbTransfered); 3648 3603 3649 3604 RTMemFree(pScsiReq); … … 3687 3642 if (pImage->Socket != NIL_VDSOCKET) 3688 3643 { 3689 pImage->pI nterfaceNetCallbacks->pfnSocketDestroy(pImage->Socket);3644 pImage->pIfNet->pfnSocketDestroy(pImage->Socket); 3690 3645 } 3691 3646 if (pImage->MutexReqQueue != NIL_RTSEMMUTEX) … … 3763 3718 3764 3719 /* 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); 3768 3721 3769 3722 /* 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")); 3777 3728 goto out; 3778 3729 } 3779 3730 3780 3731 /* 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")); 3788 3737 goto out; 3789 3738 } 3790 3739 3791 3740 /* 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")); 3799 3746 goto out; 3800 3747 } … … 3822 3769 3823 3770 /* Validate configuration, detect unknown keys. */ 3824 if (!VDCFGAreKeysValid(pImage->pInterfaceConfigCallbacks, 3825 pImage->pInterfaceConfig->pvUser, 3771 if (!VDCFGAreKeysValid(pImage->pIfConfig, 3826 3772 "TargetName\0InitiatorName\0LUN\0TargetAddress\0InitiatorUsername\0InitiatorSecret\0TargetUsername\0TargetSecret\0WriteSplit\0Timeout\0HostIPStack\0")) 3827 3773 { 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")); 3829 3775 goto out; 3830 3776 } 3831 3777 3832 3778 /* Query the iSCSI upper level configuration. */ 3833 rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks, 3834 pImage->pInterfaceConfig->pvUser, 3779 rc = VDCFGQueryStringAlloc(pImage->pIfConfig, 3835 3780 "TargetName", &pImage->pszTargetName); 3836 3781 if (RT_FAILURE(rc)) 3837 3782 { 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")); 3839 3784 goto out; 3840 3785 } 3841 rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks, 3842 pImage->pInterfaceConfig->pvUser, 3786 rc = VDCFGQueryStringAlloc(pImage->pIfConfig, 3843 3787 "InitiatorName", &pImage->pszInitiatorName); 3844 3788 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT) … … 3849 3793 if (RT_FAILURE(rc)) 3850 3794 { 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")); 3852 3796 goto out; 3853 3797 } 3854 rc = VDCFGQueryStringAllocDef(pImage->pInterfaceConfigCallbacks, 3855 pImage->pInterfaceConfig->pvUser, 3798 rc = VDCFGQueryStringAllocDef(pImage->pIfConfig, 3856 3799 "LUN", &pszLUN, s_iscsiConfigDefaultLUN); 3857 3800 if (RT_FAILURE(rc)) 3858 3801 { 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")); 3860 3803 goto out; 3861 3804 } … … 3869 3812 if (RT_FAILURE(rc)) 3870 3813 { 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")); 3872 3815 goto out; 3873 3816 } … … 3885 3828 { 3886 3829 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)")); 3888 3831 goto out; 3889 3832 } 3890 3833 } 3891 rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks, 3892 pImage->pInterfaceConfig->pvUser, 3834 rc = VDCFGQueryStringAlloc(pImage->pIfConfig, 3893 3835 "TargetAddress", &pImage->pszTargetAddress); 3894 3836 if (RT_FAILURE(rc)) 3895 3837 { 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")); 3897 3839 goto out; 3898 3840 } 3899 3841 pImage->pszInitiatorUsername = NULL; 3900 rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks, 3901 pImage->pInterfaceConfig->pvUser, 3842 rc = VDCFGQueryStringAlloc(pImage->pIfConfig, 3902 3843 "InitiatorUsername", 3903 3844 &pImage->pszInitiatorUsername); … … 3906 3847 if (RT_FAILURE(rc)) 3907 3848 { 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")); 3909 3850 goto out; 3910 3851 } 3911 3852 pImage->pbInitiatorSecret = NULL; 3912 3853 pImage->cbInitiatorSecret = 0; 3913 rc = VDCFGQueryBytesAlloc(pImage->pInterfaceConfigCallbacks, 3914 pImage->pInterfaceConfig->pvUser, 3854 rc = VDCFGQueryBytesAlloc(pImage->pIfConfig, 3915 3855 "InitiatorSecret", 3916 3856 (void **)&pImage->pbInitiatorSecret, … … 3920 3860 if (RT_FAILURE(rc)) 3921 3861 { 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")); 3923 3863 goto out; 3924 3864 } 3925 3865 pImage->pszTargetUsername = NULL; 3926 rc = VDCFGQueryStringAlloc(pImage->pInterfaceConfigCallbacks, 3927 pImage->pInterfaceConfig->pvUser, 3866 rc = VDCFGQueryStringAlloc(pImage->pIfConfig, 3928 3867 "TargetUsername", 3929 3868 &pImage->pszTargetUsername); … … 3932 3871 if (RT_FAILURE(rc)) 3933 3872 { 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")); 3935 3874 goto out; 3936 3875 } 3937 3876 pImage->pbTargetSecret = NULL; 3938 3877 pImage->cbTargetSecret = 0; 3939 rc = VDCFGQueryBytesAlloc(pImage->pInterfaceConfigCallbacks, 3940 pImage->pInterfaceConfig->pvUser, 3878 rc = VDCFGQueryBytesAlloc(pImage->pIfConfig, 3941 3879 "TargetSecret", (void **)&pImage->pbTargetSecret, 3942 3880 &pImage->cbTargetSecret); … … 3945 3883 if (RT_FAILURE(rc)) 3946 3884 { 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")); 3948 3886 goto out; 3949 3887 } 3950 rc = VDCFGQueryU32Def(pImage->pInterfaceConfigCallbacks, 3951 pImage->pInterfaceConfig->pvUser, 3888 rc = VDCFGQueryU32Def(pImage->pIfConfig, 3952 3889 "WriteSplit", &pImage->cbWriteSplit, 3953 3890 uWriteSplitDef); 3954 3891 if (RT_FAILURE(rc)) 3955 3892 { 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")); 3957 3894 goto out; 3958 3895 } … … 3962 3899 pImage->Socket = NIL_VDSOCKET; 3963 3900 /* Query the iSCSI lower level configuration. */ 3964 rc = VDCFGQueryU32Def(pImage->pInterfaceConfigCallbacks, 3965 pImage->pInterfaceConfig->pvUser, 3901 rc = VDCFGQueryU32Def(pImage->pIfConfig, 3966 3902 "Timeout", &pImage->uReadTimeout, 3967 3903 uTimeoutDef); 3968 3904 if (RT_FAILURE(rc)) 3969 3905 { 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")); 3971 3907 goto out; 3972 3908 } 3973 rc = VDCFGQueryBoolDef(pImage->pInterfaceConfigCallbacks, 3974 pImage->pInterfaceConfig->pvUser, 3909 rc = VDCFGQueryBoolDef(pImage->pIfConfig, 3975 3910 "HostIPStack", &pImage->fHostIP, 3976 3911 fHostIPDef); 3977 3912 if (RT_FAILURE(rc)) 3978 3913 { 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")); 3980 3915 goto out; 3981 3916 } … … 3995 3930 3996 3931 /* Create the socket structure. */ 3997 rc = pImage->pI nterfaceNetCallbacks->pfnSocketCreate(VD_INTERFACETCPNET_CONNECT_EXTENDED_SELECT,3998 3932 rc = pImage->pIfNet->pfnSocketCreate(VD_INTERFACETCPNET_CONNECT_EXTENDED_SELECT, 3933 &pImage->Socket); 3999 3934 if (RT_SUCCESS(rc)) 4000 3935 { … … 4020 3955 { 4021 3956 pImage->fExtendedSelectSupported = false; 4022 rc = pImage->pI nterfaceNetCallbacks->pfnSocketCreate(0, &pImage->Socket);3957 rc = pImage->pIfNet->pfnSocketCreate(0, &pImage->Socket); 4023 3958 if (RT_FAILURE(rc)) 4024 3959 { … … 4124 4059 if (devType != SCSI_DEVTYPE_DISK) 4125 4060 { 4126 rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,4061 rc = vdIfError(pImage->pIfError, VERR_VD_ISCSI_INVALID_TYPE, 4127 4062 RT_SRC_POS, N_("iSCSI: target address %s, target name %s, SCSI LUN %lld reports device type=%u"), 4128 4063 pImage->pszTargetAddress, pImage->pszTargetName, … … 4230 4165 if (pImage->cVolume == 0 || pImage->cbSector != 512 || pImage->cbSize < pImage->cVolume) 4231 4166 { 4232 rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,4233 4234 4235 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); 4236 4171 } 4237 4172 } … … 4276 4211 if (pImage->cVolume == 0 || pImage->cbSector != 512) 4277 4212 { 4278 rc = iscsiError(pImage, VERR_VD_ISCSI_INVALID_TYPE,4279 4280 4281 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); 4282 4217 } 4283 4218 } … … 5172 5107 { 5173 5108 /** @todo put something useful here */ 5174 iscsiMessage(pImage, "Header: cVolume=%u\n", pImage->cVolume);5109 vdIfErrorMessage(pImage->pIfError, "Header: cVolume=%u\n", pImage->cVolume); 5175 5110 } 5176 5111 } … … 5197 5132 5198 5133 /* Get the number of segments. */ 5199 cbSegs = pImage->pI nterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,5200 5134 cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx, 5135 NULL, &cT2ISegs, cbToRead); 5201 5136 Assert(cbSegs == cbToRead); 5202 5137 … … 5215 5150 tls = (uint16_t)(cbToRead / pImage->cbSector); 5216 5151 5217 cbSegs = pImage->pI nterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,5218 5219 5152 cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx, 5153 &pReqAsync->aSegs[0], 5154 &cT2ISegs, cbToRead); 5220 5155 Assert(cbSegs == cbToRead); 5221 5156 pReqAsync->cT2ISegs = cT2ISegs; … … 5322 5257 5323 5258 /* Get the number of segments. */ 5324 cbSegs = pImage->pI nterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,5325 5259 cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx, 5260 NULL, &cI2TSegs, cbToWrite); 5326 5261 Assert(cbSegs == cbToWrite); 5327 5262 … … 5340 5275 tls = (uint16_t)(cbToWrite / pImage->cbSector); 5341 5276 5342 cbSegs = pImage->pI nterfaceIoCallbacks->pfnIoCtxSegArrayCreate(pImage->pInterfaceIo->pvUser, pIoCtx,5343 5344 5277 cbSegs = pImage->pIfIo->pfnIoCtxSegArrayCreate(pImage->pIfIo->Core.pvUser, pIoCtx, 5278 &pReqAsync->aSegs[0], 5279 &cI2TSegs, cbToWrite); 5345 5280 Assert(cbSegs == cbToWrite); 5346 5281 pReqAsync->cI2TSegs = cI2TSegs; … … 5489 5424 char *pszLUN = NULL; 5490 5425 char *pszAddress = NULL; 5491 int rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "TargetName", &pszTarget);5426 int rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetName", &pszTarget); 5492 5427 if (RT_SUCCESS(rc)) 5493 5428 { 5494 rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "LUN", &pszLUN);5429 rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "LUN", &pszLUN); 5495 5430 if (RT_SUCCESS(rc)) 5496 5431 { 5497 rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "TargetAddress", &pszAddress);5432 rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetAddress", &pszAddress); 5498 5433 if (RT_SUCCESS(rc)) 5499 5434 { … … 5516 5451 char *pszLUN = NULL; 5517 5452 char *pszAddress = NULL; 5518 int rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "TargetName", &pszTarget);5453 int rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetName", &pszTarget); 5519 5454 if (RT_SUCCESS(rc)) 5520 5455 { 5521 rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "LUN", &pszLUN);5456 rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "LUN", &pszLUN); 5522 5457 if (RT_SUCCESS(rc)) 5523 5458 { 5524 rc = VDCFGQueryStringAlloc(VD GetInterfaceConfig(pConfig), pConfig->pvUser, "TargetAddress", &pszAddress);5459 rc = VDCFGQueryStringAlloc(VDIfConfigGet(pConfig), "TargetAddress", &pszAddress); 5525 5460 if (RT_SUCCESS(rc)) 5526 5461 {
Note:
See TracChangeset
for help on using the changeset viewer.