Changeset 25672 in vbox
- Timestamp:
- Jan 6, 2010 9:23:07 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r25203 r25672 13 13 14 14 /* 15 * Copyright (C) 2007-20 09Sun Microsystems, Inc.15 * Copyright (C) 2007-2010 Sun Microsystems, Inc. 16 16 * 17 17 * This file is part of VirtualBox Open Source Edition (OSE), as … … 623 623 com::Utf8Str strTeleporterAddress; 624 624 com::Utf8Str strTeleporterPassword; 625 bool fRTCUseUTC; 625 626 626 627 bool fCurrentStateModified; // optional, default is true -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r25589 r25672 163 163 " [--cpuidremoveall]\n" 164 164 " [--cpus <number>]\n" 165 " [--rtcuseutc]\n" 165 166 " [--monitorcount <number>]\n" 166 167 " [--accelerate3d <on|off>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r25149 r25672 397 397 else 398 398 RTPrintf("Time offset: %lld ms\n", timeOffset); 399 400 BOOL RTCUseUTC; 401 machine->COMGETTER(RTCUseUTC)(&RTCUseUTC); 402 if (details == VMINFO_MACHINEREADABLE) 403 RTPrintf("rtcuseutc=\"%s\"\n", RTCUseUTC ? "on" : "off"); 404 else 405 RTPrintf("RTC: %s\n", RTCUseUTC ? "UTC" : "local time"); 399 406 400 407 BOOL hwVirtExEnabled; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r25325 r25672 123 123 MODIFYVM_VRDPREUSECON, 124 124 MODIFYVM_VRDP, 125 MODIFYVM_RTCUSEUTC, 125 126 MODIFYVM_USBEHCI, 126 127 MODIFYVM_USB, … … 152 153 { "--cpuidremoveall", MODIFYVM_DELALLCPUID, RTGETOPT_REQ_NOTHING}, 153 154 { "--cpus", MODIFYVM_CPUS, RTGETOPT_REQ_UINT32 }, 155 { "--rtcuseutc", MODIFYVM_RTCUSEUTC, RTGETOPT_REQ_BOOL_ONOFF }, 154 156 { "--monitorcount", MODIFYVM_MONITORCOUNT, RTGETOPT_REQ_UINT32 }, 155 157 { "--accelerate3d", MODIFYVM_ACCELERATE3D, RTGETOPT_REQ_BOOL_ONOFF }, … … 415 417 } 416 418 419 case MODIFYVM_RTCUSEUTC: 420 { 421 CHECK_ERROR(machine, COMSETTER(RTCUseUTC)(ValueUnion.f)); 422 break; 423 } 424 417 425 case MODIFYVM_MONITORCOUNT: 418 426 { -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r25589 r25672 10 10 11 11 /* 12 * Copyright (C) 2006-20 09Sun Microsystems, Inc.12 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 13 13 * 14 14 * This file is part of VirtualBox Open Source Edition (OSE), as … … 623 623 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 624 624 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 625 BOOL fRTCUseUTC; 626 hrc = pMachine->COMGETTER(RTCUseUTC)(&fRTCUseUTC); H(); 627 rc = CFGMR3InsertInteger(pCfg, "UseUTC", fRTCUseUTC ? 1 : 0); 625 628 626 629 /* -
trunk/src/VBox/Main/MachineImpl.cpp
r25589 r25672 6 6 7 7 /* 8 * Copyright (C) 2006-20 09Sun Microsystems, Inc.8 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 56 56 #include "Logging.h" 57 57 #include "Performance.h" 58 59 #include <stdio.h>60 #include <stdlib.h>61 58 62 59 #include <iprt/asm.h> … … 2229 2226 mUserData.backup(); 2230 2227 mUserData->mTeleporterPassword = aPassword; 2228 2229 return S_OK; 2230 } 2231 2232 STDMETHODIMP 2233 Machine::COMGETTER(RTCUseUTC)(BOOL *aEnabled) 2234 { 2235 CheckComArgOutPointerValid(aEnabled); 2236 2237 AutoCaller autoCaller(this); 2238 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2239 2240 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2241 2242 *aEnabled = mUserData->mRTCUseUTC; 2243 2244 return S_OK; 2245 } 2246 2247 STDMETHODIMP 2248 Machine::COMSETTER(RTCUseUTC)(BOOL aEnabled) 2249 { 2250 AutoCaller autoCaller(this); 2251 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2252 2253 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2254 2255 /* Only allow it to be set to true when PoweredOff or Aborted. 2256 (Clearing it is always permitted.) */ 2257 if ( aEnabled 2258 && mData->mRegistered 2259 && ( mType != IsSessionMachine 2260 || ( mData->mMachineState != MachineState_PoweredOff 2261 && mData->mMachineState != MachineState_Teleported 2262 && mData->mMachineState != MachineState_Aborted 2263 ) 2264 ) 2265 ) 2266 return setError(VBOX_E_INVALID_VM_STATE, 2267 tr("The machine is not powered off (state is %s)"), 2268 Global::stringifyMachineState(mData->mMachineState)); 2269 2270 mUserData.backup(); 2271 mUserData->mRTCUseUTC = aEnabled; 2231 2272 2232 2273 return S_OK; … … 5756 5797 mUserData->mTeleporterPassword = mData->m_pMachineConfigFile->strTeleporterPassword; 5757 5798 5799 /* RTC */ 5800 mUserData->mRTCUseUTC = mData->m_pMachineConfigFile->fRTCUseUTC; 5801 5758 5802 /* 5759 5803 * note: all mUserData members must be assigned prior this point because … … 6814 6858 mData->m_pMachineConfigFile->strTeleporterAddress = mUserData->mTeleporterAddress; 6815 6859 mData->m_pMachineConfigFile->strTeleporterPassword = mUserData->mTeleporterPassword; 6860 6861 mData->m_pMachineConfigFile->fRTCUseUTC = !!mUserData->mRTCUseUTC; 6816 6862 6817 6863 rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r25589 r25672 46 46 * (<result> extraction for the %Rhrc format specifier) 47 47 * 48 Copyright (C) 2006-20 09Sun Microsystems, Inc.48 Copyright (C) 2006-2010 Sun Microsystems, Inc. 49 49 50 50 This file is part of VirtualBox Open Source Edition (OSE), as … … 454 454 --> 455 455 </const> 456 <const name="Future" value="12"> 457 <desc>Settings version greater than "1.9", written by a future VirtualBox version.</desc> 456 <const name="v1_10" value="12"> 457 <desc>Settings version "1.10", written by VirtualBox 3.2.x.</desc> 458 <!-- Machine changes: RTC localOrUTC (done) 459 --> 460 </const> 461 <const name="Future" value="13"> 462 <desc>Settings version greater than "1.10", written by a future VirtualBox version.</desc> 458 463 </const> 459 464 </enum> … … 4160 4165 <interface 4161 4166 name="IMachine" extends="$unknown" 4162 uuid=" 99404f50-dd10-40d3-889b-dd2f79f1e95e"4167 uuid="6d7f40fa-77be-4366-a053-f58e81453a6a" 4163 4168 wsmap="managed" 4164 4169 > … … 4666 4671 </attribute> 4667 4672 4673 <attribute name="RTCUseUTC" type="boolean"> 4674 <desc> 4675 When set to @a true, the RTC device of the virtual machine will run 4676 in UTC time, otherwise in local time. Especially Unix guests prefer 4677 the time in UTC. 4678 </desc> 4679 </attribute> 4680 4668 4681 <method name="setBootOrder"> 4669 4682 <desc> -
trunk/src/VBox/Main/include/MachineImpl.h
r25310 r25672 7 7 8 8 /* 9 * Copyright (C) 2006-20 09Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 238 238 && mTeleporterPort == that.mTeleporterPort 239 239 && mTeleporterAddress == that.mTeleporterAddress 240 && mTeleporterPassword == that.mTeleporterPassword); 240 && mTeleporterPassword == that.mTeleporterPassword 241 && mRTCUseUTC == that.mRTCUseUTC); 241 242 } 242 243 … … 251 252 Bstr mTeleporterAddress; 252 253 Bstr mTeleporterPassword; 254 BOOL mRTCUseUTC; 253 255 }; 254 256 … … 577 579 STDMETHOD(COMGETTER(TeleporterPassword))(BSTR *aPassword); 578 580 STDMETHOD(COMSETTER(TeleporterPassword))(IN_BSTR aPassword); 581 STDMETHOD(COMGETTER(RTCUseUTC))(BOOL *aEnabled); 582 STDMETHOD(COMSETTER(RTCUseUTC))(BOOL aEnabled); 579 583 580 584 // IMachine methods -
trunk/src/VBox/Main/xml/Settings.cpp
r25589 r25672 29 29 * 30 30 * 3) In the settings writer method, write the setting _only_ if the current settings 31 * version (stored in m->sv) is high enough. That is, for VirtualBox 3. 1, write it32 * only if (m->sv >= SettingsVersion_v1_ 9).31 * version (stored in m->sv) is high enough. That is, for VirtualBox 3.2, write it 32 * only if (m->sv >= SettingsVersion_v1_10). 33 33 * 34 34 * 4) In MachineConfigFile::bumpSettingsVersionIfNeeded(), check if the new setting has … … 42 42 43 43 /* 44 * Copyright (C) 2007-20 09Sun Microsystems, Inc.44 * Copyright (C) 2007-2010 Sun Microsystems, Inc. 45 45 * 46 46 * This file is part of VirtualBox Open Source Edition (OSE), as … … 279 279 else if (ulMinor == 9) 280 280 m->sv = SettingsVersion_v1_9; 281 else if (ulMinor > 9) 281 else if (ulMinor == 10) 282 m->sv = SettingsVersion_v1_10; 283 else if (ulMinor > 10) 282 284 m->sv = SettingsVersion_Future; 283 285 } … … 298 300 { 299 301 m->strSettingsVersionFull = VBOX_XML_VERSION_FULL; 300 m->sv = SettingsVersion_v1_ 9;302 m->sv = SettingsVersion_v1_10; 301 303 } 302 304 } … … 545 547 case SettingsVersion_v1_8: 546 548 pcszVersion = "1.8"; 547 break;549 break; 548 550 549 551 case SettingsVersion_v1_9: 552 pcszVersion = "1.9"; 553 break; 554 555 case SettingsVersion_v1_10: 550 556 case SettingsVersion_Future: // can be set if this code runs on XML files that were created by a future version of VBox; 551 557 // in that case, downgrade to current version when writing since we can't write future versions... 552 pcszVersion = "1. 9";553 m->sv = SettingsVersion_v1_ 9;554 break;558 pcszVersion = "1.10"; 559 m->sv = SettingsVersion_v1_10; 560 break; 555 561 556 562 default: … … 558 564 pcszVersion = "1.7"; 559 565 m->sv = SettingsVersion_v1_7; 560 break;566 break; 561 567 } 562 568 … … 1775 1781 else if (pelmHwChild->nameEquals("Network")) 1776 1782 readNetworkAdapters(*pelmHwChild, hw.llNetworkAdapters); 1783 else if (pelmHwChild->nameEquals("RTC")) 1784 { 1785 Utf8Str strLocalOrUTC; 1786 fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC) 1787 && strLocalOrUTC == "UTC"; 1788 } 1777 1789 else if ( (pelmHwChild->nameEquals("UART")) 1778 1790 || (pelmHwChild->nameEquals("Uart")) // used before 1.3 … … 1780 1792 readSerialPorts(*pelmHwChild, hw.llSerialPorts); 1781 1793 else if ( (pelmHwChild->nameEquals("LPT")) 1782 || (pelmHwChild->nameEquals("Lpt"))// used before 1.31794 || (pelmHwChild->nameEquals("Lpt")) // used before 1.3 1783 1795 ) 1784 1796 readParallelPorts(*pelmHwChild, hw.llParallelPorts); … … 2411 2423 fTeleporterEnabled(false), 2412 2424 uTeleporterPort(0), 2425 fRTCUseUTC(false), 2413 2426 fCurrentStateModified(true), 2414 2427 fAborted(false) … … 2766 2779 pelmAudio->setAttribute("controller", (hw.audioAdapter.controllerType == AudioControllerType_SB16) ? "SB16" : "AC97"); 2767 2780 2781 if ( m->sv >= SettingsVersion_v1_10 2782 && fRTCUseUTC) 2783 { 2784 xml::ElementNode *pelmRTC = pelmHardware->createChild("RTC"); 2785 pelmRTC->setAttribute("localOrUTC", fRTCUseUTC ? "UTC" : "local"); 2786 } 2787 2768 2788 const char *pcszDriver; 2769 2789 switch (hw.audioAdapter.driverType) … … 3069 3089 m->sv = SettingsVersion_v1_9; 3070 3090 } 3091 3092 if ( m->sv < SettingsVersion_v1_10 3093 && ( fRTCUseUTC 3094 ) 3095 ) 3096 m->sv = SettingsVersion_v1_10; 3071 3097 } 3072 3098
Note:
See TracChangeset
for help on using the changeset viewer.