VirtualBox

Changeset 77814 in vbox for trunk


Ignore:
Timestamp:
Mar 20, 2019 6:38:04 PM (6 years ago)
Author:
vboxsync
Message:

Main/ConsoleImpl.cpp/powerUp: Moved VRDE audio driver attaching and enabling recording to _after_ we've checked that VMR3Create succeeded, as it's begging for deadlocks to do it earlier since both may try talk to EMT (there is no EMT if VMR3Create failed). Also fixed error handling to not use AssertComRCReturnVoid() as that would leave everything dangling in limbo. Completely untested. bugref:9374

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r77370 r77814  
    1013910139                         &pVM, NULL);
    1014010140        alock.acquire();
    10141 
    10142 #ifdef VBOX_WITH_AUDIO_VRDE
    10143         /* Attach the VRDE audio driver. */
    10144         IVRDEServer *pVRDEServer = pConsole->i_getVRDEServer();
    10145         if (pVRDEServer)
    10146         {
    10147             BOOL fVRDEEnabled = FALSE;
    10148             rc = pVRDEServer->COMGETTER(Enabled)(&fVRDEEnabled);
    10149             AssertComRCReturnVoid(rc);
    10150 
    10151             if (   fVRDEEnabled
    10152                 && pConsole->mAudioVRDE)
    10153                 pConsole->mAudioVRDE->doAttachDriverViaEmt(pConsole->mpUVM, &alock);
    10154         }
    10155 #endif
    10156 
    10157         /* Enable client connections to the VRDP server. */
    10158         pConsole->i_consoleVRDPServer()->EnableConnections();
    10159 
    10160 #ifdef VBOX_WITH_RECORDING
    10161         ComPtr<IRecordingSettings> recordingSettings;
    10162         rc = pConsole->mMachine->COMGETTER(RecordingSettings)(recordingSettings.asOutParam());
    10163         AssertComRCReturnVoid(rc);
    10164 
    10165         BOOL fRecordingEnabled;
    10166         rc = recordingSettings->COMGETTER(Enabled)(&fRecordingEnabled);
    10167         AssertComRCReturnVoid(rc);
    10168 
    10169         if (fRecordingEnabled)
    10170         {
    10171             int vrc2 = pConsole->i_recordingEnable(fRecordingEnabled, &alock);
    10172             if (RT_SUCCESS(vrc2))
    10173             {
    10174                 fireRecordingChangedEvent(pConsole->mEventSource);
    10175             }
    10176             else
    10177                LogRel(("Recording: Failed with %Rrc on VM power up\n", vrc2));
    10178 
    10179             /** Note: Do not use vrc here, as starting the video recording isn't critical to
    10180              *        powering up the VM. */
    10181         }
    10182 #endif
    10183 
    1018410141        if (RT_SUCCESS(vrc))
    1018510142        {
     
    1024110198                }
    1024210199
     10200#ifdef VBOX_WITH_AUDIO_VRDE
     10201                /*
     10202                 * Attach the VRDE audio driver.
     10203                 */
     10204                if (pConsole->i_getVRDEServer())
     10205                {
     10206                    BOOL fVRDEEnabled = FALSE;
     10207                    rc = pConsole->i_getVRDEServer()->COMGETTER(Enabled)(&fVRDEEnabled);
     10208                    AssertComRCBreak(rc, RT_NOTHING);
     10209
     10210                    if (   fVRDEEnabled
     10211                        && pConsole->mAudioVRDE)
     10212                        pConsole->mAudioVRDE->doAttachDriverViaEmt(pConsole->mpUVM, &alock);
     10213                }
     10214#endif
     10215
     10216                /*
     10217                 * Enable client connections to the VRDP server.
     10218                 */
     10219                pConsole->i_consoleVRDPServer()->EnableConnections();
     10220
     10221#ifdef VBOX_WITH_RECORDING
     10222                /*
     10223                 * Enable recording if configured.
     10224                 */
     10225                BOOL fRecordingEnabled = FALSE;
     10226                {
     10227                    ComPtr<IRecordingSettings> ptrRecordingSettings;
     10228                    rc = pConsole->mMachine->COMGETTER(RecordingSettings)(ptrRecordingSettings.asOutParam());
     10229                    AssertComRCBreak(rc, RT_NOTHING);
     10230
     10231                    rc = ptrRecordingSettings->COMGETTER(Enabled)(&fRecordingEnabled);
     10232                    AssertComRCBreak(rc, RT_NOTHING);
     10233                }
     10234                if (fRecordingEnabled)
     10235                {
     10236                    vrc = pConsole->i_recordingEnable(fRecordingEnabled, &alock);
     10237                    if (RT_SUCCESS(vrc))
     10238                        fireRecordingChangedEvent(pConsole->mEventSource);
     10239                    else
     10240                    {
     10241                        LogRel(("Recording: Failed with %Rrc on VM power up\n", vrc));
     10242                        vrc = VINF_SUCCESS; /* do not fail with broken recording */
     10243                    }
     10244                }
     10245#endif
     10246
    1024310247                /* release the lock before a lengthy operation */
    1024410248                alock.release();
     
    1025410258                }
    1025510259
    10256                 /* Load saved state? */
     10260                /*
     10261                 * Load saved state?
     10262                 */
    1025710263                if (pTask->mSavedStateFile.length())
    1025810264                {
     
    1026310269                                           Console::i_stateProgressCallback,
    1026410270                                           static_cast<IProgress *>(pTask->mProgress));
    10265 
    1026610271                    if (RT_SUCCESS(vrc))
    1026710272                    {
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