Changeset 68986 in vbox
- Timestamp:
- Oct 4, 2017 2:37:38 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 118254
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmdev.h
r68594 r68986 1878 1878 1879 1879 /** Current PDMDEVHLPR3 version number. */ 1880 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 2 1, 0)1880 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 22, 0) 1881 1881 1882 1882 /** … … 3481 3481 DECLR3CALLBACKMEMBER(PSUPDRVSESSION, pfnGetSupDrvSession,(PPDMDEVINS pDevIns)); 3482 3482 3483 /** 3484 * Queries a generic object from the VMM user. 3485 * 3486 * @returns Pointer to the object if found, NULL if not. 3487 * @param pDevIns The device instance. 3488 * @param pUuid The UUID of what's being queried. The UUIDs and 3489 * the usage conventions are defined by the user. 3490 * 3491 * @note It is strictly forbidden to call this internally in VBox! This 3492 * interface is exclusively for hacks in externally developed devices. 3493 */ 3494 DECLR3CALLBACKMEMBER(void *, pfnQueryGenericUserObject,(PPDMDEVINS pDevIns, PCRTUUID pUuid)); 3495 3483 3496 /** @} */ 3484 3497 … … 5359 5372 } 5360 5373 5374 /** 5375 * @copydoc PDMDEVHLPR3::pfnQueryGenericUserObject 5376 */ 5377 DECLINLINE(void *) PDMDevHlpQueryGenericUserObject(PPDMDEVINS pDevIns, PCRTUUID pUuid) 5378 { 5379 return pDevIns->pHlpR3->pfnQueryGenericUserObject(pDevIns, pUuid); 5380 } 5381 5361 5382 #endif /* IN_RING3 */ 5362 5383 #ifdef IN_RING0 -
trunk/include/VBox/vmm/vmm.h
r68011 r68986 237 237 DECLR3CALLBACKMEMBER(void, pfnNotifyResetTurnedIntoPowerOff,(PCVMM2USERMETHODS pThis, PUVM pUVM)); 238 238 239 /** 240 * Generic object query by UUID. 241 * 242 * @returns pointer to queried the object on success, NULL if not found. 243 * 244 * @param pThis Pointer to the callback method table. 245 * @param pUVM The user mode VM handle. 246 * @param pUuid The UUID of what's being queried. The UUIDs and the 247 * usage conventions are defined by the user. 248 * 249 * @remarks This is optional and shall be set to NULL if not wanted. 250 */ 251 DECLR3CALLBACKMEMBER(void *, pfnQueryGenericObject,(PCVMM2USERMETHODS pThis, PUVM pUVM, PCRTUUID pUuid)); 252 239 253 /** Magic value (VMM2USERMETHODS_MAGIC) marking the end of the structure. */ 240 254 uint32_t u32EndMagic; … … 244 258 #define VMM2USERMETHODS_MAGIC UINT32_C(0x18830703) 245 259 /** The VMM2USERMETHODS structure version. */ 246 #define VMM2USERMETHODS_VERSION UINT32_C(0x000 20001)260 #define VMM2USERMETHODS_VERSION UINT32_C(0x00030000) 247 261 248 262 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r68979 r68986 20350 20350 <desc>Progress object to track the operation completion.</desc> 20351 20351 </param> 20352 <param name="snapshot" type="ISnapshot" dir="in"> 20353 <desc>Snapshot object for which this save state operation is executed.</desc> 20354 </param> 20352 20355 <param name="stateFilePath" type="wstring" dir="in"> 20353 20356 <desc>File path the VM process must save the execution state to.</desc> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r68944 r68986 229 229 HRESULT i_pause(Reason_T aReason); 230 230 HRESULT i_resume(Reason_T aReason, AutoWriteLock &alock); 231 HRESULT i_saveState(Reason_T aReason, const ComPtr<IProgress> &aProgress, const Utf8Str &aStateFilePath, bool fPauseVM, bool &fLeftPaused); 231 HRESULT i_saveState(Reason_T aReason, const ComPtr<IProgress> &aProgress, 232 const ComPtr<ISnapshot> &aSnapshot, 233 const Utf8Str &aStateFilePath, bool fPauseVM, bool &fLeftPaused); 232 234 HRESULT i_cancelSaveState(); 233 235 … … 777 779 static DECLCALLBACK(void) i_vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM); 778 780 static DECLCALLBACK(void) i_vmm2User_NotifyResetTurnedIntoPowerOff(PCVMM2USERMETHODS pThis, PUVM pUVM); 781 static DECLCALLBACK(void *) i_vmm2User_QueryGenericObject(PCVMM2USERMETHODS pThis, PUVM pUVM, PCRTUUID pUuid); 779 782 780 783 static DECLCALLBACK(void *) i_drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID); … … 909 912 { 910 913 Console *pConsole; 914 /** The in-progress snapshot. */ 915 ISnapshot *pISnapshot; 911 916 } *mpVmm2UserMethods; 912 917 -
trunk/src/VBox/Main/include/SessionImpl.h
r68485 r68986 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 137 137 HRESULT saveStateWithReason(Reason_T aReason, 138 138 const ComPtr<IProgress> &aProgress, 139 const ComPtr<ISnapshot> &aSnapshot, 139 140 const Utf8Str &aStateFilePath, 140 141 BOOL aPauseVM, -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r68975 r68986 446 446 pVmm2UserMethods->pfnNotifyPdmtTerm = Console::i_vmm2User_NotifyPdmtTerm; 447 447 pVmm2UserMethods->pfnNotifyResetTurnedIntoPowerOff = Console::i_vmm2User_NotifyResetTurnedIntoPowerOff; 448 pVmm2UserMethods->pfnQueryGenericObject = Console::i_vmm2User_QueryGenericObject; 448 449 pVmm2UserMethods->u32EndMagic = VMM2USERMETHODS_MAGIC; 449 450 pVmm2UserMethods->pConsole = this; … … 6576 6577 * @note Locks this object for writing. 6577 6578 */ 6578 HRESULT Console::i_saveState(Reason_T aReason, const ComPtr<IProgress> &aProgress, const Utf8Str &aStateFilePath, bool aPauseVM, bool &aLeftPaused) 6579 HRESULT Console::i_saveState(Reason_T aReason, const ComPtr<IProgress> &aProgress, 6580 const ComPtr<ISnapshot> &aSnapshot, 6581 const Utf8Str &aStateFilePath, bool aPauseVM, bool &aLeftPaused) 6579 6582 { 6580 6583 LogFlowThisFuncEnter(); … … 6583 6586 AssertReturn(!aProgress.isNull(), E_INVALIDARG); 6584 6587 AssertReturn(!aStateFilePath.isEmpty(), E_INVALIDARG); 6588 Assert(aSnapshot.isNull() || aReason == Reason_Snapshot); 6585 6589 6586 6590 AutoCaller autoCaller(this); … … 6650 6654 LogFlowFunc(("Saving the state to '%s'...\n", aStateFilePath.c_str())); 6651 6655 6656 mpVmm2UserMethods->pISnapshot = aSnapshot; 6652 6657 mptrCancelableProgress = aProgress; 6653 6658 alock.release(); … … 6659 6664 &aLeftPaused); 6660 6665 alock.acquire(); 6666 mpVmm2UserMethods->pISnapshot = NULL; 6661 6667 mptrCancelableProgress.setNull(); 6662 6668 if (RT_FAILURE(vrc)) … … 10335 10341 } 10336 10342 10337 10343 /** 10344 * @interface_method_impl{VMM2USERMETHODS,pfnQueryGenericObject} 10345 */ 10346 /*static*/ DECLCALLBACK(void *) 10347 Console::i_vmm2User_QueryGenericObject(PCVMM2USERMETHODS pThis, PUVM pUVM, PCRTUUID pUuid) 10348 { 10349 Console *pConsole = ((MYVMM2USERMETHODS *)pThis)->pConsole; 10350 NOREF(pUVM); 10351 10352 /* To simplify comparison we copy the UUID into a com::Guid object. */ 10353 com::Guid const UuidCopy(*pUuid); 10354 10355 if (UuidCopy == COM_IIDOF(IConsole)) 10356 { 10357 IConsole *pIConsole = static_cast<IConsole *>(pConsole); 10358 return pIConsole; 10359 } 10360 10361 if (UuidCopy == COM_IIDOF(IMachine)) 10362 { 10363 IMachine *pIMachine = pConsole->mMachine; 10364 return pIMachine; 10365 } 10366 10367 if (UuidCopy == COM_IIDOF(ISnapshot)) 10368 return ((MYVMM2USERMETHODS *)pThis)->pISnapshot; 10369 10370 return NULL; 10371 } 10338 10372 10339 10373 -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r68485 r68986 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1067 1067 } 1068 1068 1069 HRESULT Session::saveStateWithReason(Reason_T aReason, const ComPtr<IProgress> &aProgress, const Utf8Str &aStateFilePath, 1069 HRESULT Session::saveStateWithReason(Reason_T aReason, 1070 const ComPtr<IProgress> &aProgress, 1071 const ComPtr<ISnapshot> &aSnapshot, 1072 const Utf8Str &aStateFilePath, 1070 1073 BOOL aPauseVM, BOOL *aLeftPaused) 1071 1074 { … … 1077 1080 1078 1081 bool fLeftPaused = false; 1079 HRESULT rc = mConsole->i_saveState(aReason, aProgress, aS tateFilePath, !!aPauseVM, fLeftPaused);1082 HRESULT rc = mConsole->i_saveState(aReason, aProgress, aSnapshot, aStateFilePath, !!aPauseVM, fLeftPaused); 1080 1083 if (aLeftPaused) 1081 1084 *aLeftPaused = fLeftPaused; 1082 1085 return rc; 1083 1086 #else 1084 RT_NOREF(aReason, aProgress, aS tateFilePath, aPauseVM, aLeftPaused);1087 RT_NOREF(aReason, aProgress, aSnapshot, aStateFilePath, aPauseVM, aLeftPaused); 1085 1088 AssertFailed(); 1086 1089 return E_NOTIMPL; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r68956 r68986 12984 12984 alock.release(); 12985 12985 BOOL fSuspendedBySave; 12986 rc = directControl->SaveStateWithReason(task.m_enmReason, task.m_pProgress, Bstr(task.m_strStateFilePath).raw(), task.m_machineStateBackup != MachineState_Paused, &fSuspendedBySave);12986 rc = directControl->SaveStateWithReason(task.m_enmReason, task.m_pProgress, NULL, Bstr(task.m_strStateFilePath).raw(), task.m_machineStateBackup != MachineState_Paused, &fSuspendedBySave); 12987 12987 Assert(!fSuspendedBySave); 12988 12988 alock.acquire(); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r67885 r68986 1735 1735 rc = task.m_pDirectControl->SaveStateWithReason(Reason_Snapshot, 1736 1736 task.m_pProgress, 1737 task.m_pSnapshot, 1737 1738 Bstr(task.m_strStateFilePath).raw(), 1738 1739 task.m_fPause, -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r68594 r68986 815 815 LogFlow(("pdmR3DevHlp_GetSupDrvSession: caller='%s'/%d: returns %#p\n", pDevIns->pReg->szName, pDevIns->iInstance, pSession)); 816 816 return pSession; 817 } 818 819 820 /** @interface_method_impl{PDMDEVHLPR3,pfnQueryGenericUserObject} */ 821 static DECLCALLBACK(void *) pdmR3DevHlp_QueryGenericUserObject(PPDMDEVINS pDevIns, PCRTUUID pUuid) 822 { 823 PDMDEV_ASSERT_DEVINS(pDevIns); 824 LogFlow(("pdmR3DevHlp_QueryGenericUserObject: caller='%s'/%d: pUuid=%p:%RTuuid\n", 825 pDevIns->pReg->szName, pDevIns->iInstance, pUuid, pUuid)); 826 827 #if defined(DEBUG_bird) || defined(DEBUG_ramshankar) || defined(DEBUG_sunlover) || defined(DEBUG_michael) || defined(DEBUG_andy) 828 AssertMsgFailed(("'%s' wants %RTuuid - external only interface!\n", pDevIns->pReg->szName, pUuid)) 829 #endif 830 831 void *pvRet; 832 PUVM pUVM = pDevIns->Internal.s.pVMR3->pUVM; 833 if (pUVM->pVmm2UserMethods->pfnQueryGenericObject) 834 pvRet = pUVM->pVmm2UserMethods->pfnQueryGenericObject(pUVM->pVmm2UserMethods, pUVM, pUuid); 835 else 836 pvRet = NULL; 837 838 LogRel(("pdmR3DevHlp_QueryGenericUserObject: caller='%s'/%d: returns %#p for %RTuuid\n", 839 pDevIns->pReg->szName, pDevIns->iInstance, pvRet, pUuid)); 840 return pvRet; 817 841 } 818 842 … … 3728 3752 pdmR3DevHlp_TMTimeVirtGetNano, 3729 3753 pdmR3DevHlp_GetSupDrvSession, 3754 pdmR3DevHlp_QueryGenericUserObject, 3730 3755 PDM_DEVHLPR3_VERSION /* the end */ 3731 3756 }; … … 3861 3886 AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance)); 3862 3887 return (PSUPDRVSESSION)0; 3888 } 3889 3890 3891 /** @interface_method_impl{PDMDEVHLPR3,pfnQueryGenericUserObject} */ 3892 static DECLCALLBACK(void *) pdmR3DevHlp_Untrusted_QueryGenericUserObject(PPDMDEVINS pDevIns, PCRTUUID pUuid) 3893 { 3894 PDMDEV_ASSERT_DEVINS(pDevIns); 3895 AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d %RTuuid\n", 3896 pDevIns->pReg->szName, pDevIns->iInstance, pUuid)); 3897 return NULL; 3863 3898 } 3864 3899 … … 3987 4022 pdmR3DevHlp_TMTimeVirtGetNano, 3988 4023 pdmR3DevHlp_Untrusted_GetSupDrvSession, 4024 pdmR3DevHlp_Untrusted_QueryGenericUserObject, 3989 4025 PDM_DEVHLPR3_VERSION /* the end */ 3990 4026 };
Note:
See TracChangeset
for help on using the changeset viewer.