VirtualBox

Changeset 23179 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 21, 2009 11:23:12 AM (15 years ago)
Author:
vboxsync
Message:

Main: firmware type setter

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

Legend:

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

    r23107 r23179  
    391391     */
    392392#ifdef VBOX_WITH_EFI
    393     /** @todo: implement appropriate getter */
    394393    Bstr tmpStr1;
    395394    hrc = pMachine->GetExtraData(Bstr("VBoxInternal2/UseEFI"), tmpStr1.asOutParam());    H();
    396395    BOOL fEfiEnabled = !tmpStr1.isEmpty();
     396
     397    /**
     398     * @todo: VBoxInternal2/UseEFI extradata will go away soon, and we'll
     399     *        just use this code
     400     */
     401    if (!fEfiEnabled)
     402    {
     403      FirmwareType_T eType =  FirmwareType_Bios;
     404      hrc = pMachine->COMGETTER(FirmwareType)(&eType);                                H();
     405      fEfiEnabled = (eType == FirmwareType_Efi);
     406    }
    397407#else
    398408    BOOL fEfiEnabled = false;
  • trunk/src/VBox/Main/MachineImpl.cpp

    r22786 r23179  
    196196    mClipboardMode = ClipboardMode_Bidirectional;
    197197    mGuestPropertyNotificationPatterns = "";
     198   
     199    mFirmwareType = FirmwareType_Bios;
    198200}
    199201
     
    212214        mStatisticsUpdateInterval != that.mStatisticsUpdateInterval ||
    213215        mVRAMSize != that.mVRAMSize ||
     216        mFirmwareType != that.mFirmwareType ||
    214217        mAccelerate3DEnabled != that.mAccelerate3DEnabled ||
    215218        mAccelerate2DVideoEnabled != that.mAccelerate2DVideoEnabled ||
     
    11251128    mUserData.backup();
    11261129    mUserData->mOSTypeId = osTypeId;
     1130
     1131    return S_OK;
     1132}
     1133
     1134
     1135STDMETHODIMP Machine::COMGETTER(FirmwareType) (FirmwareType_T *aFirmwareType)
     1136{
     1137    CheckComArgOutPointerValid(aFirmwareType);
     1138
     1139    AutoCaller autoCaller(this);
     1140    CheckComRCReturnRC(autoCaller.rc());
     1141
     1142    AutoReadLock alock(this);
     1143
     1144    *aFirmwareType = mHWData->mFirmwareType;
     1145
     1146    return S_OK;
     1147}
     1148
     1149STDMETHODIMP Machine::COMSETTER(FirmwareType) (FirmwareType_T aFirmwareType)
     1150{
     1151    AutoCaller autoCaller(this);
     1152    CheckComRCReturnRC(autoCaller.rc());
     1153    AutoWriteLock alock(this);
     1154
     1155    int rc = checkStateDependency(MutableStateDep);
     1156    CheckComRCReturnRC(rc);
     1157
     1158    mHWData.backup();
     1159    mHWData->mFirmwareType = aFirmwareType;
    11271160
    11281161    return S_OK;
     
    49284961        mHWData->mAccelerate3DEnabled = data.fAccelerate3D;
    49294962        mHWData->mAccelerate2DVideoEnabled = data.fAccelerate2DVideo;
     4963        mHWData->mFirmwareType = data.cFirmwareType;
    49304964
    49314965#ifdef VBOX_WITH_VRDP
     
    56205654        mData->m_pMachineConfigFile->strDescription = mUserData->mDescription;
    56215655        mData->m_pMachineConfigFile->strOsType = mUserData->mOSTypeId;
    5622 
     5656       
    56235657        if (    mData->mMachineState == MachineState_Saved
    56245658             || mData->mMachineState == MachineState_Restoring
     
    57665800        // memory
    57675801        data.ulMemorySizeMB = mHWData->mMemorySize;
     5802
     5803        // firmware
     5804        data.cFirmwareType = mHWData->mFirmwareType;
    57685805
    57695806        // boot order
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r22866 r23179  
    974974  </enum>
    975975
     976   <enum
     977    name="FirmwareType"
     978    uuid="7ceea938-8b49-41e2-bb47-667219c0d586"
     979  >
     980    <desc>
     981      Firmware type.
     982    </desc>
     983    <const name="Bios"            value="1">
     984      <desc>BIOS Firmware.</desc>
     985    </const>
     986    <const name="Efi"             value="2">
     987      <desc>Efi firmware.</desc>
     988    </const>
     989  </enum>
    976990
    977991  <!--
     
    39733987  </interface>
    39743988
     3989
     3990   
    39753991  <interface
    39763992     name="IMachine" extends="$unknown"
     
    41964212    <attribute name="BIOSSettings" type="IBIOSSettings" readonly="yes">
    41974213      <desc>Object containing all BIOS settings.</desc>
     4214    </attribute>
     4215
     4216     <attribute name="firmwareType" type="FirmwareType">
     4217      <desc>Type of firmware (such as legacy BIOS or EFI), used for initial
     4218       bootstrap in this VM.</desc>
    41984219    </attribute>
    41994220
  • trunk/src/VBox/Main/include/MachineImpl.h

    r22624 r23179  
    301301        BOOL           mPropertyServiceActive;
    302302        Bstr           mGuestPropertyNotificationPatterns;
     303
     304        FirmwareType_T mFirmwareType;
    303305    };
    304306
     
    601603    STDMETHOD(RemoveStorageController (IN_BSTR aName));
    602604    STDMETHOD(GetStorageControllerByName (IN_BSTR aName, IStorageController **storageController));
     605    STDMETHOD(COMGETTER(FirmwareType)) (FirmwareType_T *aFirmware);
     606    STDMETHOD(COMSETTER(FirmwareType)) (FirmwareType_T  aFirmware);
    603607
    604608    // public methods only for internal purposes
  • trunk/src/VBox/Main/xml/Settings.cpp

    r22866 r23179  
    954954          fAccelerate3D(false),
    955955          fAccelerate2DVideo(false),
     956          cFirmwareType(FirmwareType_Bios),
    956957          clipboardMode(ClipboardMode_Bidirectional),
    957958          ulMemoryBalloonSize(0),
     
    12031204        else if (pelmHwChild->nameEquals("Memory"))
    12041205            pelmHwChild->getAttributeValue("RAMSize", hw.ulMemorySizeMB);
     1206        else if (pelmHwChild->nameEquals("Firmware"))
     1207            pelmHwChild->getAttributeValue("type", hw.cFirmwareType);
    12051208        else if (pelmHwChild->nameEquals("Boot"))
    12061209        {
     
    18331836    pelmMemory->setAttribute("RAMSize", hw.ulMemorySizeMB);
    18341837
     1838    if (m->sv >= SettingsVersion_v1_8)
     1839    {
     1840         xml::ElementNode *pelmFirmware = pelmHardware->createChild("Firmware");
     1841         pelmFirmware->setAttribute("type", hw.cFirmwareType);
     1842    }
     1843
    18351844    xml::ElementNode *pelmBoot = pelmHardware->createChild("Boot");
    18361845    for (BootOrderMap::const_iterator it = hw.mapBootOrder.begin();
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