VirtualBox

Ignore:
Timestamp:
Mar 23, 2010 11:17:46 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59173
Message:

FE/Qt4: new core: Move the VT-x check after the console is turned on. Otherwise the check will fail.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r27485 r27621  
    364364bool UIMachineLogic::checkAvailability()
    365365{
    366     /* Get current console: */
    367     CConsole console = session().GetConsole();
    368 
    369     /* Check if the required virtualization features are active: */
    370     bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit();
    371     bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx();
    372     AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n"));
    373     bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();
    374     if (fRecommendVirtEx && !fIsVirtEnabled)
    375     {
    376         bool fShouldWeClose;
    377 
    378         bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
    379 
    380         if (fIs64BitsGuest)
    381             fShouldWeClose = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported);
    382         else
    383             fShouldWeClose = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported);
    384 
    385         return !fShouldWeClose;
    386     }
    387 
    388     /* True to confirm success: */
    389366    return true;
    390367}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r27484 r27621  
    646646    }
    647647
     648    /* Check if the required virtualization features are active. We get this
     649     * info only when the session is active. */
     650    bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit();
     651    bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx();
     652    AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n"));
     653//    bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();
     654    bool fIsVirtEnabled = false;
     655    if (fRecommendVirtEx && !fIsVirtEnabled)
     656    {
     657        bool fShouldWeClose;
     658
     659        bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     660
     661        QApplication::processEvents();
     662        setPause(true);
     663
     664        if (fIs64BitsGuest)
     665            fShouldWeClose = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported);
     666        else
     667            fShouldWeClose = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported);
     668
     669        if (fShouldWeClose)
     670        {
     671            /* At this point the console is powered up. So we have to close
     672             * this session again. */
     673            CProgress progress = console.PowerDown();
     674            if (console.isOk())
     675            {
     676                /* Guard progressbar warnings from auto-closing: */
     677                if (uimachine()->machineLogic())
     678                    uimachine()->machineLogic()->setPreventAutoClose(true);
     679                /* Show the power down progress dialog */
     680                vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow());
     681                if (progress.GetResultCode() != 0)
     682                    vboxProblem().cannotStopMachine(progress);
     683                /* Allow further auto-closing: */
     684                if (uimachine()->machineLogic())
     685                    uimachine()->machineLogic()->setPreventAutoClose(false);
     686            }
     687            else
     688                vboxProblem().cannotStopMachine(console);
     689            /* Now signal the destruction of the rest. */
     690            QTimer::singleShot(0, this, SLOT(sltCloseVirtualSession()));
     691            return;
     692        }
     693        else
     694            setPause(false);
     695    }
     696
    648697#if 0 // TODO: Rework debugger logic!
    649698# ifdef VBOX_WITH_DEBUGGER_GUI
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