VirtualBox

Changeset 28827 in vbox for trunk/src


Ignore:
Timestamp:
Apr 27, 2010 1:55:04 PM (15 years ago)
Author:
vboxsync
Message:

Storage/iSCSI: Error handling fix when connecting to a target. Crashing isn't nice, even if the VM would fail to start anyway.

File:
1 edited

Legend:

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

    r28800 r28827  
    535535
    536536    rc = pImage->pInterfaceNetCallbacks->pfnClientConnect(pImage->pszHostname, pImage->uPort, &pImage->Socket);
    537     if (RT_UNLIKELY(   RT_FAILURE(rc)
    538                     && (   rc == VERR_NET_CONNECTION_REFUSED
    539                         || rc == VERR_NET_CONNECTION_RESET
    540                         || rc == VERR_NET_UNREACHABLE
    541                         || rc == VERR_NET_HOST_UNREACHABLE
    542                         || rc == VERR_NET_CONNECTION_TIMED_OUT)))
    543     {
    544         /* Standardize return value for no connection. */
    545         return VERR_NET_CONNECTION_REFUSED;
     537    if (RT_FAILURE(rc))
     538    {
     539        if (   rc == VERR_NET_CONNECTION_REFUSED
     540            || rc == VERR_NET_CONNECTION_RESET
     541            || rc == VERR_NET_UNREACHABLE
     542            || rc == VERR_NET_HOST_UNREACHABLE
     543            || rc == VERR_NET_CONNECTION_TIMED_OUT)
     544        {
     545            /* Standardize return value for no connection. */
     546            rc = VERR_NET_CONNECTION_REFUSED;
     547        }
     548        return rc;
    546549    }
    547550
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