VirtualBox

Changeset 6217 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 28, 2007 10:35:14 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27025
Message:

serial: don't overwrite VM errors from the driver

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r6194 r6217  
    858858    {
    859859        AssertMsgFailed(("Serial%d: Failed to attach to char driver. rc=%Vrc\n", iInstance, rc));
    860         return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
    861                                    N_("Serial device %d cannot attach to char driver\n"), iInstance);
     860        /* Don't call VMSetError here as we assume that the driver already set an appropriate error */
     861        return rc;
    862862    }
    863863
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r6087 r6217  
    324324    int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
    325325    if (VBOX_FAILURE(rc))
    326         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Char#%d failed to attach driver below"), pDrvIns->iInstance);
     326        return rc; /* Don't call PDMDrvHlpVMSetError here as we assume that the driver already set an appropriate error */
    327327    pData->pDrvStream = (PPDMISTREAM)pBase->pfnQueryInterface(pBase, PDMINTERFACE_STREAM);
    328328    if (!pData->pDrvStream)
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r6214 r6217  
    405405{
    406406    int rc;
     407    char *pszLocation = NULL;
    407408    PDRVNAMEDPIPE pData = PDMINS2DATA(pDrvIns, PDRVNAMEDPIPE);
    408409
     
    431432     */
    432433    if (!CFGMR3AreValuesValid(pCfgHandle, "Location\0IsServer\0"))
    433         return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    434 
    435     char *pszLocation;
     434    {
     435        rc = VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
     436        goto out;
     437    }
     438
    436439    rc = CFGMR3QueryStringAlloc(pCfgHandle, "Location", &pszLocation);
    437440    if (VBOX_FAILURE(rc))
    438441    {
    439442        AssertMsgFailed(("Configuration error: query \"Location\" resulted in %Vrc.\n", rc));
    440         return rc;
     443        goto out;
    441444    }
    442445    pData->pszLocation = pszLocation;
     
    524527        if (pszLocation)
    525528            MMR3HeapFree(pszLocation);
    526     }
    527     else
    528     {
    529         LogFlow(("drvNamedPipeConstruct: location %s isServer %d\n", pszLocation, fIsServer));
    530         LogRel(("NamedPipe: location %s, %s\n", pszLocation, fIsServer ? "server" : "client"));
    531     }
    532     return rc;
     529        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NamedPipe#%d failed to initialize"), pDrvIns->iInstance);
     530    }
     531
     532    LogFlow(("drvNamedPipeConstruct: location %s isServer %d\n", pszLocation, fIsServer));
     533    LogRel(("NamedPipe: location %s, %s\n", pszLocation, fIsServer ? "server" : "client"));
     534    return VINF_SUCCESS;
    533535}
    534536
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette