VirtualBox

Changeset 33097 in vbox for trunk/src


Ignore:
Timestamp:
Oct 13, 2010 11:53:15 AM (14 years ago)
Author:
vboxsync
Message:

BusLogic: Revert unwanted commit

File:
1 edited

Legend:

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

    r33096 r33097  
    259259#pragma pack()
    260260
    261 /** Pointer to a task state. */
    262 typedef struct BUSLOGICTASKSTATE *PBUSLOGICTASKSTATE;
    263 
    264261/**
    265262 * Main BusLogic device state.
     
    394391     * a port is entering the idle state. */
    395392    bool volatile                   fSignalIdle;
    396     /** Flag whether we have tasks which need to be processed again- */
    397     bool volatile                   fRedo;
    398     /** List of tasks which can be redone. */
    399     R3PTRTYPE(volatile PBUSLOGICTASKSTATE) pTasksRedoHead;
    400393
    401394} BUSLOGIC, *PBUSLOGIC;
     
    744737typedef struct BUSLOGICTASKSTATE
    745738{
    746     /** Pointer to the next task to redo. */
    747     PBUSLOGICTASKSTATE         pTaskRedoNext;
    748739    /** Device this task is assigned to. */
    749     R3PTRTYPE(PBUSLOGICDEVICE) pTargetDeviceR3;
     740    R3PTRTYPE(PBUSLOGICDEVICE)     pTargetDeviceR3;
    750741    /** The command control block from the guest. */
    751     CommandControlBlock        CommandControlBlockGuest;
     742    CommandControlBlock CommandControlBlockGuest;
    752743    /** Mailbox read from guest memory. */
    753     Mailbox                    MailboxGuest;
     744    Mailbox             MailboxGuest;
    754745    /** The SCSI request we pass to the underlying SCSI engine. */
    755     PDMSCSIREQUEST             PDMScsiRequest;
     746    PDMSCSIREQUEST      PDMScsiRequest;
    756747    /** Data buffer segment */
    757     RTSGSEG                    DataSeg;
     748    RTSGSEG             DataSeg;
    758749    /** Pointer to the R3 sense buffer. */
    759     uint8_t                   *pbSenseBuffer;
     750    uint8_t            *pbSenseBuffer;
    760751    /** Flag whether this is a request from the BIOS. */
    761     bool                       fBIOS;
    762 } BUSLOGICTASKSTATE;
     752    bool                fBIOS;
     753} BUSLOGICTASKSTATE, *PBUSLOGICTASKSTATE;
    763754
    764755#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     
    18701861        rc = pTaskState->CTX_SUFF(pTargetDevice)->pDrvSCSIConnector->pfnSCSIRequestSend(pTaskState->CTX_SUFF(pTargetDevice)->pDrvSCSIConnector,
    18711862                                                                                        &pTaskState->PDMScsiRequest);
    1872         AssertMsgRC(rc, ("Sending request to SCSI layer failed rc=%Rrc\n", rc));
    1873 
    1874         if (rc == VINF_VD_ASYNC_IO_FINISHED)
    1875         {
    1876             vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, &pTaskState->PDMScsiRequest);
    1877             RTMemCacheFree(pBusLogic->hTaskCache, pTaskState);
    1878             rc = VINF_SUCCESS;
    1879         }
     1863        AssertMsgRCReturn(rc, ("Sending request to SCSI layer failed rc=%Rrc\n", rc), rc);
    18801864    }
    18811865
     
    20292013}
    20302014
    2031 static void buslogicWarningDiskFull(PPDMDEVINS pDevIns)
    2032 {
    2033     int rc;
    2034     LogRel(("BusLogic#%d: Host disk full\n", pDevIns->iInstance));
    2035     rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevBusLogic_DISKFULL",
    2036                                     N_("Host system reported disk full. VM execution is suspended. You can resume after freeing some space"));
    2037     AssertRC(rc);
    2038 }
    2039 
    2040 static void buslogicWarningFileTooBig(PPDMDEVINS pDevIns)
    2041 {
    2042     int rc;
    2043     LogRel(("BusLogic#%d: File too big\n", pDevIns->iInstance));
    2044     rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevBusLogic_FILETOOBIG",
    2045                                     N_("Host system reported that the file size limit of the host file system has been exceeded. VM execution is suspended. You need to move your virtual hard disk to a filesystem which allows bigger files"));
    2046     AssertRC(rc);
    2047 }
    2048 
    2049 static void buslogicWarningISCSI(PPDMDEVINS pDevIns)
    2050 {
    2051     int rc;
    2052     LogRel(("BusLogic#%d: iSCSI target unavailable\n", pDevIns->iInstance));
    2053     rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevBusLogic_ISCSIDOWN",
    2054                                     N_("The iSCSI target has stopped responding. VM execution is suspended. You can resume when it is available again"));
    2055     AssertRC(rc);
    2056 }
    2057 
    2058 static void buslogicWarningUnknown(PPDMDEVINS pDevIns, int rc)
    2059 {
    2060     int rc2;
    2061     LogRel(("BusLogic#%d: Unknown but recoverable error has occurred (rc=%Rrc)\n", pDevIns->iInstance, rc));
    2062     rc2 = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevBusLogic_UNKNOWN",
    2063                                      N_("An unknown but recoverable I/O error has occurred (rc=%Rrc). VM execution is suspended. You can resume when the error is fixed"), rc);
    2064     AssertRC(rc2);
    2065 }
    2066 
    2067 static void buslogicRedoSetWarning(PBUSLOGIC pThis, int rc)
    2068 {
    2069     if (rc == VERR_DISK_FULL)
    2070         buslogicWarningDiskFull(pThis->CTX_SUFF(pDevIns));
    2071     else if (rc == VERR_FILE_TOO_BIG)
    2072         buslogicWarningFileTooBig(pThis->CTX_SUFF(pDevIns));
    2073     else if (rc == VERR_BROKEN_PIPE || rc == VERR_NET_CONNECTION_REFUSED)
    2074     {
    2075         /* iSCSI connection abort (first error) or failure to reestablish
    2076          * connection (second error). Pause VM. On resume we'll retry. */
    2077         buslogicWarningISCSI(pThis->CTX_SUFF(pDevIns));
    2078     }
    2079     else
    2080         buslogicWarningUnknown(pThis->CTX_SUFF(pDevIns), rc);
    2081 }
    2082 
    2083 
    20842015static DECLCALLBACK(int) buslogicDeviceSCSIRequestCompleted(PPDMISCSIPORT pInterface, PPDMSCSIREQUEST pSCSIRequest,
    20852016                                                            int rcCompletion, bool fRedo, int rcReq)
     
    20902021    PBUSLOGIC pBusLogic = pBusLogicDevice->CTX_SUFF(pBusLogic);
    20912022
    2092     if (fRedo)
    2093     {
    2094        
     2023    LogFlowFunc(("before decrement %u\n", pBusLogicDevice->cOutstandingRequests));
     2024    ASMAtomicDecU32(&pBusLogicDevice->cOutstandingRequests);
     2025    LogFlowFunc(("after decrement %u\n", pBusLogicDevice->cOutstandingRequests));
     2026
     2027    if (pTaskState->fBIOS)
     2028    {
     2029        rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, pSCSIRequest);
     2030        AssertMsgRC(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc));
    20952031    }
    20962032    else
    20972033    {
    2098         if (pTaskState->fBIOS)
    2099         {
    2100             rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, pSCSIRequest);
    2101             AssertMsgRC(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc));
    2102         }
    2103         else
    2104         {
    2105             buslogicDataBufferFree(pTaskState);
    2106 
    2107             if (pTaskState->pbSenseBuffer)
    2108                 buslogicSenseBufferFree(pTaskState, (rcCompletion != SCSI_STATUS_OK));
    2109 
    2110             buslogicSendIncomingMailbox(pBusLogic, pTaskState,
    2111                                         BUSLOGIC_MAILBOX_INCOMING_ADAPTER_STATUS_CMD_COMPLETED,
    2112                                         BUSLOGIC_MAILBOX_INCOMING_DEVICE_STATUS_OPERATION_GOOD,
    2113                                         BUSLOGIC_MAILBOX_INCOMING_COMPLETION_WITHOUT_ERROR);
    2114         }
    2115 
    2116         /* Add task to the cache. */
    2117         RTMemCacheFree(pBusLogic->hTaskCache, pTaskState);
    2118     }
    2119 
    2120     ASMAtomicDecU32(&pBusLogicDevice->cOutstandingRequests);
     2034        buslogicDataBufferFree(pTaskState);
     2035
     2036        if (pTaskState->pbSenseBuffer)
     2037            buslogicSenseBufferFree(pTaskState, (rcCompletion != SCSI_STATUS_OK));
     2038
     2039        buslogicSendIncomingMailbox(pBusLogic, pTaskState,
     2040                                    BUSLOGIC_MAILBOX_INCOMING_ADAPTER_STATUS_CMD_COMPLETED,
     2041                                    BUSLOGIC_MAILBOX_INCOMING_DEVICE_STATUS_OPERATION_GOOD,
     2042                                    BUSLOGIC_MAILBOX_INCOMING_COMPLETION_WITHOUT_ERROR);
     2043    }
     2044
     2045    /* Add task to the cache. */
     2046    RTMemCacheFree(pBusLogic->hTaskCache, pTaskState);
    21212047
    21222048    if (pBusLogicDevice->cOutstandingRequests == 0 && pBusLogic->fSignalIdle)
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