VirtualBox

Changeset 40419 in vbox for trunk


Ignore:
Timestamp:
Mar 10, 2012 2:33:28 AM (13 years ago)
Author:
vboxsync
Message:

showvminfo: Started converting the code into using macros for showing the standard typed properties. Still much to do.

File:
1 edited

Legend:

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

    r40418 r40419  
    249249
    250250#define SHOW_BOOLEAN_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman) \
     251    SHOW_BOOLEAN_PROP_EX(a_pObj, a_Prop, a_szMachine, a_szHuman, "on", "off")
     252
     253#define SHOW_BOOLEAN_PROP_EX(a_pObj, a_Prop, a_szMachine, a_szHuman, a_szTrue, a_szFalse) \
    251254    do \
    252255    { \
    253256        BOOL f; \
    254         CHECK_ERROR2_RET(machine, COMGETTER(a_Prop)(&f), hrcCheck); \
     257        CHECK_ERROR2_RET(a_pObj, COMGETTER(a_Prop)(&f), hrcCheck); \
     258        if (details == VMINFO_MACHINEREADABLE) \
     259            RTPrintf( a_szMachine "=\"%s\"\n", f ? "on" : "off"); \
     260        else \
     261            RTPrintf("%-16s %s\n", a_szHuman ":", f ? a_szTrue : a_szFalse); \
     262    } while (0)
     263
     264#define SHOW_BOOLEAN_METHOD(a_pObj, a_Invocation, a_szMachine, a_szHuman) \
     265    do \
     266    { \
     267        BOOL f; \
     268        CHECK_ERROR2_RET(a_pObj, a_Invocation, hrcCheck); \
    255269        if (details == VMINFO_MACHINEREADABLE) \
    256270            RTPrintf( a_szMachine "=\"%s\"\n", f ? "on" : "off"); \
     
    263277    { \
    264278        Bstr bstr; \
    265         CHECK_ERROR2_RET(machine, COMGETTER(a_Prop)(bstr.asOutParam()), hrcCheck); \
     279        CHECK_ERROR2_RET(a_pObj, COMGETTER(a_Prop)(bstr.asOutParam()), hrcCheck); \
    266280        if (details == VMINFO_MACHINEREADABLE) \
    267281            outputMachineReadableString(a_szMachine, &bstr); \
     
    270284    } while (0)
    271285
     286#define SHOW_UUID_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman) \
     287    SHOW_STRING_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman)
     288
     289#define SHOW_ULONG_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman, a_szUnit) \
     290    do \
     291    { \
     292        ULONG u32; \
     293        CHECK_ERROR2_RET(a_pObj, COMGETTER(a_Prop)(&u32), hrcCheck); \
     294        if (details == VMINFO_MACHINEREADABLE) \
     295            RTPrintf(a_szHuman "=%u", u32); \
     296        else \
     297            RTPrintf("%-16s %u" a_szUnit "\n", a_szHuman ":", u32); \
     298    } while (0)
     299
     300#define SHOW_LONG64_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman, a_szUnit) \
     301    do \
     302    { \
     303        LONG64 i64; \
     304        CHECK_ERROR2_RET(a_pObj, COMGETTER(a_Prop)(&i64), hrcCheck); \
     305        if (details == VMINFO_MACHINEREADABLE) \
     306            RTPrintf(a_szHuman "=%lld", i64); \
     307        else \
     308            RTPrintf("%-16s %'lld" a_szUnit "\n", a_szHuman ":", i64); \
     309    } while (0)
    272310
    273311    /*
     
    283321     */
    284322
    285     /** @todo the quoting is not yet implemented! */
    286     /** @todo error checking! */
    287 
    288     BOOL accessible = FALSE;
    289     CHECK_ERROR(machine, COMGETTER(Accessible)(&accessible));
    290     if (FAILED(rc)) return rc;
    291 
    292     Bstr uuid;
    293     rc = machine->COMGETTER(Id)(uuid.asOutParam());
    294 
    295     if (!accessible)
    296     {
     323    BOOL fAccessible;
     324    CHECK_ERROR2_RET(machine, COMGETTER(Accessible)(&fAccessible), hrcCheck);
     325    if (!fAccessible)
     326    {
     327        Bstr uuid;
     328        machine->COMGETTER(Id)(uuid.asOutParam());
    297329        if (details == VMINFO_COMPACT)
    298330            RTPrintf("\"<inaccessible>\" {%s}\n", Utf8Str(uuid).c_str());
     
    323355    }
    324356
    325     Bstr machineName;
    326     rc = machine->COMGETTER(Name)(machineName.asOutParam());
    327 
    328357    if (details == VMINFO_COMPACT)
    329358    {
     359        Bstr machineName;
     360        machine->COMGETTER(Name)(machineName.asOutParam());
     361        Bstr uuid;
     362        machine->COMGETTER(Id)(uuid.asOutParam());
     363
    330364        RTPrintf("\"%ls\" {%s}\n", machineName.raw(), Utf8Str(uuid).c_str());
    331365        return S_OK;
    332366    }
    333367
    334     if (details == VMINFO_MACHINEREADABLE)
    335         RTPrintf("name=\"%ls\"\n", machineName.raw());
    336     else
    337         RTPrintf("Name:            %ls\n", machineName.raw());
     368    SHOW_STRING_PROP(      machine, Name,                       "name",                 "Name");
    338369
    339370    Bstr osTypeId;
    340     rc = machine->COMGETTER(OSTypeId)(osTypeId.asOutParam());
     371    CHECK_ERROR2_RET(machine, COMGETTER(OSTypeId)(osTypeId.asOutParam()), hrcCheck);
    341372    ComPtr<IGuestOSType> osType;
    342     rc = virtualBox->GetGuestOSType(osTypeId.raw(), osType.asOutParam());
    343     Bstr osName;
    344     rc = osType->COMGETTER(Description)(osName.asOutParam());
    345     if (details == VMINFO_MACHINEREADABLE)
    346         RTPrintf("ostype=\"%ls\"\n", osTypeId.raw());
    347     else
    348         RTPrintf("Guest OS:        %ls\n", osName.raw());
    349 
    350     if (details == VMINFO_MACHINEREADABLE)
    351         RTPrintf("UUID=\"%s\"\n", Utf8Str(uuid).c_str());
    352     else
    353         RTPrintf("UUID:            %s\n", Utf8Str(uuid).c_str());
    354 
    355     Bstr settingsFilePath;
    356     rc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());
    357     if (details == VMINFO_MACHINEREADABLE)
    358         RTPrintf("CfgFile=\"%ls\"\n", settingsFilePath.raw());
    359     else
    360         RTPrintf("Config file:     %ls\n", settingsFilePath.raw());
    361 
    362     Bstr snapshotFolder;
    363     rc = machine->COMGETTER(SnapshotFolder)(snapshotFolder.asOutParam());
    364     if (details == VMINFO_MACHINEREADABLE)
    365         RTPrintf("SnapFldr=\"%ls\"\n", snapshotFolder.raw());
    366     else
    367         RTPrintf("Snapshot folder: %ls\n", snapshotFolder.raw());
    368 
    369     Bstr logFolder;
    370     rc = machine->COMGETTER(LogFolder)(logFolder.asOutParam());
    371     if (details == VMINFO_MACHINEREADABLE)
    372         RTPrintf("LogFldr=\"%ls\"\n", logFolder.raw());
    373     else
    374         RTPrintf("Log folder:      %ls\n", logFolder.raw());
    375 
    376     Bstr strHardwareUuid;
    377     rc = machine->COMGETTER(HardwareUUID)(strHardwareUuid.asOutParam());
    378     if (details == VMINFO_MACHINEREADABLE)
    379         RTPrintf("hardwareuuid=\"%ls\"\n", strHardwareUuid.raw());
    380     else
    381         RTPrintf("Hardware UUID:   %ls\n", strHardwareUuid.raw());
    382 
    383     ULONG memorySize;
    384     rc = machine->COMGETTER(MemorySize)(&memorySize);
    385     if (details == VMINFO_MACHINEREADABLE)
    386         RTPrintf("memory=%u\n", memorySize);
    387     else
    388         RTPrintf("Memory size:     %uMB\n", memorySize);
    389 
    390     BOOL fPageFusionEnabled;
    391     rc = machine->COMGETTER(PageFusionEnabled)(&fPageFusionEnabled);
    392     if (details == VMINFO_MACHINEREADABLE)
    393         RTPrintf("pagefusion=\"%s\"\n", fPageFusionEnabled ? "on" : "off");
    394     else
    395         RTPrintf("Page Fusion:     %s\n", fPageFusionEnabled ? "on" : "off");
    396 
    397     ULONG vramSize;
    398     rc = machine->COMGETTER(VRAMSize)(&vramSize);
    399     if (details == VMINFO_MACHINEREADABLE)
    400         RTPrintf("vram=%u\n", vramSize);
    401     else
    402         RTPrintf("VRAM size:       %uMB\n", vramSize);
    403 
    404     ULONG cpuCap;
    405     rc = machine->COMGETTER(CPUExecutionCap)(&cpuCap);
    406     if (details == VMINFO_MACHINEREADABLE)
    407         RTPrintf("cpuexecutioncap=%u\n", cpuCap);
    408     else
    409         RTPrintf("CPU exec cap:    %u%%\n", cpuCap);
    410 
    411     BOOL fHpetEnabled;
    412     machine->COMGETTER(HpetEnabled)(&fHpetEnabled);
    413     if (details == VMINFO_MACHINEREADABLE)
    414         RTPrintf("hpet=\"%s\"\n", fHpetEnabled ? "on" : "off");
    415     else
    416         RTPrintf("HPET:            %s\n", fHpetEnabled ? "on" : "off");
    417 
    418     ChipsetType_T chipsetType = ChipsetType_Null;
    419     const char *pszChipsetType = NULL;
    420     machine->COMGETTER(ChipsetType)(&chipsetType);
     373    CHECK_ERROR2_RET(virtualBox, GetGuestOSType(osTypeId.raw(), osType.asOutParam()), hrcCheck);
     374    SHOW_STRING_PROP(       osType, Description,                "ostype",               "Guest OS");
     375    SHOW_UUID_PROP(        machine, Id,                         "UUID",                 "UUID");
     376    SHOW_STRING_PROP(      machine, SettingsFilePath,           "CfgFile",              "Config file");
     377    SHOW_STRING_PROP(      machine, SnapshotFolder,             "SnapFldr",             "Snapshot folder");
     378    SHOW_STRING_PROP(      machine, LogFolder,                  "LogFldr",              "Log folder");
     379    SHOW_UUID_PROP(        machine, HardwareUUID,               "hardwareuuid",         "Hardware UUID");
     380    SHOW_ULONG_PROP(       machine, MemorySize,                 "memory",               "Memory size",      "MB");
     381    SHOW_BOOLEAN_PROP(     machine, PageFusionEnabled,          "pagefusion",           "Page Fusion");
     382    SHOW_ULONG_PROP(       machine, VRAMSize,                   "vram",                 "VRAM size",        "MB");
     383    SHOW_ULONG_PROP(       machine, CPUExecutionCap,            "cpuexecutioncap",      "CPU exec cap",     "%%");
     384    SHOW_BOOLEAN_PROP(     machine, PageFusionEnabled,          "hpet",                 "HPET");
     385
     386    ChipsetType_T chipsetType;
     387    CHECK_ERROR2_RET(machine, COMGETTER(ChipsetType)(&chipsetType), hrcCheck);
     388    const char *pszChipsetType;
    421389    switch (chipsetType)
    422390    {
    423         case ChipsetType_Null:
    424             pszChipsetType = "invalid";
    425             break;
    426         case ChipsetType_PIIX3:
    427             pszChipsetType = "piix3";
    428             break;
    429         case ChipsetType_ICH9:
    430             pszChipsetType = "ich9";
    431             break;
    432         default:
    433             Assert(false);
    434             pszChipsetType = "unknown";
     391        case ChipsetType_Null:  pszChipsetType = "invalid"; break;
     392        case ChipsetType_PIIX3: pszChipsetType = "piix3"; break;
     393        case ChipsetType_ICH9:  pszChipsetType = "ich9"; break;
     394        default:                AssertFailed(); pszChipsetType = "unknown"; break;
    435395    }
    436396    if (details == VMINFO_MACHINEREADABLE)
     
    439399        RTPrintf("Chipset:         %s\n", pszChipsetType);
    440400
    441     FirmwareType_T firmwareType = FirmwareType_BIOS;
    442     const char *pszFirmwareType = NULL;
    443     machine->COMGETTER(FirmwareType)(&firmwareType);
     401    FirmwareType_T firmwareType;
     402    CHECK_ERROR2_RET(machine, COMGETTER(FirmwareType)(&firmwareType), hrcCheck);
     403    const char *pszFirmwareType;
    444404    switch (firmwareType)
    445405    {
    446         case FirmwareType_BIOS:
    447             pszFirmwareType = "BIOS";
    448             break;
    449         case FirmwareType_EFI:
    450             pszFirmwareType = "EFI";
    451             break;
    452         case FirmwareType_EFI32:
    453             pszFirmwareType = "EFI32";
    454             break;
    455         case FirmwareType_EFI64:
    456             pszFirmwareType = "EFI64";
    457             break;
    458         case FirmwareType_EFIDUAL:
    459             pszFirmwareType = "EFIDUAL";
    460             break;
    461         default:
    462             Assert(false);
    463             pszFirmwareType = "unknown";
     406        case FirmwareType_BIOS:     pszFirmwareType = "BIOS"; break;
     407        case FirmwareType_EFI:      pszFirmwareType = "EFI"; break;
     408        case FirmwareType_EFI32:    pszFirmwareType = "EFI32"; break;
     409        case FirmwareType_EFI64:    pszFirmwareType = "EFI64"; break;
     410        case FirmwareType_EFIDUAL:  pszFirmwareType = "EFIDUAL"; break;
     411        default:                    AssertFailed(); pszFirmwareType = "unknown"; break;
    464412    }
    465413    if (details == VMINFO_MACHINEREADABLE)
     
    468416        RTPrintf("Firmware:        %s\n", pszFirmwareType);
    469417
    470 
    471     ULONG numCpus;
    472     rc = machine->COMGETTER(CPUCount)(&numCpus);
    473     if (details == VMINFO_MACHINEREADABLE)
    474         RTPrintf("cpus=%u\n", numCpus);
    475     else
    476         RTPrintf("Number of CPUs:  %u\n", numCpus);
    477 
    478     BOOL fSyntheticCpu;
    479     machine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu);
    480     if (details == VMINFO_MACHINEREADABLE)
    481         RTPrintf("synthcpu=\"%s\"\n", fSyntheticCpu ? "on" : "off");
    482     else
    483         RTPrintf("Synthetic Cpu:   %s\n", fSyntheticCpu ? "on" : "off");
     418    SHOW_ULONG_PROP(       machine, CPUCount,                   "cpus",                 "Number of CPUs", "");
     419    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_Synthetic, &f), "synthcpu", "Synthetic Cpu");
    484420
    485421    if (details != VMINFO_MACHINEREADABLE)
     
    513449
    514450    ComPtr <IBIOSSettings> biosSettings;
    515     machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());
     451    CHECK_ERROR2_RET(machine, COMGETTER(BIOSSettings)(biosSettings.asOutParam()), hrcCheck);
    516452
    517453    BIOSBootMenuMode_T bootMenuMode;
    518     biosSettings->COMGETTER(BootMenuMode)(&bootMenuMode);
    519     const char *pszBootMenu = NULL;
     454    CHECK_ERROR2_RET(biosSettings, COMGETTER(BootMenuMode)(&bootMenuMode), hrcCheck);
     455    const char *pszBootMenu;
    520456    switch (bootMenuMode)
    521457    {
     
    540476        RTPrintf("Boot menu mode:  %s\n", pszBootMenu);
    541477
     478    ComPtr<ISystemProperties> systemProperties;
     479    CHECK_ERROR2_RET(virtualBox, COMGETTER(SystemProperties)(systemProperties.asOutParam()), hrcCheck);
    542480    ULONG maxBootPosition = 0;
    543     ComPtr<ISystemProperties> systemProperties;
    544     virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    545     systemProperties->COMGETTER(MaxBootPosition)(&maxBootPosition);
     481    CHECK_ERROR2_RET(systemProperties, COMGETTER(MaxBootPosition)(&maxBootPosition), hrcCheck);
    546482    for (ULONG i = 1; i <= maxBootPosition; i++)
    547483    {
    548484        DeviceType_T bootOrder;
    549         machine->GetBootOrder(i, &bootOrder);
     485        CHECK_ERROR2_RET(machine, GetBootOrder(i, &bootOrder), hrcCheck);
    550486        if (bootOrder == DeviceType_Floppy)
    551487        {
     
    599535    }
    600536
    601     BOOL acpiEnabled;
    602     biosSettings->COMGETTER(ACPIEnabled)(&acpiEnabled);
    603     if (details == VMINFO_MACHINEREADABLE)
    604         RTPrintf("acpi=\"%s\"\n", acpiEnabled ? "on" : "off");
    605     else
    606         RTPrintf("ACPI:            %s\n", acpiEnabled ? "on" : "off");
    607 
    608     BOOL ioapicEnabled;
    609     biosSettings->COMGETTER(IOAPICEnabled)(&ioapicEnabled);
    610     if (details == VMINFO_MACHINEREADABLE)
    611         RTPrintf("ioapic=\"%s\"\n", ioapicEnabled ? "on" : "off");
    612     else
    613         RTPrintf("IOAPIC:          %s\n", ioapicEnabled ? "on" : "off");
    614 
    615     BOOL PAEEnabled;
    616     machine->GetCPUProperty(CPUPropertyType_PAE, &PAEEnabled);
    617     if (details == VMINFO_MACHINEREADABLE)
    618         RTPrintf("pae=\"%s\"\n", PAEEnabled ? "on" : "off");
    619     else
    620         RTPrintf("PAE:             %s\n", PAEEnabled ? "on" : "off");
    621 
    622     LONG64 timeOffset;
    623     biosSettings->COMGETTER(TimeOffset)(&timeOffset);
    624     if (details == VMINFO_MACHINEREADABLE)
    625         RTPrintf("biossystemtimeoffset=%lld\n", timeOffset);
    626     else
    627         RTPrintf("Time offset:     %lld ms\n", timeOffset);
    628 
    629     BOOL RTCUseUTC;
    630     machine->COMGETTER(RTCUseUTC)(&RTCUseUTC);
    631     if (details == VMINFO_MACHINEREADABLE)
    632         RTPrintf("rtcuseutc=\"%s\"\n", RTCUseUTC ? "on" : "off");
    633     else
    634         RTPrintf("RTC:             %s\n", RTCUseUTC ? "UTC" : "local time");
    635 
    636     BOOL hwVirtExEnabled;
    637     machine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &hwVirtExEnabled);
    638     if (details == VMINFO_MACHINEREADABLE)
    639         RTPrintf("hwvirtex=\"%s\"\n", hwVirtExEnabled ? "on" : "off");
    640     else
    641         RTPrintf("Hardw. virt.ext: %s\n", hwVirtExEnabled ? "on" : "off");
    642 
    643     BOOL hwVirtExExclusive;
    644     machine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &hwVirtExExclusive);
    645     if (details == VMINFO_MACHINEREADABLE)
    646         RTPrintf("hwvirtexexcl=\"%s\"\n", hwVirtExExclusive ? "on" : "off");
    647     else
    648         RTPrintf("Hardw. virt.ext exclusive: %s\n", hwVirtExExclusive ? "on" : "off");
    649 
    650     BOOL HWVirtExNestedPagingEnabled;
    651     machine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &HWVirtExNestedPagingEnabled);
    652     if (details == VMINFO_MACHINEREADABLE)
    653         RTPrintf("nestedpaging=\"%s\"\n", HWVirtExNestedPagingEnabled ? "on" : "off");
    654     else
    655         RTPrintf("Nested Paging:   %s\n", HWVirtExNestedPagingEnabled ? "on" : "off");
    656 
    657     BOOL HWVirtExLargePagesEnabled;
    658     machine->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &HWVirtExLargePagesEnabled);
    659     if (details == VMINFO_MACHINEREADABLE)
    660         RTPrintf("largepages=\"%s\"\n", HWVirtExLargePagesEnabled ? "on" : "off");
    661     else
    662         RTPrintf("Large Pages:     %s\n", HWVirtExLargePagesEnabled ? "on" : "off");
    663 
    664     BOOL HWVirtExVPIDEnabled;
    665     machine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &HWVirtExVPIDEnabled);
    666     if (details == VMINFO_MACHINEREADABLE)
    667         RTPrintf("vtxvpid=\"%s\"\n", HWVirtExVPIDEnabled ? "on" : "off");
    668     else
    669         RTPrintf("VT-x VPID:       %s\n", HWVirtExVPIDEnabled ? "on" : "off");
     537    SHOW_BOOLEAN_PROP(biosSettings, ACPIEnabled,                "acpi",                 "ACPI");
     538    SHOW_BOOLEAN_PROP(biosSettings, IOAPICEnabled,              "ioapic",               "IOAPIC");
     539    SHOW_BOOLEAN_METHOD(machine, GetCPUProperty(CPUPropertyType_PAE, &f), "pae",        "PAE");
     540    SHOW_LONG64_PROP(biosSettings,  TimeOffset,                 "biossystemtimeoffset", "Time offset",  "ms");
     541    SHOW_BOOLEAN_PROP_EX(machine,   RTCUseUTC,                  "rtcuseutc",            "RTC",          "UTC", "local time");
     542    SHOW_BOOLEAN_METHOD(machine, GetHWVirtExProperty(HWVirtExPropertyType_Enabled,   &f),   "hwvirtex",     "Hardw. virt.ext");
     543    SHOW_BOOLEAN_METHOD(machine, GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &f),   "hwvirtexexcl", "Hardw. virt.ext exclusive");
     544    SHOW_BOOLEAN_METHOD(machine, GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &f),"nestedpaging", "Nested Paging");
     545    SHOW_BOOLEAN_METHOD(machine, GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &f),  "largepages",   "Large Pages");
     546    SHOW_BOOLEAN_METHOD(machine, GetHWVirtExProperty(HWVirtExPropertyType_VPID, &f),        "vtxvpid",      "VT-x VPID");
    670547
    671548    MachineState_T machineState;
    672     rc = machine->COMGETTER(State)(&machineState);
     549    CHECK_ERROR2_RET(machine, COMGETTER(State)(&machineState), hrcCheck);
    673550    const char *pszState = machineStateToName(machineState, details == VMINFO_MACHINEREADABLE /*=fShort*/);
    674551
     
    679556    char pszTime[30] = {0};
    680557    RTTimeSpecToString(&timeSpec, pszTime, sizeof(pszTime));
    681     Bstr stateFile;
    682     machine->COMGETTER(StateFilePath)(stateFile.asOutParam());
    683558    if (details == VMINFO_MACHINEREADABLE)
    684559    {
    685560        RTPrintf("VMState=\"%s\"\n", pszState);
    686561        RTPrintf("VMStateChangeTime=\"%s\"\n", pszTime);
     562
     563        Bstr stateFile;
     564        machine->COMGETTER(StateFilePath)(stateFile.asOutParam());
    687565        if (!stateFile.isEmpty())
    688566            RTPrintf("VMStateFile=\"%ls\"\n", stateFile.raw());
     
    691569        RTPrintf("State:           %s (since %s)\n", pszState, pszTime);
    692570
    693     ULONG numMonitors;
    694     machine->COMGETTER(MonitorCount)(&numMonitors);
    695     if (details == VMINFO_MACHINEREADABLE)
    696         RTPrintf("monitorcount=%d\n", numMonitors);
    697     else
    698         RTPrintf("Monitor count:   %d\n", numMonitors);
    699 
    700     BOOL accelerate3d;
    701     machine->COMGETTER(Accelerate3DEnabled)(&accelerate3d);
    702     if (details == VMINFO_MACHINEREADABLE)
    703         RTPrintf("accelerate3d=\"%s\"\n", accelerate3d ? "on" : "off");
    704     else
    705         RTPrintf("3D Acceleration: %s\n", accelerate3d ? "on" : "off");
    706 
     571    SHOW_ULONG_PROP(      machine,  MonitorCount,               "monitorcount",             "Monitor count", "");
     572    SHOW_BOOLEAN_PROP(    machine,  Accelerate3DEnabled,        "accelerate3d",             "3D Acceleration");
    707573#ifdef VBOX_WITH_VIDEOHWACCEL
    708     BOOL accelerate2dVideo;
    709     machine->COMGETTER(Accelerate2DVideoEnabled)(&accelerate2dVideo);
    710     if (details == VMINFO_MACHINEREADABLE)
    711         RTPrintf("accelerate2dvideo=\"%s\"\n", accelerate2dVideo ? "on" : "off");
    712     else
    713         RTPrintf("2D Video Acceleration: %s\n", accelerate2dVideo ? "on" : "off");
     574    SHOW_BOOLEAN_PROP(    machine,  Accelerate2DVideoEnabled,   "accelerate2dvideo",        "2D Video Acceleration");
    714575#endif
    715 
    716     BOOL teleporterEnabled;
    717     machine->COMGETTER(TeleporterEnabled)(&teleporterEnabled);
    718     if (details == VMINFO_MACHINEREADABLE)
    719         RTPrintf("teleporterenabled=\"%s\"\n", teleporterEnabled ? "on" : "off");
    720     else
    721         RTPrintf("Teleporter Enabled: %s\n", teleporterEnabled ? "on" : "off");
    722 
    723     ULONG teleporterPort;
    724     machine->COMGETTER(TeleporterPort)(&teleporterPort);
    725     if (details == VMINFO_MACHINEREADABLE)
    726         RTPrintf("teleporterport=%u\n", teleporterPort);
    727     else
    728         RTPrintf("Teleporter Port: %u\n", teleporterPort);
    729 
    730     Bstr teleporterAddress;
    731     machine->COMGETTER(TeleporterAddress)(teleporterAddress.asOutParam());
    732     if (details == VMINFO_MACHINEREADABLE)
    733         RTPrintf("teleporteraddress=\"%ls\"\n", teleporterAddress.raw());
    734     else
    735         RTPrintf("Teleporter Address: %ls\n", teleporterAddress.raw());
    736 
    737     Bstr teleporterPassword;
    738     machine->COMGETTER(TeleporterPassword)(teleporterPassword.asOutParam());
    739     if (details == VMINFO_MACHINEREADABLE)
    740         RTPrintf("teleporterpassword=\"%ls\"\n", teleporterPassword.raw());
    741     else
    742         RTPrintf("Teleporter Password: %ls\n", teleporterPassword.raw());
    743 
    744     SHOW_BOOLEAN_PROP(machine, TracingEnabled, "tracing-enabled", "Tracing Enabled");
    745     SHOW_BOOLEAN_PROP(machine, AllowTracingToAccessVM, "tracing-allow-vm-access", "Allow Tracing to Access VM");
    746     SHOW_STRING_PROP(machine, TracingConfig, "tracing-config", "Tracing Configuration");
    747 
     576    SHOW_BOOLEAN_PROP(    machine,  TeleporterEnabled,          "teleporterenabled",        "Teleporter Enabled");
     577    SHOW_ULONG_PROP(      machine,  TeleporterPort,             "teleporterport",           "Teleporter Port", "");
     578    SHOW_STRING_PROP(     machine,  TeleporterAddress,          "teleporteraddress",        "Teleporter Address");
     579    SHOW_STRING_PROP(     machine,  TeleporterPassword,         "teleporterpassword",       "Teleporter Password");
     580    SHOW_BOOLEAN_PROP(    machine,  TracingEnabled,             "tracing-enabled",          "Tracing Enabled");
     581    SHOW_BOOLEAN_PROP(    machine,  AllowTracingToAccessVM,     "tracing-allow-vm-access",  "Allow Tracing to Access VM");
     582    SHOW_STRING_PROP(     machine,  TracingConfig,              "tracing-config",           "Tracing Configuration");
     583
     584/** @todo Convert the remainder of the function to SHOW_XXX macros and add error
     585 *        checking where missing. */
    748586    /*
    749587     * Storage Controllers and their attached Mediums.
     
    864702
    865703                    medium->COMGETTER(Location)(filePath.asOutParam());
     704                    Bstr uuid;
    866705                    medium->COMGETTER(Id)(uuid.asOutParam());
    867706
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