Changeset 48528 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 18, 2013 8:39:01 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VM.cpp
r46788 r48528 197 197 AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyPdmtInit, VERR_INVALID_POINTER); 198 198 AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyPdmtTerm, VERR_INVALID_POINTER); 199 AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyResetTurnedIntoPowerOff, VERR_INVALID_POINTER); 199 200 AssertReturn(pVmm2UserMethods->u32EndMagic == VMM2USERMETHODS_MAGIC, VERR_INVALID_PARAMETER); 200 201 } … … 842 843 AssertLogRelMsgRCReturn(rc, ("Configuration error: Querying \"UUID\" failed, rc=%Rrc\n", rc), rc); 843 844 845 rc = CFGMR3QueryBoolDef(pRoot, "PowerOffInsteadOfReset", &pVM->vm.s.fPowerOffInsteadOfReset, false); 846 AssertLogRelMsgRCReturn(rc, ("Configuration error: Querying \"PowerOffInsteadOfReset\" failed, rc=%Rrc\n", rc), rc); 847 844 848 return VINF_SUCCESS; 845 849 } … … 2853 2857 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 2854 2858 2859 if (pVM->vm.s.fPowerOffInsteadOfReset) 2860 { 2861 if ( pUVM->pVmm2UserMethods 2862 && pUVM->pVmm2UserMethods->pfnNotifyResetTurnedIntoPowerOff) 2863 pUVM->pVmm2UserMethods->pfnNotifyResetTurnedIntoPowerOff(pUVM->pVmm2UserMethods, pUVM); 2864 return VMR3PowerOff(pUVM); 2865 } 2866 2855 2867 /* 2856 2868 * Gather all the EMTs to make sure there are no races before … … 4437 4449 } 4438 4450 4451 4452 /** 4453 * Control whether the VM should power off when resetting. 4454 * 4455 * @returns VBox status code. 4456 * @param pUVM The user mode VM handle. 4457 * @param fPowerOffInsteadOfReset Flag whether the VM should power off when 4458 * resetting. 4459 */ 4460 VMMR3DECL(int) VMR3SetPowerOffInsteadOfReset(PUVM pUVM, bool fPowerOffInsteadOfReset) 4461 { 4462 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 4463 PVM pVM = pUVM->pVM; 4464 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 4465 4466 /* Note: not called from EMT. */ 4467 pVM->vm.s.fPowerOffInsteadOfReset = fPowerOffInsteadOfReset; 4468 return VINF_SUCCESS; 4469 } 4470 -
trunk/src/VBox/VMM/include/VMInternal.h
r46788 r48528 164 164 /** The VM was/is-being teleported and has not yet been fully resumed. */ 165 165 bool fTeleportedAndNotFullyResumedYet; 166 /** The VM should power off instead of reset. */ 167 bool fPowerOffInsteadOfReset; 166 168 } VMINT; 167 169 /** Pointer to the VM Internal Data (part of the VM structure). */
Note:
See TracChangeset
for help on using the changeset viewer.