VirtualBox

Changeset 37688 in vbox


Ignore:
Timestamp:
Jun 29, 2011 3:26:05 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72548
Message:

Storage/iSCSI: log opening and closing of connections, with local port number to ease problem investigation

File:
1 edited

Legend:

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

    r37176 r37688  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    585585    /** Pointer to the target hostname. */
    586586    char                *pszHostname;
    587     /** Pointer to the target hostname. */
     587    /** Port to use on the target host. */
    588588    uint32_t            uPort;
    589589    /** Socket handle of the TCP connection. */
     
    911911            return VERR_NO_MEMORY;
    912912    }
     913    LogRel(("iSCSI: connect from initiator %s with source port %u\n", pImage->pszInitiatorName, pImage->ISID & 65535));
    913914    return VINF_SUCCESS;
     915}
     916
     917
     918static int iscsiTransportClose(PISCSIIMAGE pImage)
     919{
     920    int rc;
     921
     922    LogFlowFunc(("(%s:%d)\n", pImage->pszHostname, pImage->uPort));
     923    if (iscsiIsClientConnected(pImage))
     924    {
     925        LogRel(("iSCSI: disconnect from initiator %s with source port %u\n", pImage->pszInitiatorName, pImage->ISID & 65535));
     926        rc = pImage->pInterfaceNetCallbacks->pfnClientClose(pImage->Socket);
     927    }
     928    else
     929        rc = VINF_SUCCESS;
     930    LogFlowFunc(("returns %Rrc\n", rc));
     931    return rc;
    914932}
    915933
     
    958976            {
    959977                /* The other end has closed the connection. */
    960                 pImage->pInterfaceNetCallbacks->pfnClientClose(pImage->Socket);
     978                iscsiTransportClose(pImage);
    961979                pImage->state = ISCSISTATE_FREE;
    962980                rc = VERR_NET_CONNECTION_RESET;
     
    11161134
    11171135    /* Clean up previous connection data. */
    1118     if (iscsiIsClientConnected(pImage))
    1119     {
    1120         pImage->pInterfaceNetCallbacks->pfnClientClose(pImage->Socket);
    1121     }
     1136    iscsiTransportClose(pImage);
    11221137    if (pImage->pszHostname)
    11231138    {
     
    12071222    }
    12081223
    1209     LogFlowFunc(("returns %Rrc\n", rc));
    1210     return rc;
    1211 }
    1212 
    1213 
    1214 static int iscsiTransportClose(PISCSIIMAGE pImage)
    1215 {
    1216     int rc;
    1217 
    1218     LogFlowFunc(("(%s:%d)\n", pImage->pszHostname, pImage->uPort));
    1219     if (iscsiIsClientConnected(pImage))
    1220     {
    1221         rc = pImage->pInterfaceNetCallbacks->pfnClientClose(pImage->Socket);
    1222     }
    1223     else
    1224         rc = VINF_SUCCESS;
    12251224    LogFlowFunc(("returns %Rrc\n", rc));
    12261225    return rc;
Note: See TracChangeset for help on using the changeset viewer.

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