VirtualBox

Ignore:
Timestamp:
Apr 10, 2016 3:42:46 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106496
Message:

IMachine: Added CPUProfile attribute (read/write string). Added a modifyvm option for setting it. Show non-default values in showvminfo, but always show it starting with 6.0.

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 edited

Legend:

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

    r59269 r60410  
    3636
    3737#include <VBox/log.h>
     38#include <VBox/version.h>
    3839#include <iprt/stream.h>
    3940#include <iprt/time.h>
     
    445446    } while (0)
    446447
     448    /** @def SHOW_STRING_PROP_MAJ
     449     * For not breaking the output in a dot release we don't show default values. */
     450#define SHOW_STRING_PROP_MAJ(a_pObj, a_Prop, a_szMachine, a_szHuman, a_szUnless, a_uMajorVer) \
     451    do \
     452    { \
     453        Bstr bstr; \
     454        CHECK_ERROR2I_RET(a_pObj, COMGETTER(a_Prop)(bstr.asOutParam()), hrcCheck); \
     455        if ((a_uMajorVer) <= VBOX_VERSION_MAJOR || !bstr.equals(a_szUnless)) \
     456        { \
     457            if (details == VMINFO_MACHINEREADABLE)\
     458                outputMachineReadableString(a_szMachine, &bstr); \
     459            else \
     460                RTPrintf("%-16s %ls\n", a_szHuman ":", bstr.raw()); \
     461        } \
     462    } while (0)
     463
    447464#define SHOW_STRINGARRAY_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman) \
    448465    do \
     
    564581    SHOW_ULONG_PROP(       machine, CPUExecutionCap,            "cpuexecutioncap",      "CPU exec cap",     "%%");
    565582    SHOW_BOOLEAN_PROP(     machine, HPETEnabled,                "hpet",                 "HPET");
     583    SHOW_STRING_PROP_MAJ(  machine, CPUProfile,                 "cpu-profile",          "CPUProfile",       "host", 6);
    566584
    567585    ChipsetType_T chipsetType;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r58437 r60410  
    7272    MODIFYVM_CPUS,
    7373    MODIFYVM_CPUHOTPLUG,
     74    MODIFYVM_CPU_PROFILE,
    7475    MODIFYVM_PLUGCPU,
    7576    MODIFYVM_UNPLUGCPU,
     
    217218static const RTGETOPTDEF g_aModifyVMOptions[] =
    218219{
     220/** @todo Convert to dash separated names like --triple-fault-reset! Please
     221 *        do that for all new options as we don't need more character soups
     222 *        around VirtualBox - typedefs more than covers that demand! */
    219223    { "--name",                     MODIFYVM_NAME,                      RTGETOPT_REQ_STRING },
    220224    { "--groups",                   MODIFYVM_GROUPS,                    RTGETOPT_REQ_STRING },
     
    244248    { "--cpus",                     MODIFYVM_CPUS,                      RTGETOPT_REQ_UINT32 },
    245249    { "--cpuhotplug",               MODIFYVM_CPUHOTPLUG,                RTGETOPT_REQ_BOOL_ONOFF },
     250    { "--cpu-profile",              MODIFYVM_CPU_PROFILE,               RTGETOPT_REQ_STRING },
    246251    { "--plugcpu",                  MODIFYVM_PLUGCPU,                   RTGETOPT_REQ_UINT32 },
    247252    { "--unplugcpu",                MODIFYVM_UNPLUGCPU,                 RTGETOPT_REQ_UINT32 },
     
    774779            }
    775780
     781            case MODIFYVM_CPU_PROFILE:
     782            {
     783                CHECK_ERROR(sessionMachine, COMSETTER(CPUProfile)(Bstr(ValueUnion.psz).raw()));
     784                break;
     785            }
     786
    776787            case MODIFYVM_PLUGCPU:
    777788            {
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