VirtualBox

Changeset 444 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 30, 2007 9:56:19 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18023
Message:

Exposed the TMVirtualSet/GetWarpDrive API in the IMachineDebugger interface as a r/w property named VirtualTimeRate.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineDebuggerImpl.cpp

    r1 r444  
    2828#include <VBox/csam.h>
    2929#include <VBox/vm.h>
     30#include <VBox/tm.h>
    3031#include <VBox/err.h>
    3132#include <VBox/hwaccm.h>
     
    8384    csamEnabledQueued = ~0;
    8485    mLogEnabledQueued = ~0;
     86    mVirtualTimeRateQueued = ~0;
    8587    fFlushMode = false;
    8688    setReady(true);
     
    481483
    482484/**
     485 * Returns the current virtual time rate.
     486 *
     487 * @returns COM status code.
     488 * @param   pct     Where to store the rate.
     489 */
     490STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *pct)
     491{
     492    if (!pct)
     493        return E_POINTER;
     494
     495    AutoLock lock(this);
     496    CHECK_READY();
     497
     498    Console::SafeVMPtrQuiet pVM (mParent);
     499    if (pVM.isOk())
     500        *pct = TMVirtualGetWarpDrive(pVM);
     501    else
     502        *pct = 100;
     503    return S_OK;
     504}
     505
     506/**
     507 * Returns the current virtual time rate.
     508 *
     509 * @returns COM status code.
     510 * @param   pct     Where to store the rate.
     511 */
     512STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG pct)
     513{
     514    if (pct < 2 || pct > 20000)
     515        return E_INVALIDARG;
     516
     517    AutoLock lock(this);
     518    CHECK_READY();
     519
     520    if (!fFlushMode)
     521    {
     522        // check if the machine is running
     523        MachineState_T machineState;
     524        mParent->COMGETTER(State)(&machineState);
     525        if (machineState != MachineState_Running)
     526        {
     527            // queue the request
     528            mVirtualTimeRateQueued = pct;
     529            return S_OK;
     530        }
     531    }
     532
     533    Console::SafeVMPtr pVM (mParent);
     534    CheckComRCReturnRC (pVM.rc());
     535
     536    int vrc = TMVirtualSetWarpDrive(pVM, pct);
     537    if (VBOX_FAILURE(vrc))
     538    {
     539        /** @todo handle error code. */
     540    }
     541    return S_OK;
     542}
     543
     544/**
    483545 * Hack for getting the VM handle.
    484546 * This is only temporary (promise) while prototyping the debugger.
     
    546608        mLogEnabledQueued = ~0;
    547609    }
     610    if (mVirtualTimeRateQueued != ~0)
     611    {
     612        COMSETTER(VirtualTimeRate)(mVirtualTimeRateQueued);
     613        mVirtualTimeRateQueued = ~0;
     614    }
    548615    fFlushMode = false;
    549616}
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r436 r444  
    58885888    <interface
    58895889        name="IMachineDebugger" extends="$unknown"
    5890         uuid="837c19ca-c4a4-479b-81e4-362d441f8f94"
     5890        uuid="288da658-74fa-4877-ab5c-dafdad19a1cd"
    58915891    >
    58925892        <method name="resetStats">
     
    59305930                Flag indicating whether the VM is currently making use of CPU hardware
    59315931                virtualization extensions
     5932            </desc>
     5933        </attribute>
     5934
     5935        <attribute name="VirtualTimeRate" type="unsigned long">
     5936            <desc>
     5937                The rate at which the virtual time runs expressed as a percentage.
     5938                The accepted range is 2% to 20000%.
    59325939            </desc>
    59335940        </attribute>
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r1 r444  
    6767    STDMETHOD(COMSETTER(LogEnabled))(BOOL enable);
    6868    STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled);
     69    STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *pct);
     70    STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG pct);
    6971    STDMETHOD(COMGETTER(VM))(ULONG64 *vm);
    7072
     
    8991    int csamEnabledQueued;
    9092    int mLogEnabledQueued;
     93    uint32_t mVirtualTimeRateQueued;
    9194    bool fFlushMode;
    9295};
Note: See TracChangeset for help on using the changeset viewer.

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