VirtualBox

Changeset 27665 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 24, 2010 12:33:33 PM (15 years ago)
Author:
vboxsync
Message:

SCSI: Cleanup during destruction

Location:
trunk/src/VBox/Devices/Storage
Files:
3 edited

Legend:

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

    r27664 r27665  
    550550        AssertMsgRC(rc, ("Failed to destroy queue rc=%Rrc\n", rc));
    551551    }
     552
     553    /* Free the VSCSI device and LUN handle. */
     554    VSCSILUN hVScsiLun;
     555    int rc = VSCSIDeviceLunDetach(pThis->hVScsiDevice, 0, &hVScsiLun);
     556    AssertRC(rc);
     557
     558    Assert(hVScsiLun == pThis->hVScsiLun);
     559    rc = VSCSILunDestroy(hVScsiLun);
     560    AssertRC(rc);
     561    rc = VSCSIDeviceDestroy(pThis->hVScsiDevice);
     562    AssertRC(rc);
    552563}
    553564
  • trunk/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp

    r27659 r27665  
    240240    AssertPtrReturn(pVScsiDevice->papVScsiLun[iLun], VERR_VSCSI_LUN_NOT_ATTACHED);
    241241
    242     *phVScsiLun = pVScsiDevice->papVScsiLun[iLun];
     242    PVSCSILUNINT pVScsiLun = pVScsiDevice->papVScsiLun[iLun];
     243
     244    pVScsiLun->pVScsiDevice = NULL;
     245    *phVScsiLun = pVScsiLun;
    243246    pVScsiDevice->papVScsiLun[iLun] = NULL;
    244247    pVScsiDevice->cLunsAttached--;
  • trunk/src/VBox/Devices/Storage/VSCSI/VSCSILun.cpp

    r27653 r27665  
    100100    AssertPtrReturn(pVScsiLun, VERR_INVALID_HANDLE);
    101101    AssertReturn(!pVScsiLun->pVScsiDevice, VERR_VSCSI_LUN_ATTACHED_TO_DEVICE);
    102     AssertReturn(vscsiIoReqOutstandingCountGet(pVScsiLun) != 0, VERR_VSCSI_LUN_BUSY);
     102    AssertReturn(vscsiIoReqOutstandingCountGet(pVScsiLun) == 0, VERR_VSCSI_LUN_BUSY);
    103103
    104104    int rc = pVScsiLun->pVScsiLunDesc->pfnVScsiLunDestroy(pVScsiLun);
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