Changeset 24104 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 27, 2009 12:15:45 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r24101 r24104 803 803 804 804 /** 805 * @copydoc FNPDMDRVRESET806 * /807 static DECLCALLBACK(void) drvscsiReset(PPDMDRVINS pDrvIns) 808 { 809 PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);810 int rc; 811 805 * Worker for drvscsiReset, drvscsiSuspend and drvscsiPowerOff. 806 * 807 * @param pThis The instance data. 808 * @param pszEvent The notification event (for logging). 809 */ 810 static void drvscsiWaitForPendingRequests(PDRVSCSI pThis, const char *pszEvent) 811 { 812 812 /* 813 813 * Try make sure any pending I/O has completed now. … … 817 817 if (!drvscsiAsyncIOLoopNoPendingDummy(pThis, 20000 /*ms*/)) 818 818 { 819 LogRel(("drvscsi Reset#%u: previous dummy request is still pending\n",pDrvIns->iInstance));819 LogRel(("drvscsi%s#%u: previous dummy request is still pending\n", pszEvent, pThis->pDrvIns->iInstance)); 820 820 return; 821 821 } … … 824 824 { 825 825 PRTREQ pReq; 826 rc = RTReqCall(pThis->pQueueRequests, &pReq, 20000 /*ms*/, (PFNRT)drvscsiAsyncIOLoopSyncCallback, 0);826 int rc = RTReqCall(pThis->pQueueRequests, &pReq, 20000 /*ms*/, (PFNRT)drvscsiAsyncIOLoopSyncCallback, 0); 827 827 if (RT_SUCCESS(rc)) 828 828 RTReqFree(pReq); … … 830 830 { 831 831 pThis->pPendingDummyReq = pReq; 832 LogRel(("drvscsi Reset#%u: %Rrc pReq=%p\n",pDrvIns->iInstance, rc, pReq));832 LogRel(("drvscsi%s#%u: %Rrc pReq=%p\n", pszEvent, pThis->pDrvIns->iInstance, rc, pReq)); 833 833 } 834 834 } … … 847 847 * wee bit... 848 848 */ 849 } 850 851 /** 852 * @copydoc FNPDMDRVPOWEROFF 853 */ 854 static DECLCALLBACK(void) drvscsiPowerOff(PPDMDRVINS pDrvIns) 855 { 856 PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI); 857 drvscsiWaitForPendingRequests(pThis, "PowerOff"); 858 } 859 860 /** 861 * @copydoc FNPDMDRVSUSPEND 862 */ 863 static DECLCALLBACK(void) drvscsiSuspend(PPDMDRVINS pDrvIns) 864 { 865 PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI); 866 drvscsiWaitForPendingRequests(pThis, "Suspend"); 867 } 868 869 /** 870 * @copydoc FNPDMDRVRESET 871 */ 872 static DECLCALLBACK(void) drvscsiReset(PPDMDRVINS pDrvIns) 873 { 874 PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI); 875 drvscsiWaitForPendingRequests(pThis, "Reset"); 849 876 } 850 877 … … 990 1017 drvscsiReset, 991 1018 /* pfnSuspend */ 992 NULL,1019 drvscsiSuspend, 993 1020 /* pfnResume */ 994 1021 NULL, … … 998 1025 NULL, 999 1026 /* pfnPowerOff */ 1000 NULL,1027 drvscsiPowerOff, 1001 1028 /* pfnSoftReset */ 1002 1029 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.