VirtualBox

Ignore:
Timestamp:
May 24, 2019 12:26:23 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7127: Do not perform whole medium-enumeration if one medium was not found in the tree, just enumerate it and it's children; This speedups VM details processing but is a dangerous one, needs to be carefully tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r78722 r78723  
    25202520}
    25212521
     2522void VBoxGlobal::enumerateAdditionalMedium(const CMedium &comMedium)
     2523{
     2524    /* Make sure VBoxGlobal is already valid: */
     2525    AssertReturnVoid(m_fValid);
     2526    /* Ignore the request during VBoxGlobal cleanup: */
     2527    if (s_fCleaningUp)
     2528        return;
     2529    /* Ignore the request during startup snapshot restoring: */
     2530    if (shouldRestoreCurrentSnapshot())
     2531        return;
     2532
     2533    /* Make sure medium-enumerator is already created: */
     2534    if (!m_pMediumEnumerator)
     2535        return;
     2536
     2537    /* Redirect request to medium-enumerator under proper lock: */
     2538    if (m_meCleanupProtectionToken.tryLockForRead())
     2539    {
     2540        if (m_pMediumEnumerator)
     2541            m_pMediumEnumerator->enumerateAdditionalMedium(comMedium);
     2542        m_meCleanupProtectionToken.unlock();
     2543    }
     2544}
     2545
    25222546void VBoxGlobal::refreshMedia()
    25232547{
     
    33073331    {
    33083332        /* UI medium may be new and not among our media, request enumeration: */
    3309         startMediumEnumeration();
     3333        enumerateAdditionalMedium(comMedium);
    33103334
    33113335        /* Search for corresponding UI medium again: */
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