VirtualBox

Changeset 64409 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 25, 2016 11:54:49 AM (8 years ago)
Author:
vboxsync
Message:

BusLogic,LsiLogic: Implement medium ejected callbacks properly so Main gets notified when the guest ejected a medium

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

Legend:

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

    r64387 r64409  
    453453    /** Partner of ILeds. */
    454454    R3PTRTYPE(PPDMILEDCONNECTORS)   pLedsConnector;
     455    /** Status LUN: Media Notifys. */
     456    R3PTRTYPE(PPDMIMEDIANOTIFY)     pMediaNotify;
    455457
    456458#if HC_ARCH_BITS == 64
     
    14561458 * Copy from guest to host memory worker.
    14571459 *
    1458  * @copydoc{BUSLOGICR3MEMCOPYCALLBACK}
     1460 * @copydoc BUSLOGICR3MEMCOPYCALLBACK
    14591461 */
    14601462static DECLCALLBACK(void) buslogicR3CopyBufferFromGuestWorker(PBUSLOGIC pThis, RTGCPHYS GCPhys, PRTSGBUF pSgBuf,
     
    14811483 * Copy from host to guest memory worker.
    14821484 *
    1483  * @copydoc{BUSLOGICR3MEMCOPYCALLBACK}
     1485 * @copydoc BUSLOGICR3MEMCOPYCALLBACK
    14841486 */
    14851487static DECLCALLBACK(void) buslogicR3CopyBufferToGuestWorker(PBUSLOGIC pThis, RTGCPHYS GCPhys, PRTSGBUF pSgBuf,
     
    29952997    PBUSLOGIC pThis = pTgtDev->CTX_SUFF(pBusLogic);
    29962998
    2997     RT_NOREF(pThis); /** @todo */
     2999    if (pThis->pMediaNotify)
     3000    {
     3001        int rc = VMR3ReqCallNoWait(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), VMCPUID_ANY,
     3002                                   (PFNRT)pThis->pMediaNotify->pfnEjected, 2,
     3003                                   pThis->pMediaNotify, pTgtDev->iLUN);
     3004        AssertRC(rc);
     3005    }
    29983006}
    29993007
     
    41844192    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    41854193    if (RT_SUCCESS(rc))
     4194    {
    41864195        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
     4196        pThis->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIANOTIFY);
     4197    }
    41874198    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    41884199    {
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r64391 r64409  
    343343    /** Status LUN: Partner of ILeds. */
    344344    R3PTRTYPE(PPDMILEDCONNECTORS)  pLedsConnector;
     345    /** Status LUN: Media Notifys. */
     346    R3PTRTYPE(PPDMIMEDIANOTIFY)    pMediaNotify;
    345347    /** Pointer to the configuration page area. */
    346348    R3PTRTYPE(PMptConfigurationPagesSupported) pConfigurationPages;
     
    18611863 * Copy from guest to host memory worker.
    18621864 *
    1863  * @copydoc{LSILOGICR3MEMCOPYCALLBACK}
     1865 * @copydoc LSILOGICR3MEMCOPYCALLBACK
    18641866 */
    18651867static DECLCALLBACK(void) lsilogicR3CopyBufferFromGuestWorker(PLSILOGICSCSI pThis, RTGCPHYS GCPhys, PRTSGBUF pSgBuf,
     
    18861888 * Copy from host to guest memory worker.
    18871889 *
    1888  * @copydoc{LSILOGICR3MEMCOPYCALLBACK}
     1890 * @copydoc LSILOGICR3MEMCOPYCALLBACK
    18891891 */
    18901892static DECLCALLBACK(void) lsilogicR3CopyBufferToGuestWorker(PLSILOGICSCSI pThis, RTGCPHYS GCPhys, PRTSGBUF pSgBuf,
     
    24172419    PLSILOGICSCSI pThis = pTgtDev->CTX_SUFF(pLsiLogic);
    24182420
    2419     RT_NOREF(pThis); /** @todo */
     2421    if (pThis->pMediaNotify)
     2422    {
     2423        int rc = VMR3ReqCallNoWait(PDMDevHlpGetVM(pThis->CTX_SUFF(pDevIns)), VMCPUID_ANY,
     2424                                   (PFNRT)pThis->pMediaNotify->pfnEjected, 2,
     2425                                   pThis->pMediaNotify, pTgtDev->iLUN);
     2426        AssertRC(rc);
     2427    }
    24202428}
    24212429
     
    56195627    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    56205628    if (RT_SUCCESS(rc))
     5629    {
    56215630        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
     5631        pThis->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIANOTIFY);
     5632    }
    56225633    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    56235634    {
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp

    r64395 r64409  
    17811781    GEN_CHECK_OFF(BUSLOGIC, ILeds);
    17821782    GEN_CHECK_OFF(BUSLOGIC, pLedsConnector);
     1783    GEN_CHECK_OFF(BUSLOGIC, pMediaNotify);
    17831784    GEN_CHECK_OFF(BUSLOGIC, fSignalIdle);
    17841785    GEN_CHECK_OFF(BUSLOGIC, fWrkThreadSleeping);
     
    18561857    GEN_CHECK_OFF(LSILOGICSCSI, ILeds);
    18571858    GEN_CHECK_OFF(LSILOGICSCSI, pLedsConnector);
     1859    GEN_CHECK_OFF(LSILOGICSCSI, pMediaNotify);
    18581860    GEN_CHECK_OFF(LSILOGICSCSI, pConfigurationPages);
    18591861    GEN_CHECK_OFF(LSILOGICSCSI, 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