VirtualBox

Changeset 100779 in vbox


Ignore:
Timestamp:
Aug 2, 2023 1:39:17 PM (16 months ago)
Author:
vboxsync
Message:

DrvVUSBRootHub: Don't arm a re-attach timer in vusbR3RhLoadDone when saved state loading failed, just re-attach immediately so it won't cause trouble later during VM termination & cleanup. bugref:10494

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdrv.h

    r99739 r100779  
    18271827
    18281828/**
     1829 * Get the status of an saved state operation.
     1830 *
     1831 * This can sometimes be useful in FNSSMDRVLOADDONE implementations to determine
     1832 * whether the load succeeded or not.
     1833 *
     1834 * @returns VBox status.
     1835 * @param   pDrvIns         Driver instance.
     1836 * @param   pSSM            The saved state handle.
     1837 * @sa      SSMR3HandleGetStatus
     1838 */
     1839DECLINLINE(int) PDMDrvHlpSSMHandleGetStatus(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM)
     1840{
     1841    return pDrvIns->pHlpR3->pfnSSMHandleGetStatus(pSSM);
     1842}
     1843
     1844/**
    18291845 * @copydoc PDMDRVHLPR3::pfnMMHeapFree
    18301846 */
  • trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp

    r100776 r100779  
    15131513    if (pLoad)
    15141514    {
    1515         int rc = PDMDrvHlpTMTimerCreate(pDrvIns, TMCLOCK_VIRTUAL, vusbR3RhLoadReattachDevices, NULL,
     1515        int rc = PDMDrvHlpSSMHandleGetStatus(pDrvIns, pSSM);
     1516        if (RT_SUCCESS(rc))
     1517        {
     1518            rc = PDMDrvHlpTMTimerCreate(pDrvIns, TMCLOCK_VIRTUAL, vusbR3RhLoadReattachDevices, NULL,
    15161519                                        TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_NO_RING0,
    15171520                                        "VUSB reattach on load", &pLoad->hTimer);
    1518         AssertLogRelRC(rc);
    1519         if (RT_SUCCESS(rc))
    1520             rc = PDMDrvHlpTimerSetMillies(pDrvIns, pLoad->hTimer, 250);
     1521            AssertLogRelRC(rc);
     1522            if (RT_SUCCESS(rc))
     1523            {
     1524                rc = PDMDrvHlpTimerSetMillies(pDrvIns, pLoad->hTimer, 250);
     1525                if (RT_SUCCESS(rc))
     1526                    return VINF_SUCCESS;
     1527            }
     1528        }
    15211529        else
    1522             vushR3RhFreeLoadData(pThis, pDrvIns); /** @todo or call vusbR3RhLoadReattachDevices directly then fail? */
     1530            rc = VINF_SUCCESS;
     1531        vushR3RhFreeLoadData(pThis, pDrvIns); /** @todo or call vusbR3RhLoadReattachDevices directly then fail? */
    15231532        return rc;
    15241533    }
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