Changeset 78779 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 27, 2019 10:22:15 AM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r78683 r78779 865 865 #endif 866 866 867 bool i_isResetTurnedIntoPowerOff(void);868 869 867 /** @name Disk encryption support 870 868 * @{ */ … … 941 939 /** true if a USB controller is available (i.e. USB devices can be attached). */ 942 940 bool mfVMHasUsbController : 1; 941 /** Shadow of the VBoxInternal2/TurnResetIntoPowerOff extra data setting. 942 * This is initialized by Console::i_configConstructorInner(). */ 943 bool mfTurnResetIntoPowerOff : 1; 943 944 /** true if the VM power off was caused by reset. */ 944 945 bool mfPowerOffCausedByReset : 1; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r78767 r78779 275 275 inline static const char *networkAdapterTypeToName(NetworkAdapterType_T adapterType); 276 276 277 class VmEventListener { 277 class VmEventListener 278 { 278 279 public: 279 280 VmEventListener() … … 328 329 break; 329 330 mConsole->i_onNATRedirectRuleChange(ulSlot, fRemove, proto, hostIp.raw(), hostPort, guestIp.raw(), guestPort); 331 break; 330 332 } 331 break;332 333 333 334 case VBoxEventType_OnHostNameResolutionConfigurationChange: … … 398 399 , mfSnapshotFolderDiskTypeShown(false) 399 400 , mfVMHasUsbController(false) 401 , mfTurnResetIntoPowerOff(false) 400 402 , mfPowerOffCausedByReset(false) 401 403 , mpVmm2UserMethods(NULL) … … 1080 1082 1081 1083 #endif /* VBOX_WITH_GUEST_PROPS */ 1082 1083 bool Console::i_isResetTurnedIntoPowerOff(void)1084 {1085 Bstr value;1086 HRESULT hrc = mMachine->GetExtraData(Bstr("VBoxInternal2/TurnResetIntoPowerOff").raw(),1087 value.asOutParam());1088 if ( hrc == S_OK1089 && value == "1")1090 return true;1091 return false;1092 }1093 1084 1094 1085 #ifdef VBOX_WITH_EXTPACK … … 2193 2184 2194 2185 #ifdef VBOX_WITH_GUEST_PROPS 2195 alock.release(); /** @todo r=bird: This code introduces a race condition wrt to the state. This must be done elsewhere! */ 2196 2197 if (i_isResetTurnedIntoPowerOff()) 2198 { 2186 if (mfTurnResetIntoPowerOff) 2187 { 2188 alock.release(); /** @todo r=bird: This code introduces a race condition wrt to the state. This must be done elsewhere! */ 2199 2189 mMachine->DeleteGuestProperty(Bstr("/VirtualBox/HostInfo/VMPowerOffReason").raw()); 2200 2190 mMachine->SetGuestProperty(Bstr("/VirtualBox/HostInfo/VMPowerOffReason").raw(), 2201 2191 Bstr("PowerOff").raw(), Bstr("RDONLYGUEST").raw()); 2202 2192 mMachine->SaveSettings(); 2203 } 2204 2205 alock.acquire(); 2193 alock.acquire(); 2194 } 2206 2195 #endif 2207 2196 … … 6052 6041 if (ptrVM.isOk()) 6053 6042 { 6054 Bstr strKey(aKey); 6055 Bstr strVal(aVal); 6056 6057 if (strKey == "VBoxInternal2/TurnResetIntoPowerOff") 6058 { 6059 int vrc = VMR3SetPowerOffInsteadOfReset(ptrVM.rawUVM(), strVal == "1"); 6043 if (RTUtf16CmpAscii(aKey, "VBoxInternal2/TurnResetIntoPowerOff") == 0) 6044 { 6045 mfTurnResetIntoPowerOff = RTUtf16CmpAscii(aVal, "1") == 0; 6046 int vrc = VMR3SetPowerOffInsteadOfReset(ptrVM.rawUVM(), mfTurnResetIntoPowerOff); 6060 6047 AssertRC(vrc); 6061 6048 } … … 8791 8778 { 8792 8779 #ifdef VBOX_WITH_GUEST_PROPS 8793 if (that-> i_isResetTurnedIntoPowerOff())8780 if (that->mfTurnResetIntoPowerOff) 8794 8781 { 8795 8782 Bstr strPowerOffReason; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r78725 r78779 1204 1204 1205 1205 /* Reset overwrite. */ 1206 if (i_isResetTurnedIntoPowerOff()) 1206 mfTurnResetIntoPowerOff = GetExtraDataBoth(virtualBox, pMachine, 1207 "VBoxInternal2/TurnResetIntoPowerOff", &strTmp)->equals("1"); 1208 if (mfTurnResetIntoPowerOff) 1207 1209 InsertConfigInteger(pRoot, "PowerOffInsteadOfReset", 1); 1208 1210
Note:
See TracChangeset
for help on using the changeset viewer.