VirtualBox

Changeset 66294 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Mar 28, 2017 11:48:21 AM (8 years ago)
Author:
vboxsync
Message:

ExtPackManagerImpl.cpp: Must not hold the extpack manager lock when calling i_areThereAnyRunningVMs() or we trigger a lock order violation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r65120 r66294  
    24372437
    24382438#if !defined(VBOX_COM_INPROC)
     2439
    24392440/**
    24402441 * Refreshes the specified extension pack.
     
    26402641            if (pExtPack && a_fReplace)
    26412642            {
    2642                 if (!i_areThereAnyRunningVMs())
    2643                     hrc = pExtPack->i_callUninstallHookAndClose(m->pVirtualBox, false /*a_ForcedRemoval*/);
    2644                 else
     2643                /* We must leave the lock when calling i_areThereAnyRunningVMs,
     2644                   which means we have to redo the refresh call afterwards. */
     2645                autoLock.release();
     2646                bool fRunningVMs = i_areThereAnyRunningVMs();
     2647                autoLock.acquire();
     2648                hrc = i_refreshExtPack(pStrName->c_str(), false /*a_fUnusableIsError*/, &pExtPack);
     2649                if (fRunningVMs)
    26452650                {
    26462651                    LogRel(("Install extension pack '%s' failed because at least one VM is still running.", pStrName->c_str()));
     
    26482653                                   pStrName->c_str());
    26492654                }
     2655                else if (SUCCEEDED(hrc) && pExtPack)
     2656                    hrc = pExtPack->i_callUninstallHookAndClose(m->pVirtualBox, false /*a_ForcedRemoval*/);
    26502657            }
    26512658            else if (pExtPack)
     
    27432750    AutoCaller autoCaller(this);
    27442751    HRESULT hrc = autoCaller.rc();
    2745 
    27462752    if (SUCCEEDED(hrc))
    27472753    {
    2748         AutoWriteLock autoLock(this COMMA_LOCKVAL_SRC_POS);
    27492754        if (a_fForcedRemoval || !i_areThereAnyRunningVMs())
    27502755        {
     2756            AutoWriteLock autoLock(this COMMA_LOCKVAL_SRC_POS);
     2757
    27512758            /*
    27522759             * Refresh the data we have on the extension pack as it may be made
     
    28182825         */
    28192826        if (m->enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON)
    2820         {
    2821             autoLock.release();
    28222827            i_callAllVirtualBoxReadyHooks();
    2823         }
    28242828    }
    28252829
     
    28522856    }
    28532857}
    2854 #endif
     2858
     2859#endif /* !VBOX_COM_INPROC */
    28552860
    28562861/**
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