VirtualBox

Changeset 81937 in vbox


Ignore:
Timestamp:
Nov 18, 2019 12:11:28 PM (5 years ago)
Author:
vboxsync
Message:

PDMDevice.cpp: Set VM error on device constructor failures when the constructor didn't do it already. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r81841 r81937  
    471471        {
    472472            LogRel(("PDM: Failed to construct '%s'/%d! %Rra\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
    473             paDevs[i].pDev->cInstances--;
     473            if (VMR3GetErrorCount(pVM->pUVM) == 0)
     474                VMSetError(pVM, rc, RT_SRC_POS, "Failed to construct device '%s' instance #%u",
     475                           pDevIns->pReg->szName, pDevIns->iInstance);
    474476            /* Because we're damn lazy, the destructor will be called even if
    475477               the constructor fails.  So, no unlinking. */
     478            paDevs[i].pDev->cInstances--;
    476479            return rc == VERR_VERSION_MISMATCH ? VERR_PDM_DEVICE_VERSION_MISMATCH : rc;
    477480        }
     
    494497            {
    495498                LogRel(("PDM: Failed to construct (ring-0) '%s'/%d! %Rra\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     499                if (VMR3GetErrorCount(pVM->pUVM) == 0)
     500                    VMSetError(pVM, rc, RT_SRC_POS, "The ring-0 constructor of device '%s' instance #%u failed",
     501                               pDevIns->pReg->szName, pDevIns->iInstance);
    496502                paDevs[i].pDev->cInstances--;
    497503                return rc == VERR_VERSION_MISMATCH ? VERR_PDM_DEVICE_VERSION_MISMATCH : rc;
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