VirtualBox

Changeset 30958 in vbox


Ignore:
Timestamp:
Jul 21, 2010 1:17:18 PM (15 years ago)
Author:
vboxsync
Message:

Main/Machine: Move registering the metrics for running VMs from opening the session (too early) to the time when the VM has been actually powered on. Avoids a complicated cross-process deadlock without actually losing functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r30956 r30958  
    53215321    if (SUCCEEDED(rc))
    53225322    {
    5323 #ifdef VBOX_WITH_RESOURCE_USAGE_API
    5324         registerMetrics(mParent->performanceCollector(), this, pid);
    5325 #endif /* VBOX_WITH_RESOURCE_USAGE_API */
    5326 
    53275323        /*
    53285324         *  Set the session state to Spawning to protect against subsequent
     
    99499945        mData->mSession.mProgress->notifyComplete((HRESULT)iResult);
    99509946        mData->mSession.mProgress.setNull();
     9947
     9948        if (SUCCEEDED((HRESULT)iResult))
     9949        {
     9950#ifdef VBOX_WITH_RESOURCE_USAGE_API
     9951            /* The VM has been powered up successfully, so it makes sense
     9952             * now to offer the performance metrics for a running machine
     9953             * object. Doing it earlier wouldn't be safe. */
     9954            registerMetrics(mParent->performanceCollector(), mPeer,
     9955                            mData->mSession.mPid);
     9956#endif /* VBOX_WITH_RESOURCE_USAGE_API */
     9957
     9958        }
    99519959    }
    99529960    return S_OK;
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