VirtualBox

Changeset 25672 in vbox


Ignore:
Timestamp:
Jan 6, 2010 9:23:07 PM (15 years ago)
Author:
vboxsync
Message:

introduced VBoxManage modifyvm --rtcuseutc

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r25203 r25672  
    1313
    1414/*
    15  * Copyright (C) 2007-2009 Sun Microsystems, Inc.
     15 * Copyright (C) 2007-2010 Sun Microsystems, Inc.
    1616 *
    1717 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    623623    com::Utf8Str            strTeleporterAddress;
    624624    com::Utf8Str            strTeleporterPassword;
     625    bool                    fRTCUseUTC;
    625626
    626627    bool                    fCurrentStateModified;      // optional, default is true
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r25589 r25672  
    163163                 "                            [--cpuidremoveall]\n"
    164164                 "                            [--cpus <number>]\n"
     165                 "                            [--rtcuseutc]\n"
    165166                 "                            [--monitorcount <number>]\n"
    166167                 "                            [--accelerate3d <on|off>]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r25149 r25672  
    397397    else
    398398        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");
    399406
    400407    BOOL hwVirtExEnabled;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r25325 r25672  
    123123    MODIFYVM_VRDPREUSECON,
    124124    MODIFYVM_VRDP,
     125    MODIFYVM_RTCUSEUTC,
    125126    MODIFYVM_USBEHCI,
    126127    MODIFYVM_USB,
     
    152153    { "--cpuidremoveall",           MODIFYVM_DELALLCPUID,               RTGETOPT_REQ_NOTHING},
    153154    { "--cpus",                     MODIFYVM_CPUS,                      RTGETOPT_REQ_UINT32 },
     155    { "--rtcuseutc",                MODIFYVM_RTCUSEUTC,                 RTGETOPT_REQ_BOOL_ONOFF },
    154156    { "--monitorcount",             MODIFYVM_MONITORCOUNT,              RTGETOPT_REQ_UINT32 },
    155157    { "--accelerate3d",             MODIFYVM_ACCELERATE3D,              RTGETOPT_REQ_BOOL_ONOFF },
     
    415417            }
    416418
     419            case MODIFYVM_RTCUSEUTC:
     420            {
     421                CHECK_ERROR(machine, COMSETTER(RTCUseUTC)(ValueUnion.f));
     422                break;
     423            }
     424
    417425            case MODIFYVM_MONITORCOUNT:
    418426            {
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r25589 r25672  
    1010
    1111/*
    12  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     12 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1313 *
    1414 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    623623    rc = CFGMR3InsertNode(pDev,     "0", &pInst);                                   RC_CHECK();
    624624    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);
    625628
    626629    /*
  • trunk/src/VBox/Main/MachineImpl.cpp

    r25589 r25672  
    66
    77/*
    8  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5656#include "Logging.h"
    5757#include "Performance.h"
    58 
    59 #include <stdio.h>
    60 #include <stdlib.h>
    6158
    6259#include <iprt/asm.h>
     
    22292226    mUserData.backup();
    22302227    mUserData->mTeleporterPassword = aPassword;
     2228
     2229    return S_OK;
     2230}
     2231
     2232STDMETHODIMP
     2233Machine::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
     2247STDMETHODIMP
     2248Machine::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;
    22312272
    22322273    return S_OK;
     
    57565797        mUserData->mTeleporterPassword = mData->m_pMachineConfigFile->strTeleporterPassword;
    57575798
     5799        /* RTC */
     5800        mUserData->mRTCUseUTC = mData->m_pMachineConfigFile->fRTCUseUTC;
     5801
    57585802        /*
    57595803         *  note: all mUserData members must be assigned prior this point because
     
    68146858        mData->m_pMachineConfigFile->strTeleporterAddress  = mUserData->mTeleporterAddress;
    68156859        mData->m_pMachineConfigFile->strTeleporterPassword = mUserData->mTeleporterPassword;
     6860
     6861        mData->m_pMachineConfigFile->fRTCUseUTC = !!mUserData->mRTCUseUTC;
    68166862
    68176863        rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r25589 r25672  
    4646 *    (<result> extraction for the %Rhrc format specifier)
    4747 *
    48      Copyright (C) 2006-2009 Sun Microsystems, Inc.
     48     Copyright (C) 2006-2010 Sun Microsystems, Inc.
    4949
    5050     This file is part of VirtualBox Open Source Edition (OSE), as
     
    454454           -->
    455455    </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>
    458463    </const>
    459464  </enum>
     
    41604165  <interface
    41614166     name="IMachine" extends="$unknown"
    4162      uuid="99404f50-dd10-40d3-889b-dd2f79f1e95e"
     4167     uuid="6d7f40fa-77be-4366-a053-f58e81453a6a"
    41634168     wsmap="managed"
    41644169     >
     
    46664671    </attribute>
    46674672
     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
    46684681    <method name="setBootOrder">
    46694682      <desc>
  • trunk/src/VBox/Main/include/MachineImpl.h

    r25310 r25672  
    77
    88/*
    9  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    238238                    && mTeleporterPort       == that.mTeleporterPort
    239239                    && mTeleporterAddress    == that.mTeleporterAddress
    240                     && mTeleporterPassword   == that.mTeleporterPassword);
     240                    && mTeleporterPassword   == that.mTeleporterPassword
     241                    && mRTCUseUTC            == that.mRTCUseUTC);
    241242        }
    242243
     
    251252        Bstr    mTeleporterAddress;
    252253        Bstr    mTeleporterPassword;
     254        BOOL    mRTCUseUTC;
    253255    };
    254256
     
    577579    STDMETHOD(COMGETTER(TeleporterPassword))(BSTR *aPassword);
    578580    STDMETHOD(COMSETTER(TeleporterPassword))(IN_BSTR aPassword);
     581    STDMETHOD(COMGETTER(RTCUseUTC))(BOOL *aEnabled);
     582    STDMETHOD(COMSETTER(RTCUseUTC))(BOOL aEnabled);
    579583
    580584    // IMachine methods
  • trunk/src/VBox/Main/xml/Settings.cpp

    r25589 r25672  
    2929 *
    3030 *   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 it
    32  *      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).
    3333 *
    3434 *   4) In MachineConfigFile::bumpSettingsVersionIfNeeded(), check if the new setting has
     
    4242
    4343/*
    44  * Copyright (C) 2007-2009 Sun Microsystems, Inc.
     44 * Copyright (C) 2007-2010 Sun Microsystems, Inc.
    4545 *
    4646 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    279279                else if (ulMinor == 9)
    280280                    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)
    282284                    m->sv = SettingsVersion_Future;
    283285            }
     
    298300    {
    299301        m->strSettingsVersionFull = VBOX_XML_VERSION_FULL;
    300         m->sv = SettingsVersion_v1_9;
     302        m->sv = SettingsVersion_v1_10;
    301303    }
    302304}
     
    545547        case SettingsVersion_v1_8:
    546548            pcszVersion = "1.8";
    547         break;
     549            break;
    548550
    549551        case SettingsVersion_v1_9:
     552            pcszVersion = "1.9";
     553            break;
     554
     555        case SettingsVersion_v1_10:
    550556        case SettingsVersion_Future:                // can be set if this code runs on XML files that were created by a future version of VBox;
    551557                                                    // 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;
    555561
    556562        default:
     
    558564            pcszVersion = "1.7";
    559565            m->sv = SettingsVersion_v1_7;
    560         break;
     566            break;
    561567    }
    562568
     
    17751781        else if (pelmHwChild->nameEquals("Network"))
    17761782            readNetworkAdapters(*pelmHwChild, hw.llNetworkAdapters);
     1783        else if (pelmHwChild->nameEquals("RTC"))
     1784        {
     1785            Utf8Str strLocalOrUTC;
     1786            fRTCUseUTC =    pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)
     1787                         && strLocalOrUTC == "UTC";
     1788        }
    17771789        else if (    (pelmHwChild->nameEquals("UART"))
    17781790                  || (pelmHwChild->nameEquals("Uart"))      // used before 1.3
     
    17801792            readSerialPorts(*pelmHwChild, hw.llSerialPorts);
    17811793        else if (    (pelmHwChild->nameEquals("LPT"))
    1782                   ||  (pelmHwChild->nameEquals("Lpt"))      // used before 1.3
     1794                  || (pelmHwChild->nameEquals("Lpt"))       // used before 1.3
    17831795                )
    17841796            readParallelPorts(*pelmHwChild, hw.llParallelPorts);
     
    24112423      fTeleporterEnabled(false),
    24122424      uTeleporterPort(0),
     2425      fRTCUseUTC(false),
    24132426      fCurrentStateModified(true),
    24142427      fAborted(false)
     
    27662779    pelmAudio->setAttribute("controller", (hw.audioAdapter.controllerType == AudioControllerType_SB16) ? "SB16" : "AC97");
    27672780
     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
    27682788    const char *pcszDriver;
    27692789    switch (hw.audioAdapter.driverType)
     
    30693089            m->sv = SettingsVersion_v1_9;
    30703090    }
     3091
     3092    if (    m->sv < SettingsVersion_v1_10
     3093         && (  fRTCUseUTC
     3094            )
     3095       )
     3096        m->sv = SettingsVersion_v1_10;
    30713097}
    30723098
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette