VirtualBox

Ignore:
Timestamp:
Jan 26, 2024 4:17:43 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161331
Message:

Main,FE/VBoxManage,FE/VirtualBox,ValidationKit: Allow setting the primary VM execution engine to make it easier to force particular engine for testing, bugref:10583

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r101418 r103085  
    242242    MODIFYVM_DEFAULTFRONTEND,
    243243    MODIFYVM_VMPROC_PRIORITY,
     244    MODIFYVM_VMEXEC_ENGINE,
    244245    MODIFYVM_TESTING_ENABLED,
    245246    MODIFYVM_TESTING_MMIO,
     
    477478    OPT2("--default-frontend",              "--defaultfrontend",        MODIFYVM_DEFAULTFRONTEND,           RTGETOPT_REQ_STRING),
    478479    OPT1("--vm-process-priority",                                       MODIFYVM_VMPROC_PRIORITY,           RTGETOPT_REQ_STRING),
     480    OPT1("--vm-execution-engine",                                       MODIFYVM_VMEXEC_ENGINE,             RTGETOPT_REQ_STRING),
    479481    OPT1("--testing-enabled",                                           MODIFYVM_TESTING_ENABLED,           RTGETOPT_REQ_BOOL_ONOFF),
    480482    OPT1("--testing-mmio",                                              MODIFYVM_TESTING_MMIO,              RTGETOPT_REQ_BOOL_ONOFF),
     
    674676}
    675677
     678static VMExecutionEngine_T nameToVMExecEngine(const char *pszName)
     679{
     680    if (!RTStrICmp(pszName, "default"))
     681        return VMExecutionEngine_Default;
     682    if (   !RTStrICmp(pszName, "hwvirt")
     683        || !RTStrICmp(pszName, "hm"))
     684        return VMExecutionEngine_HwVirt;
     685    if (   !RTStrICmp(pszName, "nem")
     686        || !RTStrICmp(pszName, "native-api"))
     687        return VMExecutionEngine_NativeApi;
     688    if (!RTStrICmp(pszName, "interpreter"))
     689        return VMExecutionEngine_Interpreter;
     690    if (   !RTStrICmp(pszName, "recompiler"))
     691        return VMExecutionEngine_Recompiler;
     692
     693    return VMExecutionEngine_NotSet;
     694}
     695
    676696/**
    677697 * Handles the x86-specific modifyvm options.
     
    36133633            }
    36143634
     3635            case MODIFYVM_VMEXEC_ENGINE:
     3636            {
     3637                VMExecutionEngine_T enmExecEngine = nameToVMExecEngine(ValueUnion.psz);
     3638                if (enmExecEngine == VMExecutionEngine_NotSet)
     3639                {
     3640                    errorArgument(ModifyVM::tr("Invalid --vm-execution-engine '%s'"), ValueUnion.psz);
     3641                    hrc = E_FAIL;
     3642                }
     3643                else
     3644                {
     3645                    CHECK_ERROR(sessionMachine, COMSETTER(VMExecutionEngine)(enmExecEngine));
     3646                }
     3647                break;
     3648            }
     3649
    36153650            case MODIFYVM_TESTING_ENABLED:
    36163651                hrc = setExtraData(sessionMachine, "VBoxInternal/Devices/VMMDev/0/Config/TestingEnabled", ValueUnion.f ? "1" : "");
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