Changeset 96137 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 11, 2022 2:35:45 PM (2 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r95645 r96137 5874 5874 * Enables or disables recording of a VM. 5875 5875 * 5876 * @returns IPRT status code. Will return VERR_NO_CHANGE if the recording state has not been changed. 5876 * @returns VBox status code. 5877 * @retval VERR_NO_CHANGE if the recording state has not been changed. 5877 5878 * @param fEnable Whether to enable or disable the recording. 5878 5879 * @param pAutoLock Pointer to auto write lock to use for attaching/detaching required driver(s) at runtime. … … 5909 5910 if (RT_SUCCESS(vrc)) 5910 5911 vrc = mRecording.mAudioRec->doAttachDriverViaEmt(ptrVM.rawUVM(), ptrVM.vtable(), pAutoLock); 5912 5913 if (RT_FAILURE(vrc)) 5914 setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Attaching to audio recording driver failed (%Rrc) -- please consult log file for details"), vrc); 5911 5915 } 5912 5916 # endif … … 5916 5920 vrc = pDisplay->i_recordingInvalidate(); 5917 5921 if (RT_SUCCESS(vrc)) 5922 { 5918 5923 vrc = i_recordingStart(pAutoLock); 5924 if (RT_FAILURE(vrc)) 5925 setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Recording start failed (%Rrc) -- please consult log file for details"), vrc); 5926 } 5919 5927 } 5920 5928 } 5929 else 5930 setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Recording initialization failed (%Rrc) -- please consult log file for details"), vrc); 5921 5931 5922 5932 if (RT_FAILURE(vrc)) … … 5925 5935 else 5926 5936 { 5927 i_recordingStop(pAutoLock); 5937 vrc = i_recordingStop(pAutoLock); 5938 if (RT_SUCCESS(vrc)) 5939 { 5928 5940 # ifdef VBOX_WITH_AUDIO_RECORDING 5929 if (mRecording.mAudioRec)5930 mRecording.mAudioRec->doDetachDriverViaEmt(ptrVM.rawUVM(), ptrVM.vtable(), pAutoLock);5941 if (mRecording.mAudioRec) 5942 mRecording.mAudioRec->doDetachDriverViaEmt(ptrVM.rawUVM(), ptrVM.vtable(), pAutoLock); 5931 5943 # endif 5932 i_recordingDestroy(); 5944 i_recordingDestroy(); 5945 } 5946 else 5947 setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Recording stop failed (%Rrc) -- please consult log file for details"), vrc); 5933 5948 } 5934 5949 } … … 5940 5955 } 5941 5956 else /* Should not happen. */ 5957 { 5942 5958 vrc = VERR_NO_CHANGE; 5959 setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Recording already %s"), fIsEnabled ? tr("enabled") : tr("disabled")); 5960 } 5943 5961 } 5944 5962 … … 5971 5989 ::FireRecordingChangedEvent(mEventSource); 5972 5990 } 5973 5991 else /* Error set via ErrorInfo within i_recordingEnable() already. */ 5992 rc = VBOX_E_IPRT_ERROR; 5974 5993 ptrVM.release(); 5975 5994 } -
trunk/src/VBox/Main/src-client/Recording.cpp
r95645 r96137 198 198 break; 199 199 } 200 catch (int vrc_thrown) /* Catch rc thrown by constructor. */ 201 { 202 vrc = vrc_thrown; 203 break; 204 } 200 205 201 206 ++itScreen; -
trunk/src/VBox/Main/src-server/RecordingSettingsImpl.cpp
r95918 r96137 246 246 const bool fEnabled = RT_BOOL(enable); 247 247 248 HRESULT rc = S_OK;248 HRESULT hrc = S_OK; 249 249 250 250 if (m->bd->fEnabled != fEnabled) … … 255 255 alock.release(); 256 256 257 rc = m->pMachine->i_onRecordingChange(enable); 258 if (FAILED(rc)) 259 { 257 hrc = m->pMachine->i_onRecordingChange(enable); 258 if (FAILED(hrc)) 259 { 260 com::ErrorInfo errMachine; /* Get error info from machine call above. */ 261 260 262 /* 261 263 * Normally we would do the actual change _after_ i_onRecordingChange() succeeded. … … 266 268 alock.acquire(); 267 269 m->bd->fEnabled = m->bd.backedUpData()->fEnabled; 270 271 if (errMachine.isBasicAvailable()) 272 hrc = setError(errMachine); 268 273 } 269 274 else … … 278 283 /** Save settings if online - @todo why is this required? -- @bugref{6818} */ 279 284 if (Global::IsOnline(m->pMachine->i_getMachineState())) 280 rc = m->pMachine->i_saveSettings(NULL, mlock); 281 } 282 } 283 284 return rc; 285 { 286 com::ErrorInfo errMachine; 287 hrc = m->pMachine->i_saveSettings(NULL, mlock); 288 if (FAILED(hrc)) 289 { 290 /* Got error info from machine call above. */ 291 if (errMachine.isBasicAvailable()) 292 hrc = setError(errMachine); 293 } 294 } 295 } 296 } 297 298 return hrc; 285 299 } 286 300
Note:
See TracChangeset
for help on using the changeset viewer.