VirtualBox

Changeset 43625 in vbox


Ignore:
Timestamp:
Oct 11, 2012 8:56:27 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81345
Message:

Bug fixes

File:
1 edited

Legend:

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

    r43623 r43625  
    8383static const DBGCCMD g_aCmds[] =
    8484{
    85     /* pszCmd,       cArgsMin, cArgsMax, paArgDesc,                cArgDescs, fFlags, pfnHandler              pszSyntax, ....pszDescription */
    86     { "injecterror",        3, 3,        &g_aInjectErrorArgs[0],           3,      0, pdmacEpFileErrorInject, "",        "Inject error into I/O subsystem." }
     85    /* pszCmd,       cArgsMin, cArgsMax, paArgDesc,                                    cArgDescs, fFlags, pfnHandler              pszSyntax,.pszDescription */
     86    { "injecterror",        3, 3,        &g_aInjectErrorArgs[0],                               3,      0, pdmacEpFileErrorInject, "",        "Inject error into I/O subsystem." }
    8787# ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
    88     ,{ "injectdelay",        4, 4,        &g_aInjectDelayArgs[0],           4,      0, pdmacEpFileDelayInject, "",        "Inject a delay of a request." }
     88    ,{ "injectdelay",       3, 5,        &g_aInjectDelayArgs[0], RT_ELEMENTS(g_aInjectDelayArgs),      0, pdmacEpFileDelayInject, "",        "Inject a delay of a request." }
    8989# endif
    9090};
     
    340340                && ASMAtomicReadU32(&pEpFile->cReqsDelay) > 0)
    341341            {
    342                 uint64_t tsDelay = (RTRandU32() % 100) > 50 ? pEpFile->msDelay + (RTRandU32() % pEpFile->msJitter)
    343                                                             : pEpFile->msDelay - (RTRandU32() % pEpFile->msJitter);
     342                uint64_t tsDelay = pEpFile->msDelay;
     343
     344                if (pEpFile->msJitter)
     345                    tsDelay = (RTRandU32() % 100) > 50 ? pEpFile->msDelay + (RTRandU32() % pEpFile->msJitter)
     346                                                       : pEpFile->msDelay - (RTRandU32() % pEpFile->msJitter);
    344347                ASMAtomicDecU32(&pEpFile->cReqsDelay);
    345348
     
    709712    uint32_t cReqsDelay = 1;
    710713    uint32_t msJitter = 0;
    711     if (cArgs == 4)
     714    if (cArgs >= 4)
    712715        msJitter = (uint32_t)pArgs[3].u.u64Number;
    713716    if (cArgs == 5)
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