VirtualBox

Changeset 29462 in vbox


Ignore:
Timestamp:
May 14, 2010 11:27:59 AM (14 years ago)
Author:
vboxsync
Message:

Added page fusion xml config entry

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

Legend:

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

    r29422 r29462  
    162162    mCPUHotPlugEnabled = false;
    163163    mMemoryBalloonSize = 0;
     164    mPageFusionEnabled = false;
    164165    mVRAMSize = 8;
    165166    mAccelerate3DEnabled = false;
     
    14651466STDMETHODIMP Machine::COMGETTER(PageFusionEnabled) (BOOL *enabled)
    14661467{
     1468    if (!enabled)
     1469        return E_POINTER;
     1470
     1471    AutoCaller autoCaller(this);
     1472    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1473
     1474    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     1475
     1476    *enabled = mHWData->mPageFusionEnabled;
     1477    return S_OK;
     1478}
     1479
     1480STDMETHODIMP Machine::COMSETTER(PageFusionEnabled) (BOOL enabled)
     1481{
     1482    /* This must match GMMR0Init; currently we only support memory ballooning on all 64-bit hosts except Mac OS X */
     1483#if HC_ARCH_BITS == 64 && (defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) || defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD))
     1484    AutoCaller autoCaller(this);
     1485    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1486
     1487    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     1488
     1489    setModified(IsModified_MachineData);
     1490    mHWData.backup();
     1491    mHWData->mPageFusionEnabled = enabled;
     1492    return S_OK;
     1493#else
    14671494    NOREF(enabled);
    1468     return E_NOTIMPL;
    1469 }
    1470 
    1471 STDMETHODIMP Machine::COMSETTER(PageFusionEnabled) (BOOL enabled)
    1472 {
    1473     NOREF(enabled);
    1474     return E_NOTIMPL;
     1495    return setError(E_NOTIMPL, tr("Page fusion is only supported on 64-bit hosts"));
     1496#endif
    14751497}
    14761498
     
    67696791
    67706792        mHWData->mMemorySize = data.ulMemorySizeMB;
     6793        mHWData->mPageFusionEnabled = data.fPageFusionEnabled;
    67716794
    67726795        // boot order
     
    78277850        // memory
    78287851        data.ulMemorySizeMB = mHWData->mMemorySize;
     7852        data.fPageFusionEnabled = mHWData->mPageFusionEnabled;
    78297853
    78307854        // firmware
  • trunk/src/VBox/Main/include/MachineImpl.h

    r29385 r29462  
    259259        ULONG                mMemorySize;
    260260        ULONG                mMemoryBalloonSize;
     261        BOOL                 mPageFusionEnabled;
    261262        ULONG                mVRAMSize;
    262263        ULONG                mMonitorCount;
  • trunk/src/VBox/Main/xml/Settings.cpp

    r29386 r29462  
    14911491          keyboardHidType(KeyboardHidType_PS2Keyboard),
    14921492          clipboardMode(ClipboardMode_Bidirectional),
    1493           ulMemoryBalloonSize(0)
     1493          ulMemoryBalloonSize(0),
     1494          fPageFusionEnabled(false)
    14941495{
    14951496    mapBootOrder[0] = DeviceType_Floppy;
     
    15471548                  && (clipboardMode             == h.clipboardMode)
    15481549                  && (ulMemoryBalloonSize       == h.ulMemoryBalloonSize)
     1550                  && (fPageFusionEnabled        == h.fPageFusionEnabled)
    15491551                  && (llGuestProperties         == h.llGuestProperties)
    15501552                  && (strNotificationPatterns   == h.strNotificationPatterns)
     
    21732175        }
    21742176        else if (pelmHwChild->nameEquals("Memory"))
     2177        {
    21752178            pelmHwChild->getAttributeValue("RAMSize", hw.ulMemorySizeMB);
     2179            pelmHwChild->getAttributeValue("PageFusion", hw.fPageFusionEnabled);
     2180        }
    21762181        else if (pelmHwChild->nameEquals("Firmware"))
    21772182        {
     
    31293134    xml::ElementNode *pelmMemory = pelmHardware->createChild("Memory");
    31303135    pelmMemory->setAttribute("RAMSize", hw.ulMemorySizeMB);
     3136    if (m->sv >= SettingsVersion_v1_10)
     3137    {
     3138        pelmMemory->setAttribute("PageFusion", hw.fPageFusionEnabled);
     3139    }
    31313140
    31323141    if (    (m->sv >= SettingsVersion_v1_9)
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