VirtualBox

Changeset 16589 in vbox for trunk


Ignore:
Timestamp:
Feb 9, 2009 2:16:19 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3576: Warn if VT-x/AMD-V is not functional. Implemented auto-enabling warning in VM Settings & virtualization-failed warning during VM starting.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r16472 r16589  
    184184    bool toggleFullscreenMode (bool, bool);
    185185
     186    void checkRequiredFeatures();
     187
    186188private slots:
    187189
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r16264 r16589  
    233233
    234234    void cannotSendACPIToMachine();
     235    bool warnAboutVirtNotEnabled();
    235236
    236237    void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsGeneral.h

    r16101 r16589  
    4646    void putBackTo();
    4747
     48    void setValidator (QIWidgetValidator *aVal);
    4849    bool revalidate (QString &aWarning, QString &aTitle);
    4950
     
    7576
    7677    CMachine mMachine;
     78    QIWidgetValidator *mValidator;
    7779};
    7880
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r16544 r16589  
    10941094#endif
    10951095
     1096    /* Finally check the status of required features. */
     1097    checkRequiredFeatures();
     1098
    10961099    /* Re-request all the static values finally after
    10971100     * view is really opened and attached. */
     
    21392142
    21402143/**
     2144 *  This function checks the status of required features and
     2145 *  makes a warning and/or some action if something necessary
     2146 *  is not in good condition.
     2147 *  Does nothing if no console view was opened.
     2148 */
     2149void VBoxConsoleWnd::checkRequiredFeatures()
     2150{
     2151    if (!console) return;
     2152
     2153    CConsole cconsole = console->console();
     2154
     2155    /* Check if virtualization feature enabled for 64 bits guest */
     2156    bool is64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType (
     2157                         cconsole.GetGuest().GetOSTypeId()).GetIs64Bit();
     2158    bool isVirtEnabled = cconsole.GetDebugger().GetHWVirtExEnabled();
     2159    if (is64BitsGuest && !isVirtEnabled)
     2160    {
     2161        vmPause (true);
     2162        vboxProblem().warnAboutVirtNotEnabled() ? close() : vmPause (false);
     2163    }
     2164}
     2165
     2166/**
    21412167 * @return @c true if successfully performed the requested operation and false
    21422168 * otherwise.
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r16273 r16589  
    930930}
    931931
     932bool VBoxProblemReporter::warnAboutVirtNotEnabled()
     933{
     934    return messageOkCancel (mainWindowShown(), Error,
     935        tr ("<p>VT-x/AMD-V hardware acceleration has been enabled, but is "
     936            "not operational. Your 64 bits guest will fail to detect a 64 "
     937            "bits CPU and will not be able to boot.</p><p>Please check if you "
     938            "have enabled VT-x/AMD-V properly in the BIOS of your host "
     939            "computer.</p>"),
     940        0 /* aAutoConfirmId */,
     941        tr ("Close VM"), tr ("Continue"));
     942}
     943
    932944void VBoxProblemReporter::cannotSetSnapshotFolder (const CMachine &aMachine,
    933945                                                   const QString &aPath)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsGeneral.cpp

    r16101 r16589  
    2424#include "VBoxGlobal.h"
    2525#include "VBoxProblemReporter.h"
     26#include "QIWidgetValidator.h"
    2627#include <iprt/asm.h>
    2728#include <VBox/x86.h>
     
    5253
    5354VBoxVMSettingsGeneral::VBoxVMSettingsGeneral()
     55    : mValidator (0)
    5456{
    5557    /* Apply UI decorations */
     
    240242    QString saveRtimeImages = mMachine.GetExtraData (VBoxDefs::GUI_SaveMountedAtRuntime);
    241243    mCbSaveMounted->setChecked (saveRtimeImages != "no");
     244
     245    if (mValidator)
     246        mValidator->revalidate();
    242247}
    243248
    244249void VBoxVMSettingsGeneral::putBackTo()
    245250{
     251    /* Make auto-attenuation for some settings in this chapter: */
     252
     253    /* Enable VT-x/AMD-V feature if the guest is of 64 bits */
     254    if (mOSTypeSelector->type().GetIs64Bit())
     255        mCbVirt->setChecked (true);
     256
     257    /* Save user's predefined settings in this chapter: */
     258
    246259    CBIOSSettings biosSettings = mMachine.GetBIOSSettings();
    247260
     
    327340}
    328341
     342void VBoxVMSettingsGeneral::setValidator (QIWidgetValidator *aVal)
     343{
     344    mValidator = aVal;
     345    connect (mCbVirt, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
     346    connect (mOSTypeSelector, SIGNAL (osTypeChanged()), mValidator, SLOT (revalidate()));
     347}
     348
    329349bool VBoxVMSettingsGeneral::revalidate (QString &aWarning, QString & /* aTitle */)
    330350{
     351    /* System RAM & Video RAM sliders correlation test */
    331352    ulong fullSize = vboxGlobal().virtualBox().GetHost().GetMemorySize();
    332353    quint64 needBytes = VBoxGlobal::requiredVideoMemory (&mMachine);
    333 
    334354    if (mSlRam->value() + mSlVideo->value() > 0.75 * fullSize)
    335355    {
     
    359379        return true;
    360380    }
     381
     382    /* Guest OS type & VT-x/AMD-V option correlation test */
     383    if (mOSTypeSelector->type().GetIs64Bit() && !mCbVirt->isChecked())
     384    {
     385        aWarning = tr (
     386            "there is a 64 bits guest OS type assigned for this VM, which "
     387            "requires virtualization feature (VT-x/AMD-V) to be enabled "
     388            "too, else your guest will fail to detect a 64 bits CPU and "
     389            "will not be able to boot, so this feature will be enabled "
     390            "automatically when you'll accept VM Settings by pressing OK "
     391            "button.");
     392        return true;
     393    }
     394
    361395    return true;
    362396}
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