VirtualBox

Changeset 4779 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 13, 2007 5:48:46 PM (17 years ago)
Author:
vboxsync
Message:

First part of really machine readable output of VBoxManage. Tailored
towards shell scripts/batch files. However proper quoting is currently
missing.

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

Legend:

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

    r4685 r4779  
    279279                 "                            [-details]\n"
    280280                 "                            [-statistics]\n"
     281                 "                            [-machinereadable]\n"
    281282                 "\n");
    282283    }
     
    661662}
    662663
    663 static void showSnapshots(ComPtr<ISnapshot> rootSnapshot, int level = 0)
     664static void showSnapshots(ComPtr<ISnapshot> rootSnapshot, VMINFO_DETAILS details, const Bstr &prefix = "", int level = 0)
    664665{
    665666    /* start with the root */
     
    668669    rootSnapshot->COMGETTER(Name)(name.asOutParam());
    669670    rootSnapshot->COMGETTER(Id)(uuid.asOutParam());
    670     /* print with indentation */
    671     RTPrintf("%*sName: %lS (UUID: %s)\n", level * 3, "", name.raw(), uuid.toString().raw());
     671    if (details == VMINFO_MACHINEREADABLE)
     672    {
     673        /* print with hierarchical numbering */
     674        RTPrintf("SnapshotName%lS=\"%lS\"\n", prefix.raw(), name.raw());
     675        RTPrintf("SnapshotUUID%lS=\"%s\"\n", prefix.raw(), uuid.toString().raw());
     676    }
     677    else
     678    {
     679        /* print with indentation */
     680        RTPrintf("   %lSName: %lS (UUID: %s)\n", prefix.raw(), name.raw(), uuid.toString().raw());
     681    }
    672682
    673683    /* get the children */
     
    678688        ComPtr<ISnapshotEnumerator> enumerator;
    679689        coll->Enumerate(enumerator.asOutParam());
     690        ULONG index = 0;
    680691        BOOL hasMore = FALSE;
    681692        while (enumerator->HasMore(&hasMore), hasMore)
     
    685696            if (snapshot)
    686697            {
     698                Bstr newPrefix;
     699                if (details == VMINFO_MACHINEREADABLE)
     700                    newPrefix = Utf8StrFmt("%lS-%d", prefix.raw(), index + 1);
     701                else
     702                    newPrefix = Utf8StrFmt("%lS   ", prefix.raw());
    687703                /* recursive call */
    688                 showSnapshots(snapshot, level + 1);
    689             }
     704                showSnapshots(snapshot, details, newPrefix, level + 1);
     705            }
     706            index++;
    690707        }
    691708    }
     
    712729    HRESULT rc;
    713730
     731    /*
     732     * The rules for output in -argdump format:
     733     * 1) the key part (the [0-9a-zA-Z_]+ string before the '=' delimiter)
     734     *    is all lowercase for "VBoxManage modifyvm" parameters. Any
     735     *    other values printed are in CamelCase.
     736     * 2) strings (anything non-decimal) are printed surrounded by
     737     *    double quotes '"'. If the strings themselves contain double
     738     *    quotes, these characters are escaped by '\'. Any '\' character
     739     *    in the original string is also escaped by '\'.
     740     * 3) numbers (containing just [0-9\-]) are written out unchanged.
     741     */
     742
     743    /** @todo the quoting is not yet implemented! */
     744
    714745    BOOL accessible = FALSE;
    715746    CHECK_ERROR (machine, COMGETTER(Accessible) (&accessible));
     
    718749    if (!accessible)
    719750    {
    720         RTPrintf ("Name:            <inaccessible!>\n");
     751        if (details == VMINFO_MACHINEREADABLE)
     752            RTPrintf("name=\"<inaccessible>\"\n");
     753        else
     754            RTPrintf ("Name:            <inaccessible!>\n");
    721755        Guid uuid;
    722756        rc = machine->COMGETTER(Id) (uuid.asOutParam());
    723         RTPrintf ("UUID:            %s\n", uuid.toString().raw());
    724         Bstr settingsFilePath;
    725         rc = machine->COMGETTER(SettingsFilePath) (settingsFilePath.asOutParam());
    726         RTPrintf ("Config file:     %lS\n", settingsFilePath.raw());
    727         ComPtr<IVirtualBoxErrorInfo> accessError;
    728         rc = machine->COMGETTER(AccessError) (accessError.asOutParam());
    729         RTPrintf ("Access error details:\n");
    730         ErrorInfo ei (accessError);
    731         ei.print ("[-] ");
    732         RTPrintf ("\n");
     757        if (details == VMINFO_MACHINEREADABLE)
     758            RTPrintf ("UUID=\"%s\"\n", uuid.toString().raw());
     759        else
     760            RTPrintf ("UUID:            %s\n", uuid.toString().raw());
     761        if (details != VMINFO_MACHINEREADABLE)
     762        {
     763            Bstr settingsFilePath;
     764            rc = machine->COMGETTER(SettingsFilePath) (settingsFilePath.asOutParam());
     765            RTPrintf ("Config file:     %lS\n", settingsFilePath.raw());
     766            ComPtr<IVirtualBoxErrorInfo> accessError;
     767            rc = machine->COMGETTER(AccessError) (accessError.asOutParam());
     768            RTPrintf ("Access error details:\n");
     769            ErrorInfo ei (accessError);
     770            ei.print ("[-] ");
     771            RTPrintf ("\n");
     772        }
    733773        return S_OK;
    734774    }
     
    736776    Bstr machineName;
    737777    rc = machine->COMGETTER(Name)(machineName.asOutParam());
    738     RTPrintf("Name:            %lS\n", machineName.raw());
     778    if (details == VMINFO_MACHINEREADABLE)
     779        RTPrintf("name=\"%lS\"\n", machineName.raw());
     780    else
     781        RTPrintf("Name:            %lS\n", machineName.raw());
    739782
    740783    Bstr osTypeId;
     
    744787    Bstr osName;
    745788    rc = osType->COMGETTER(Description)(osName.asOutParam());
    746     RTPrintf("Guest OS:        %lS\n", osName.raw());
     789    if (details == VMINFO_MACHINEREADABLE)
     790        RTPrintf("ostype=\"%lS\"\n", osTypeId.raw());
     791    else
     792        RTPrintf("Guest OS:        %lS\n", osName.raw());
    747793
    748794    Guid uuid;
    749795    rc = machine->COMGETTER(Id)(uuid.asOutParam());
    750     RTPrintf("UUID:            %s\n", uuid.toString().raw());
     796    if (details == VMINFO_MACHINEREADABLE)
     797        RTPrintf("UUID=\"%s\"\n", uuid.toString().raw());
     798    else
     799        RTPrintf("UUID:            %s\n", uuid.toString().raw());
    751800
    752801    Bstr settingsFilePath;
    753802    rc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());
    754     RTPrintf("Config file:     %lS\n", settingsFilePath.raw());
     803    if (details == VMINFO_MACHINEREADABLE)
     804        RTPrintf("CfgFile=\"%lS\"\n", settingsFilePath.raw());
     805    else
     806        RTPrintf("Config file:     %lS\n", settingsFilePath.raw());
    755807
    756808    ULONG memorySize;
    757809    rc = machine->COMGETTER(MemorySize)(&memorySize);
    758     RTPrintf("Memory size:     %uMB\n", memorySize);
     810    if (details == VMINFO_MACHINEREADABLE)
     811        RTPrintf("memory=%u\n", memorySize);
     812    else
     813        RTPrintf("Memory size:     %uMB\n", memorySize);
    759814
    760815    ULONG vramSize;
    761816    rc = machine->COMGETTER(VRAMSize)(&vramSize);
    762     RTPrintf("VRAM size:       %uMB\n", vramSize);
     817    if (details == VMINFO_MACHINEREADABLE)
     818        RTPrintf("vram=%u\n", vramSize);
     819    else
     820        RTPrintf("VRAM size:       %uMB\n", vramSize);
    763821
    764822    ComPtr <IBIOSSettings> biosSettings;
     
    767825    BIOSBootMenuMode_T bootMenuMode;
    768826    biosSettings->COMGETTER(BootMenuMode)(&bootMenuMode);
    769     RTPrintf("Boot menu mode:  ");
     827    const char *pszBootMenu = NULL;
    770828    switch (bootMenuMode)
    771829    {
    772830        case BIOSBootMenuMode_Disabled:
    773             RTPrintf("disabled\n");
     831            pszBootMenu = "disabled";
    774832            break;
    775833        case BIOSBootMenuMode_MenuOnly:
    776             RTPrintf("menu only\n");
     834            if (details == VMINFO_MACHINEREADABLE)
     835                pszBootMenu = "menuonly";
     836            else
     837                pszBootMenu = "menu only";
    777838            break;
    778839        default:
    779             RTPrintf("message and menu\n");
    780     }
     840            if (details == VMINFO_MACHINEREADABLE)
     841                pszBootMenu = "messageandmenu";
     842            else
     843                pszBootMenu = "message and menu";
     844    }
     845    if (details == VMINFO_MACHINEREADABLE)
     846        RTPrintf("bootmenu=\"%s\"\n", pszBootMenu);
     847    else
     848        RTPrintf("Boot menu mode:  %s\n", pszBootMenu);
    781849
    782850    BOOL acpiEnabled;
    783851    biosSettings->COMGETTER(ACPIEnabled)(&acpiEnabled);
    784     RTPrintf("ACPI:            %s\n", acpiEnabled ? "on" : "off");
     852    if (details == VMINFO_MACHINEREADABLE)
     853        RTPrintf("acpi=\"%s\"\n", acpiEnabled ? "on" : "off");
     854    else
     855        RTPrintf("ACPI:            %s\n", acpiEnabled ? "on" : "off");
    785856
    786857    BOOL ioapicEnabled;
    787858    biosSettings->COMGETTER(IOAPICEnabled)(&ioapicEnabled);
    788     RTPrintf("IOAPIC:          %s\n", ioapicEnabled ? "on" : "off");
     859    if (details == VMINFO_MACHINEREADABLE)
     860        RTPrintf("ioapic=\"%s\"\n", ioapicEnabled ? "on" : "off");
     861    else
     862        RTPrintf("IOAPIC:          %s\n", ioapicEnabled ? "on" : "off");
    789863
    790864    LONG64 timeOffset;
    791865    biosSettings->COMGETTER(TimeOffset)(&timeOffset);
    792     RTPrintf("Time offset:     %lld ms\n", timeOffset);
     866    if (details == VMINFO_MACHINEREADABLE)
     867        RTPrintf("biossystemtimeoffset=%lld\n", timeOffset);
     868    else
     869        RTPrintf("Time offset:     %lld ms\n", timeOffset);
    793870
    794871    TriStateBool_T hwVirtExEnabled;
     
    800877        virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    801878        systemProperties->COMGETTER(HWVirtExEnabled)(&fHWVirtExEnabled);
    802         RTPrintf("Hardw. virt.ext: Default (%s)\n", fHWVirtExEnabled ? "on" : "off");
     879        if (details == VMINFO_MACHINEREADABLE)
     880            RTPrintf("hwvirtex=\"default\"\n");
     881        else
     882            RTPrintf("Hardw. virt.ext: Default (%s)\n", fHWVirtExEnabled ? "on" : "off");
    803883    }
    804884    else
    805885    {
    806         RTPrintf("Hardw. virt.ext: %s\n", hwVirtExEnabled == TriStateBool_True ? "on" : "off");
     886        if (details == VMINFO_MACHINEREADABLE)
     887            RTPrintf("hwvirtex=\"%s\"\n", hwVirtExEnabled == TriStateBool_True ? "on" : "off");
     888        else
     889            RTPrintf("Hardw. virt.ext: %s\n", hwVirtExEnabled == TriStateBool_True ? "on" : "off");
    807890    }
    808891
     
    813896    {
    814897        case MachineState_PoweredOff:
    815             pszState = "powered off";
     898            if (details == VMINFO_MACHINEREADABLE)
     899                pszState = "poweroff";
     900            else
     901                pszState = "powered off";
    816902            break;
    817903        case MachineState_Saved:
     
    849935    char pszTime[30] = {0};
    850936    RTTimeSpecToString(&timeSpec, pszTime, 30);
    851     RTPrintf("State:           %s (since %s)\n", pszState, pszTime);
     937    if (details == VMINFO_MACHINEREADABLE)
     938    {
     939        RTPrintf("VMState=\"%s\"\n", pszState);
     940        RTPrintf("VMStateChangeTime=\"%s\"\n", pszTime);
     941    }
     942    else
     943        RTPrintf("State:           %s (since %s)\n", pszState, pszTime);
    852944
    853945    ULONG numMonitors;
    854946    machine->COMGETTER(MonitorCount)(&numMonitors);
    855     RTPrintf("Monitor count:   %d\n", numMonitors);
     947    if (details == VMINFO_MACHINEREADABLE)
     948        RTPrintf("monitorcount=%d\n", numMonitors);
     949    else
     950        RTPrintf("Monitor count:   %d\n", numMonitors);
    856951
    857952    ComPtr<IFloppyDrive> floppyDrive;
     
    878973                        Guid imageGuid;
    879974                        floppyImage->COMGETTER(Id)(imageGuid.asOutParam());
    880                         pszFloppy = Utf8StrFmt("%lS (UUID: %s)", imagePath.raw(), imageGuid.toString().raw());
     975                        if (details == VMINFO_MACHINEREADABLE)
     976                        {
     977                            RTPrintf("FloppyImageUUID=\"%s\"\n", imageGuid.toString().raw());
     978                            pszFloppy = Utf8StrFmt("%lS", imagePath.raw());
     979                        }
     980                        else
     981                            pszFloppy = Utf8StrFmt("%lS (UUID: %s)", imagePath.raw(), imageGuid.toString().raw());
    881982                    }
    882983                    break;
     
    891992                        Bstr driveName;
    892993                        hostFloppyDrive->COMGETTER(Name)(driveName.asOutParam());
    893                         pszFloppy = Utf8StrFmt("Host drive %lS", driveName.raw());
     994                        if (details == VMINFO_MACHINEREADABLE)
     995                            pszFloppy = Utf8StrFmt("host:%lS", driveName.raw());
     996                        else
     997                            pszFloppy = Utf8StrFmt("Host drive %lS", driveName.raw());
    894998                    }
    895999                    break;
     
    9071011            pszFloppy = "disabled";
    9081012        }
    909         RTPrintf("Floppy:          %s\n", pszFloppy.raw());
     1013        if (details == VMINFO_MACHINEREADABLE)
     1014            RTPrintf("floppy=\"%s\"\n", pszFloppy.raw());
     1015        else
     1016            RTPrintf("Floppy:          %s\n", pszFloppy.raw());
    9101017    }
    9111018
     
    9221029        hardDisk->COMGETTER(Location)(filePath.asOutParam());
    9231030        hardDisk->COMGETTER(Id)(uuid.asOutParam());
    924         RTPrintf("Primary master:  %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1031        if (details == VMINFO_MACHINEREADABLE)
     1032        {
     1033            RTPrintf("hda=\"%lS\"\n", filePath.raw());
     1034            RTPrintf("HdaImageUUID=\"%s\"\n", uuid.toString().raw());
     1035        }
     1036        else
     1037            RTPrintf("Primary master:  %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1038    }
     1039    else
     1040    {
     1041        if (details == VMINFO_MACHINEREADABLE)
     1042            RTPrintf("hda=\"none\"\n");
    9251043    }
    9261044    rc = machine->GetHardDisk(DiskControllerType_IDE0Controller, 1, hardDisk.asOutParam());
     
    9341052        hardDisk->COMGETTER(Location)(filePath.asOutParam());
    9351053        hardDisk->COMGETTER(Id)(uuid.asOutParam());
    936         RTPrintf("Primary slave:   %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1054        if (details == VMINFO_MACHINEREADABLE)
     1055        {
     1056            RTPrintf("hdb=\"%lS\"\n", filePath.raw());
     1057            RTPrintf("HdbImageUUID=\"%s\"\n", uuid.toString().raw());
     1058        }
     1059        else
     1060            RTPrintf("Primary slave:   %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1061    }
     1062    else
     1063    {
     1064        if (details == VMINFO_MACHINEREADABLE)
     1065            RTPrintf("hdb=\"none\"\n");
    9371066    }
    9381067    rc = machine->GetHardDisk(DiskControllerType_IDE1Controller, 1, hardDisk.asOutParam());
     
    9461075        hardDisk->COMGETTER(Location)(filePath.asOutParam());
    9471076        hardDisk->COMGETTER(Id)(uuid.asOutParam());
    948         RTPrintf("Secondary slave: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1077        if (details == VMINFO_MACHINEREADABLE)
     1078        {
     1079            RTPrintf("hdd=\"%lS\"\n", filePath.raw());
     1080            RTPrintf("HddImageUUID=\"%s\"\n", uuid.toString().raw());
     1081        }
     1082        else
     1083            RTPrintf("Secondary slave: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1084    }
     1085    else
     1086    {
     1087        if (details == VMINFO_MACHINEREADABLE)
     1088            RTPrintf("hdd=\"none\"\n");
    9491089    }
    9501090    ComPtr<IDVDDrive> dvdDrive;
     
    9601100            {
    9611101                rc = dvdImage->COMGETTER(Id)(uuid.asOutParam());
    962                 RTPrintf("DVD:             %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
     1102                if (details == VMINFO_MACHINEREADABLE)
     1103                {
     1104                    RTPrintf("dvd=\"%lS\"\n", filePath.raw());
     1105                    RTPrintf("DvdImageUUID=\"%s\"\n", uuid.toString().raw());
     1106                }
     1107                else
     1108                    RTPrintf("DVD:             %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
    9631109            }
    9641110        }
     
    9711117                Bstr name;
    9721118                hostDVDDrive->COMGETTER(Name)(name.asOutParam());
    973                 RTPrintf("DVD:             Host drive %lS", name.raw());
     1119                if (details == VMINFO_MACHINEREADABLE)
     1120                    RTPrintf("dvd=\"host:%lS\"\n", name.raw());
     1121                else
     1122                    RTPrintf("DVD:             Host drive %lS", name.raw());
    9741123            }
    9751124            else
    976                 RTPrintf("DVD:             empty");
     1125            {
     1126                if (details == VMINFO_MACHINEREADABLE)
     1127                    RTPrintf("dvd=\"none\"\n");
     1128                else
     1129                    RTPrintf("DVD:             empty");
     1130            }
    9771131            BOOL fPassthrough;
    9781132            dvdDrive->COMGETTER(Passthrough)(&fPassthrough);
    979             if (fPassthrough)
    980                 RTPrintf(" (passthrough enabled)");
    981             RTPrintf("\n");
     1133            if (details == VMINFO_MACHINEREADABLE)
     1134            {
     1135                RTPrintf("dvdpassthrough=\"%s\"\n", fPassthrough ? "on" : "off");
     1136            }
     1137            else
     1138            {
     1139                if (fPassthrough)
     1140                    RTPrintf(" (passthrough enabled)");
     1141                RTPrintf("\n");
     1142            }
    9821143        }
    9831144    }
     
    9981159            if (!fEnabled)
    9991160            {
    1000                 RTPrintf("NIC %d:           disabled\n", currentNIC + 1);
     1161                if (details == VMINFO_MACHINEREADABLE)
     1162                    RTPrintf("nic%d=\"none\"\n", currentNIC + 1);
     1163                else
     1164                    RTPrintf("NIC %d:           disabled\n", currentNIC + 1);
    10011165            }
    10021166            else
     
    10101174                {
    10111175                    case NetworkAttachmentType_NoNetworkAttachment:
    1012                         strAttachment = "none";
     1176                        if (details == VMINFO_MACHINEREADABLE)
     1177                            strAttachment = "null";
     1178                        else
     1179                            strAttachment = "none";
    10131180                        break;
    10141181                    case NetworkAttachmentType_NATNetworkAttachment:
    1015                         strAttachment = "NAT";
     1182                        if (details == VMINFO_MACHINEREADABLE)
     1183                            strAttachment = "nat";
     1184                        else
     1185                            strAttachment = "NAT";
    10161186                        break;
    10171187                    case NetworkAttachmentType_HostInterfaceNetworkAttachment:
    1018                         strAttachment = "Host Interface";
     1188                    {
     1189                        Bstr strHostIfDev;
     1190                        nic->COMGETTER(HostInterface)(strHostIfDev.asOutParam());
     1191                        if (details == VMINFO_MACHINEREADABLE)
     1192                        {
     1193                            RTPrintf("hostifdev%d=\"%lS\"\n", currentNIC + 1, strHostIfDev.raw());
     1194                            strAttachment = "hostif";
     1195                        }
     1196                        else
     1197                            strAttachment = Utf8StrFmt("Host Interface '%lS'", strHostIfDev.raw());
    10191198                        break;
     1199                    }
    10201200                    case NetworkAttachmentType_InternalNetworkAttachment:
    10211201                    {
    10221202                        Bstr strNetwork;
    10231203                        nic->COMGETTER(InternalNetwork)(strNetwork.asOutParam());
    1024                         strAttachment = Utf8StrFmt("Internal Network '%s'", Utf8Str(strNetwork).raw());
     1204                        if (details == VMINFO_MACHINEREADABLE)
     1205                        {
     1206                            RTPrintf("intnet%d=\"%lS\"\n", currentNIC + 1, strNetwork.raw());
     1207                            strAttachment = "intnet";
     1208                        }
     1209                        else
     1210                            strAttachment = Utf8StrFmt("Internal Network '%s'", Utf8Str(strNetwork).raw());
    10251211                        break;
    10261212                    }
     
    10301216                }
    10311217
     1218                /* cable connected */
     1219                BOOL fConnected;
     1220                nic->COMGETTER(CableConnected)(&fConnected);
     1221
    10321222                /* trace stuff */
    10331223                BOOL fTraceEnabled;
     
    10361226                nic->COMGETTER(TraceFile)(traceFile.asOutParam());
    10371227
    1038                 RTPrintf("NIC %d:           MAC: %lS, Attachment: %s, Trace: %s (file: %lS)\n",
    1039                          currentNIC + 1, strMACAddress.raw(), strAttachment.raw(),
    1040                          fTraceEnabled ? "on" : "off", traceFile.raw());
     1228                if (details == VMINFO_MACHINEREADABLE)
     1229                {
     1230                    RTPrintf("macaddress%d=\"%lS\"\n", currentNIC + 1, strMACAddress.raw());
     1231                    RTPrintf("cableconnected%d=\"%s\"\n", currentNIC + 1, fConnected ? "on" : "off");
     1232                    RTPrintf("nic%d=\"%s\"\n", currentNIC + 1, strAttachment.raw());
     1233                }
     1234                else
     1235                    RTPrintf("NIC %d:           MAC: %lS, Attachment: %s, Cable connected: %s, Trace: %s (file: %lS)\n",
     1236                             currentNIC + 1, strMACAddress.raw(), strAttachment.raw(),
     1237                             fConnected ? "on" : "off",
     1238                             fTraceEnabled ? "on" : "off", traceFile.raw());
    10411239            }
    10421240        }
     
    10561254            if (!fEnabled)
    10571255            {
    1058                 RTPrintf("UART %d:          disabled\n", currentUART + 1);
     1256                if (details == VMINFO_MACHINEREADABLE)
     1257                    RTPrintf("uart%d=\"off\"\n", currentUART + 1);
     1258                else
     1259                    RTPrintf("UART %d:          disabled\n", currentUART + 1);
    10591260            }
    10601261            else
     
    10701271                uart->COMGETTER(HostMode)(&HostMode);
    10711272
    1072                 RTPrintf("UART %d:          I/O base: 0x%04x, IRQ: %d",
    1073                          currentUART + 1, ulIOBase, ulIRQ);
     1273                if (details == VMINFO_MACHINEREADABLE)
     1274                    RTPrintf("uart%d=\"%#06x,%d\"\n", currentUART + 1,
     1275                             ulIOBase, ulIRQ);
     1276                else
     1277                    RTPrintf("UART %d:          I/O base: 0x%04x, IRQ: %d",
     1278                             currentUART + 1, ulIOBase, ulIRQ);
    10741279                switch (HostMode)
    10751280                {
    10761281                    default:
    10771282                    case PortMode_DisconnectedPort:
    1078                         RTPrintf(", disconnected\n");
     1283                        if (details == VMINFO_MACHINEREADABLE)
     1284                            RTPrintf("uartmode%d=\"disconnected\"\n", currentUART + 1);
     1285                        else
     1286                            RTPrintf(", disconnected\n");
    10791287                        break;
    10801288                    case PortMode_HostPipePort:
    1081                         RTPrintf(", attached to pipe (%s) '%lS'\n",
    1082                                 fServer ? "server" : "client", path.raw());
     1289                        if (details == VMINFO_MACHINEREADABLE)
     1290                            RTPrintf("uartmode%d=\"%s,%lS\"\n", currentUART + 1,
     1291                                     fServer ? "server" : "client", path.raw());
     1292                        else
     1293                            RTPrintf(", attached to pipe (%s) '%lS'\n",
     1294                                     fServer ? "server" : "client", path.raw());
    10831295                        break;
    10841296                    case PortMode_HostDevicePort:
    1085                         RTPrintf(", attached to device '%lS'\n", path.raw());
     1297                        if (details == VMINFO_MACHINEREADABLE)
     1298                            RTPrintf("uartmode%d=\"%lS\"\n", currentUART + 1,
     1299                                     path.raw());
     1300                        else
     1301                            RTPrintf(", attached to device '%lS'\n", path.raw());
    10861302                        break;
    10871303                }
     
    11031319            switch (enmType)
    11041320            {
    1105                 case  AudioDriverType_NullAudioDriver:   psz = "Null"; break;
    1106                 case  AudioDriverType_WINMMAudioDriver:  psz = "WINMM"; break;
    1107                 case  AudioDriverType_DSOUNDAudioDriver: psz = "DSOUND"; break;
    1108                 case  AudioDriverType_OSSAudioDriver:    psz = "OSS"; break;
    1109                 case  AudioDriverType_ALSAAudioDriver:   psz = "ALSA"; break;
    1110                 case  AudioDriverType_CoreAudioDriver:   psz = "CoreAudio"; break;
    1111                 default: ; break;
     1321                case AudioDriverType_NullAudioDriver:
     1322                    if (details == VMINFO_MACHINEREADABLE)
     1323                        psz = "null";
     1324                    else
     1325                        psz = "Null";
     1326                    break;
     1327                case AudioDriverType_WINMMAudioDriver:
     1328                    if (details == VMINFO_MACHINEREADABLE)
     1329                        psz = "winmm";
     1330                    else
     1331                        psz = "WINMM";
     1332                    break;
     1333                case AudioDriverType_DSOUNDAudioDriver:
     1334                    if (details == VMINFO_MACHINEREADABLE)
     1335                        psz = "dsound";
     1336                    else
     1337                        psz = "DSOUND";
     1338                    break;
     1339                case AudioDriverType_OSSAudioDriver:
     1340                    if (details == VMINFO_MACHINEREADABLE)
     1341                        psz = "oss";
     1342                    else
     1343                        psz = "OSS";
     1344                    break;
     1345                case AudioDriverType_ALSAAudioDriver:
     1346                    if (details == VMINFO_MACHINEREADABLE)
     1347                        psz = "alsa";
     1348                    else
     1349                        psz = "ALSA";
     1350                    break;
     1351                case AudioDriverType_CoreAudioDriver:
     1352                    if (details == VMINFO_MACHINEREADABLE)
     1353                        psz = "coreaudio";
     1354                    else
     1355                        psz = "CoreAudio";
     1356                    break;
     1357                default:
     1358                    if (details == VMINFO_MACHINEREADABLE)
     1359                        psz = "unknown";
     1360                    break;
    11121361            }
    11131362        }
    11141363        else
    11151364            fEnabled = FALSE;
    1116         RTPrintf("Audio:           %s (Driver: %s)\n", fEnabled ? "enabled" : "disabled", psz);
     1365        if (details == VMINFO_MACHINEREADABLE)
     1366        {
     1367            if (fEnabled)
     1368                RTPrintf("audio=\"%s\"\n", psz);
     1369            else
     1370                RTPrintf("audio=\"none\"\n");
     1371        }
     1372        else
     1373            RTPrintf("Audio:           %s (Driver: %s)\n", fEnabled ? "enabled" : "disabled", psz);
    11171374    }
    11181375
     
    11201377    {
    11211378        const char *psz = "Unknown";
    1122             ClipboardMode_T enmMode;
    1123             rc = machine->COMGETTER(ClipboardMode)(&enmMode);
    1124             switch (enmMode)
    1125             {
    1126                 case  ClipboardMode_ClipDisabled:      psz = "disabled"; break;
    1127                 case  ClipboardMode_ClipHostToGuest:   psz = "HostToGuest"; break;
    1128                 case  ClipboardMode_ClipGuestToHost:   psz = "GuestToHost"; break;
    1129                 case  ClipboardMode_ClipBidirectional: psz = "Bidirectional"; break;
    1130                 default: ; break;
    1131             }
    1132         RTPrintf("Clipboard Mode:  %s\n", psz);
     1379        ClipboardMode_T enmMode;
     1380        rc = machine->COMGETTER(ClipboardMode)(&enmMode);
     1381        switch (enmMode)
     1382        {
     1383            case ClipboardMode_ClipDisabled:
     1384                if (details == VMINFO_MACHINEREADABLE)
     1385                    psz = "disabled";
     1386                else
     1387                    psz = "disabled";
     1388                break;
     1389            case ClipboardMode_ClipHostToGuest:
     1390                if (details == VMINFO_MACHINEREADABLE)
     1391                    psz = "hosttoguest";
     1392                else
     1393                    psz = "HostToGuest";
     1394                break;
     1395            case ClipboardMode_ClipGuestToHost:
     1396                if (details == VMINFO_MACHINEREADABLE)
     1397                    psz = "guesttohost";
     1398                else
     1399                    psz = "GuestToHost";
     1400                break;
     1401            case ClipboardMode_ClipBidirectional:
     1402                if (details == VMINFO_MACHINEREADABLE)
     1403                    psz = "bidirectional";
     1404                else
     1405                    psz = "Bidirectional";
     1406                break;
     1407            default:
     1408                if (details == VMINFO_MACHINEREADABLE)
     1409                    psz = "unknown";
     1410                break;
     1411        }
     1412        if (details == VMINFO_MACHINEREADABLE)
     1413            RTPrintf("clipboard=\"%s\"\n", psz);
     1414        else
     1415            RTPrintf("Clipboard Mode:  %s\n", psz);
    11331416    }
    11341417
     
    11411424        CHECK_ERROR_RET(display, COMGETTER(Height)(&yRes), rc);
    11421425        CHECK_ERROR_RET(display, COMGETTER(BitsPerPixel)(&bpp), rc);
    1143         RTPrintf("Video mode:      %dx%dx%d\n", xRes, yRes, bpp);
     1426        if (details == VMINFO_MACHINEREADABLE)
     1427            RTPrintf("VideoMode=\"%d,%d,%d\"\n", xRes, yRes, bpp);
     1428        else
     1429            RTPrintf("Video mode:      %dx%dx%d\n", xRes, yRes, bpp);
    11441430    }
    11451431
     
    11571443            ULONG port;
    11581444            vrdpServer->COMGETTER(Port)(&port);
     1445            Bstr address;
     1446            vrdpServer->COMGETTER(NetAddress)(address.asOutParam());
     1447            BOOL fMultiCon;
     1448            vrdpServer->COMGETTER(AllowMultiConnection)(&fMultiCon);
    11591449            VRDPAuthType_T vrdpAuthType;
    11601450            const char *strAuthType;
     
    11751465                    break;
    11761466            }
    1177             RTPrintf("VRDP:            enabled (Port %d, Authentication type: %s)\n", port, strAuthType);
     1467            if (details == VMINFO_MACHINEREADABLE)
     1468            {
     1469                RTPrintf("vrdp=\"on\"\n");
     1470                RTPrintf("vrdpport=%d\n", port);
     1471                RTPrintf("vrdpaddress=\"%lS\"\n", address.raw());
     1472                RTPrintf("vrdpauthtype=\"%s\"\n", strAuthType);
     1473                RTPrintf("vrdpmulticon=\"%s\"\n", fMultiCon ? "on" : "off");
     1474            }
     1475            else
     1476                RTPrintf("VRDP:            enabled (Address %lS, Port %d, MultiConn: %s, Authentication type: %s)\n", address.raw(), port, fMultiCon ? "on" : "off", strAuthType);
    11781477        }
    11791478        else
    1180             RTPrintf("VRDP:            disabled\n");
     1479        {
     1480            if (details == VMINFO_MACHINEREADABLE)
     1481                RTPrintf("vrdp=\"off\"\n");
     1482            else
     1483                RTPrintf("VRDP:            disabled\n");
     1484        }
    11811485    }
    11821486
     
    11921496        if (FAILED(rc))
    11931497            fEnabled = false;
    1194         RTPrintf("USB:             %s\n", fEnabled ? "enabled" : "disabled");
    1195 
    1196         RTPrintf("\nUSB Device Filters:\n\n");
     1498        if (details == VMINFO_MACHINEREADABLE)
     1499            RTPrintf("usb=\"%s\"\n", fEnabled ? "on" : "off");
     1500        else
     1501            RTPrintf("USB:             %s\n", fEnabled ? "enabled" : "disabled");
     1502
     1503        if (details != VMINFO_MACHINEREADABLE)
     1504            RTPrintf("\nUSB Device Filters:\n\n");
    11971505
    11981506        ComPtr<IUSBDeviceFilterCollection> Coll;
     
    12091517        if (!fMore)
    12101518        {
    1211             RTPrintf("<none>\n\n");
     1519            if (details != VMINFO_MACHINEREADABLE)
     1520                RTPrintf("<none>\n\n");
    12121521        }
    12131522        else
     
    12201529            /* Query info. */
    12211530
    1222             RTPrintf("Index:            %lu\n", index);
     1531            if (details == VMINFO_MACHINEREADABLE)
     1532                RTPrintf("Index:            %lu\n", index);
    12231533
    12241534            BOOL bActive = FALSE;
    12251535            CHECK_ERROR_RET (DevPtr, COMGETTER (Active) (&bActive), rc);
    1226             RTPrintf("Active:           %s\n", bActive ? "yes" : "no");
     1536            if (details == VMINFO_MACHINEREADABLE)
     1537                RTPrintf("USBFilterActive%d=\"%s\"\n", index + 1, bActive ? "on" : "off");
     1538            else
     1539                RTPrintf("Active:           %s\n", bActive ? "yes" : "no");
    12271540
    12281541            Bstr bstr;
    12291542            CHECK_ERROR_RET (DevPtr, COMGETTER (Name) (bstr.asOutParam()), rc);
    1230             RTPrintf("Name:             %lS\n", bstr.raw());
     1543            if (details == VMINFO_MACHINEREADABLE)
     1544                RTPrintf("USBFilterName%d=\"%lS\"\n", index + 1, bstr.raw());
     1545            else
     1546                RTPrintf("Name:             %lS\n", bstr.raw());
    12311547            CHECK_ERROR_RET (DevPtr, COMGETTER (VendorId) (bstr.asOutParam()), rc);
    1232             RTPrintf("VendorId:         %lS\n", bstr.raw());
     1548            if (details == VMINFO_MACHINEREADABLE)
     1549                RTPrintf("USBFilterVendorId%d=\"%lS\"\n", index + 1, bstr.raw());
     1550            else
     1551                RTPrintf("VendorId:         %lS\n", bstr.raw());
    12331552            CHECK_ERROR_RET (DevPtr, COMGETTER (ProductId) (bstr.asOutParam()), rc);
    1234             RTPrintf("ProductId:        %lS\n", bstr.raw());
     1553            if (details == VMINFO_MACHINEREADABLE)
     1554                RTPrintf("USBFilterProductId%d=\"%lS\"\n", index + 1, bstr.raw());
     1555            else
     1556                RTPrintf("ProductId:        %lS\n", bstr.raw());
    12351557            CHECK_ERROR_RET (DevPtr, COMGETTER (Revision) (bstr.asOutParam()), rc);
    1236             RTPrintf("Revision:         %lS\n", bstr.raw());
     1558            if (details == VMINFO_MACHINEREADABLE)
     1559                RTPrintf("USBFilterRevision%d=\"%lS\"\n", index + 1, bstr.raw());
     1560            else
     1561                RTPrintf("Revision:         %lS\n", bstr.raw());
    12371562            CHECK_ERROR_RET (DevPtr, COMGETTER (Manufacturer) (bstr.asOutParam()), rc);
    1238             RTPrintf("Manufacturer:     %lS\n", bstr.raw());
     1563            if (details == VMINFO_MACHINEREADABLE)
     1564                RTPrintf("USBFilterManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
     1565            else
     1566                RTPrintf("Manufacturer:     %lS\n", bstr.raw());
    12391567            CHECK_ERROR_RET (DevPtr, COMGETTER (Product) (bstr.asOutParam()), rc);
    1240             RTPrintf("Product:          %lS\n", bstr.raw());
     1568            if (details == VMINFO_MACHINEREADABLE)
     1569                RTPrintf("USBFilterProduct%d=\"%lS\"\n", index + 1, bstr.raw());
     1570            else
     1571                RTPrintf("Product:          %lS\n", bstr.raw());
     1572            CHECK_ERROR_RET (DevPtr, COMGETTER (Remote) (bstr.asOutParam()), rc);
     1573            if (details == VMINFO_MACHINEREADABLE)
     1574                RTPrintf("USBFilterRemote%d=\"%lS\"\n", index + 1, bstr.raw());
     1575            else
     1576                RTPrintf("Remote:           %lS\n\n", bstr.raw());
    12411577            CHECK_ERROR_RET (DevPtr, COMGETTER (SerialNumber) (bstr.asOutParam()), rc);
    1242             RTPrintf("Serial Number:    %lS\n\n", bstr.raw());
     1578            if (details == VMINFO_MACHINEREADABLE)
     1579                RTPrintf("USBFilterSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
     1580            else
     1581                RTPrintf("Serial Number:    %lS\n\n", bstr.raw());
    12431582
    12441583            rc = Enum->HasMore (&fMore);
     
    12501589        if (console)
    12511590        {
     1591            index = 0;
    12521592            /* scope */
    12531593            {
    1254                 RTPrintf("Available remote USB devices:\n\n");
     1594                if (details != VMINFO_MACHINEREADABLE)
     1595                    RTPrintf("Available remote USB devices:\n\n");
    12551596
    12561597                ComPtr<IHostUSBDeviceCollection> coll;
     
    12661607                if (!more)
    12671608                {
    1268                     RTPrintf("<none>\n\n");
     1609                    if (details != VMINFO_MACHINEREADABLE)
     1610                        RTPrintf("<none>\n\n");
    12691611                }
    12701612                else
     
    12851627                    CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
    12861628
    1287                     RTPrintf("UUID:               %S\n"
    1288                              "VendorId:           0x%04x (%04X)\n"
    1289                              "ProductId:          0x%04x (%04X)\n"
    1290                              "Revision:           %u.%u (%02u%02u)\n",
    1291                              id.toString().raw(),
    1292                              usVendorId, usVendorId, usProductId, usProductId,
    1293                              bcdRevision >> 8, bcdRevision & 0xff,
    1294                              bcdRevision >> 8, bcdRevision & 0xff);
     1629                    if (details == VMINFO_MACHINEREADABLE)
     1630                        RTPrintf("USBRemoteUUID%d=\"%S\"\n"
     1631                                 "USBRemoteVendorId%d=\"%#06x\"\n"
     1632                                 "USBRemoteProductId%d=\"%#06x\"\n"
     1633                                 "USBRemoteRevision%d=\"%#04x%02x\"\n",
     1634                                 index + 1, id.toString().raw(),
     1635                                 index + 1, usVendorId,
     1636                                 index + 1, usProductId,
     1637                                 index + 1, bcdRevision >> 8, bcdRevision & 0xff);
     1638                    else
     1639                        RTPrintf("UUID:               %S\n"
     1640                                 "VendorId:           0x%04x (%04X)\n"
     1641                                 "ProductId:          0x%04x (%04X)\n"
     1642                                 "Revision:           %u.%u (%02u%02u)\n",
     1643                                 id.toString().raw(),
     1644                                 usVendorId, usVendorId, usProductId, usProductId,
     1645                                 bcdRevision >> 8, bcdRevision & 0xff,
     1646                                 bcdRevision >> 8, bcdRevision & 0xff);
    12951647
    12961648                    /* optional stuff. */
     
    12981650                    CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
    12991651                    if (!bstr.isEmpty())
    1300                         RTPrintf("Manufacturer:       %lS\n", bstr.raw());
     1652                    {
     1653                        if (details == VMINFO_MACHINEREADABLE)
     1654                            RTPrintf("USBRemoteManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
     1655                        else
     1656                            RTPrintf("Manufacturer:       %lS\n", bstr.raw());
     1657                    }
    13011658                    CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
    13021659                    if (!bstr.isEmpty())
    1303                         RTPrintf("Product:            %lS\n", bstr.raw());
     1660                    {
     1661                        if (details == VMINFO_MACHINEREADABLE)
     1662                            RTPrintf("USBRemoteProduct%d=\"%lS\"\n", index + 1, bstr.raw());
     1663                        else
     1664                            RTPrintf("Product:            %lS\n", bstr.raw());
     1665                    }
    13041666                    CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
    13051667                    if (!bstr.isEmpty())
    1306                         RTPrintf("SerialNumber:       %lS\n", bstr.raw());
     1668                    {
     1669                        if (details == VMINFO_MACHINEREADABLE)
     1670                            RTPrintf("USBRemoteSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
     1671                        else
     1672                            RTPrintf("SerialNumber:       %lS\n", bstr.raw());
     1673                    }
    13071674                    CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
    13081675                    if (!bstr.isEmpty())
    1309                         RTPrintf("Address:            %lS\n", bstr.raw());
    1310 
    1311                     RTPrintf("\n");
     1676                    {
     1677                        if (details == VMINFO_MACHINEREADABLE)
     1678                            RTPrintf("USBRemoteAddress%d=\"%lS\"\n", index + 1, bstr.raw());
     1679                        else
     1680                            RTPrintf("Address:            %lS\n", bstr.raw());
     1681                    }
     1682
     1683                    if (details != VMINFO_MACHINEREADABLE)
     1684                        RTPrintf("\n");
    13121685
    13131686                    rc = en->HasMore (&more);
    13141687                    ASSERT_RET (SUCCEEDED (rc), rc);
    1315                 }
    1316             }
    1317 
     1688
     1689                    index ++;
     1690                }
     1691            }
     1692
     1693            index = 0;
    13181694            /* scope */
    13191695            {
    1320                 RTPrintf ("Currently Attached USB Devices:\n\n");
     1696                if (details != VMINFO_MACHINEREADABLE)
     1697                    RTPrintf ("Currently Attached USB Devices:\n\n");
    13211698
    13221699                ComPtr <IUSBDeviceCollection> coll;
     
    13321709                if (!more)
    13331710                {
    1334                     RTPrintf("<none>\n\n");
     1711                    if (details != VMINFO_MACHINEREADABLE)
     1712                        RTPrintf("<none>\n\n");
    13351713                }
    13361714                else
     
    13511729                    CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
    13521730
    1353                     RTPrintf("UUID:               %S\n"
    1354                              "VendorId:           0x%04x (%04X)\n"
    1355                              "ProductId:          0x%04x (%04X)\n"
    1356                              "Revision:           %u.%u (%02u%02u)\n",
    1357                              id.toString().raw(),
    1358                              usVendorId, usVendorId, usProductId, usProductId,
    1359                              bcdRevision >> 8, bcdRevision & 0xff,
    1360                              bcdRevision >> 8, bcdRevision & 0xff);
     1731                    if (details == VMINFO_MACHINEREADABLE)
     1732                        RTPrintf("USBAttachedUUID%d=\"%S\"\n"
     1733                                 "USBAttachedVendorId%d=\"%#06x\"\n"
     1734                                 "USBAttachedProductId%d=\"%#06x\"\n"
     1735                                 "USBAttachedRevision%d=\"%#04x%02x\"\n",
     1736                                 index + 1, id.toString().raw(),
     1737                                 index + 1, usVendorId,
     1738                                 index + 1, usProductId,
     1739                                 index + 1, bcdRevision >> 8, bcdRevision & 0xff);
     1740                    else
     1741                        RTPrintf("UUID:               %S\n"
     1742                                 "VendorId:           0x%04x (%04X)\n"
     1743                                 "ProductId:          0x%04x (%04X)\n"
     1744                                 "Revision:           %u.%u (%02u%02u)\n",
     1745                                 id.toString().raw(),
     1746                                 usVendorId, usVendorId, usProductId, usProductId,
     1747                                 bcdRevision >> 8, bcdRevision & 0xff,
     1748                                 bcdRevision >> 8, bcdRevision & 0xff);
    13611749
    13621750                    /* optional stuff. */
     
    13641752                    CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
    13651753                    if (!bstr.isEmpty())
    1366                         RTPrintf("Manufacturer:       %lS\n", bstr.raw());
     1754                    {
     1755                        if (details == VMINFO_MACHINEREADABLE)
     1756                            RTPrintf("USBAttachedManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
     1757                        else
     1758                            RTPrintf("Manufacturer:       %lS\n", bstr.raw());
     1759                    }
    13671760                    CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
    13681761                    if (!bstr.isEmpty())
    1369                         RTPrintf("Product:            %lS\n", bstr.raw());
     1762                    {
     1763                        if (details == VMINFO_MACHINEREADABLE)
     1764                            RTPrintf("USBAttachedProduct%d=\"%lS\"\n", index + 1, bstr.raw());
     1765                        else
     1766                            RTPrintf("Product:            %lS\n", bstr.raw());
     1767                    }
    13701768                    CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
    13711769                    if (!bstr.isEmpty())
    1372                         RTPrintf("SerialNumber:       %lS\n", bstr.raw());
     1770                    {
     1771                        if (details == VMINFO_MACHINEREADABLE)
     1772                            RTPrintf("USBAttachedSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
     1773                        else
     1774                            RTPrintf("SerialNumber:       %lS\n", bstr.raw());
     1775                    }
    13731776                    CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
    13741777                    if (!bstr.isEmpty())
    1375                         RTPrintf("Address:            %lS\n", bstr.raw());
    1376 
    1377                     RTPrintf("\n");
     1778                    {
     1779                        if (details == VMINFO_MACHINEREADABLE)
     1780                            RTPrintf("USBAttachedAddress%d=\"%lS\"\n", index + 1, bstr.raw());
     1781                        else
     1782                            RTPrintf("Address:            %lS\n", bstr.raw());
     1783                    }
     1784
     1785                    if (details != VMINFO_MACHINEREADABLE)
     1786                        RTPrintf("\n");
    13781787
    13791788                    rc = en->HasMore (&more);
    13801789                    ASSERT_RET (SUCCEEDED (rc), rc);
     1790
     1791                    index ++;
    13811792                }
    13821793            }
     
    13871798     * Shared folders
    13881799     */
    1389     RTPrintf("Shared folders:  ");
     1800    if (details != VMINFO_MACHINEREADABLE)
     1801        RTPrintf("Shared folders:  ");
    13901802    uint32_t numSharedFolders = 0;
    13911803#if 0 // not yet implemented
     
    14171829        CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc);
    14181830        CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc);
     1831        ULONG index = 0;
    14191832        BOOL fMore;
    14201833        sfEnum->HasMore(&fMore);
     
    14261839            sf->COMGETTER(Name)(name.asOutParam());
    14271840            sf->COMGETTER(HostPath)(hostPath.asOutParam());
    1428             if (!numSharedFolders)
     1841            if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
    14291842                RTPrintf("\n\n");
    1430             RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping)\n", name.raw(), hostPath.raw());
     1843            if (details == VMINFO_MACHINEREADABLE)
     1844            {
     1845                RTPrintf("SharedFolderNameMachineMapping%d=\"%lS\"\n", index + 1,
     1846                         name.raw());
     1847                RTPrintf("SharedFolderPathMachineMapping%d=\"%lS\"\n", index + 1,
     1848                         hostPath.raw());
     1849            }
     1850            else
     1851                RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping)\n", name.raw(), hostPath.raw());
    14311852            ++numSharedFolders;
    14321853            CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc);
     
    14401861        CHECK_ERROR_RET(console, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc);
    14411862        CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc);
     1863        ULONG index = 0;
    14421864        BOOL fMore;
    14431865        sfEnum->HasMore(&fMore);
     
    14491871            sf->COMGETTER(Name)(name.asOutParam());
    14501872            sf->COMGETTER(HostPath)(hostPath.asOutParam());
    1451             if (!numSharedFolders)
     1873            if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
    14521874                RTPrintf("\n\n");
    1453             RTPrintf("Name: '%lS', Host path: '%lS' (transient mapping)\n", name.raw(), hostPath.raw());
     1875            if (details == VMINFO_MACHINEREADABLE)
     1876            {
     1877                RTPrintf("SharedFolderNameTransientMapping%d=\"%lS\"\n", index + 1,
     1878                         name.raw());
     1879                RTPrintf("SharedFolderPathTransientMapping%d=\"%lS\"\n", index + 1,
     1880                         hostPath.raw());
     1881            }
     1882            else
     1883                RTPrintf("Name: '%lS', Host path: '%lS' (transient mapping)\n", name.raw(), hostPath.raw());
    14541884            ++numSharedFolders;
    14551885            CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc);
    14561886        }
    14571887    }
    1458     if (!numSharedFolders)
     1888    if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
    14591889        RTPrintf("<none>\n");
    1460     RTPrintf("\n");
     1890    if (details != VMINFO_MACHINEREADABLE)
     1891        RTPrintf("\n");
    14611892
    14621893    if (console)
     
    14971928        CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EncryptionStyle)    (&EncryptionStyle), rc);
    14981929
    1499         RTPrintf("VRDP Connection:    %s\n", Active? "active": "not active");
    1500         RTPrintf("Clients so far:     %d\n", NumberOfClients);
     1930        if (details == VMINFO_MACHINEREADABLE)
     1931            RTPrintf("VRDPActiveConnection=\"%s\"\n", Active ? "on": "off");
     1932        else
     1933            RTPrintf("VRDP Connection:    %s\n", Active? "active": "not active");
     1934
     1935        if (details == VMINFO_MACHINEREADABLE)
     1936            RTPrintf("VRDPClients=%d\n", NumberOfClients);
     1937        else
     1938            RTPrintf("Clients so far:     %d\n", NumberOfClients);
    15011939
    15021940        if (NumberOfClients > 0)
     
    15071945            {
    15081946                makeTimeStr (timestr, sizeof (timestr), BeginTime);
    1509                 RTPrintf("Start time:         %s\n", timestr);
     1947                if (details == VMINFO_MACHINEREADABLE)
     1948                    RTPrintf("VRDPStartTime=\"%s\"\n", timestr);
     1949                else
     1950                    RTPrintf("Start time:         %s\n", timestr);
    15101951            }
    15111952            else
    15121953            {
    15131954                makeTimeStr (timestr, sizeof (timestr), BeginTime);
    1514                 RTPrintf("Last started:       %s\n", timestr);
     1955                if (details == VMINFO_MACHINEREADABLE)
     1956                    RTPrintf("VRDPLastStartTime=\"%s\"\n", timestr);
     1957                else
     1958                    RTPrintf("Last started:       %s\n", timestr);
    15151959                makeTimeStr (timestr, sizeof (timestr), EndTime);
    1516                 RTPrintf("Last ended:         %s\n", timestr);
    1517             }
    1518 
    1519             RTPrintf("Sent:               %llu Bytes\n", BytesSent);
    1520             RTPrintf("Average speed:      %llu B/s\n", (BytesSent * 1000) / (EndTime - BeginTime) );
    1521             RTPrintf("Sent total:         %llu Bytes\n", BytesSentTotal);
    1522 
    1523             RTPrintf("Received:           %llu Bytes\n", BytesReceived);
    1524             RTPrintf("Speed:              %llu B/s\n", (BytesReceived * 1000) / (EndTime - BeginTime) );
    1525             RTPrintf("Received total:     %llu Bytes\n", BytesReceivedTotal);
     1960                if (details == VMINFO_MACHINEREADABLE)
     1961                    RTPrintf("VRDPLastEndTime=\"%s\"\n", timestr);
     1962                else
     1963                    RTPrintf("Last ended:         %s\n", timestr);
     1964            }
     1965
     1966            if (details == VMINFO_MACHINEREADABLE)
     1967            {
     1968                RTPrintf("VRDPBytesSent=%llu\n", BytesSent);
     1969                RTPrintf("VRDPThroughputSend=%llu\n", (BytesSent * 1000) / (EndTime - BeginTime) );
     1970                RTPrintf("VRDPBytesSentTotal=%llu\n", BytesSentTotal);
     1971
     1972                RTPrintf("VRDPBytesReceived=%llu\n", BytesReceived);
     1973                RTPrintf("VRDPThroughputReceive=%llu\n", (BytesReceived * 1000) / (EndTime - BeginTime) );
     1974                RTPrintf("VRDPBytesReceivedTotal=%llu\n", BytesReceivedTotal);
     1975            }
     1976            else
     1977            {
     1978                RTPrintf("Sent:               %llu Bytes\n", BytesSent);
     1979                RTPrintf("Average speed:      %llu B/s\n", (BytesSent * 1000) / (EndTime - BeginTime) );
     1980                RTPrintf("Sent total:         %llu Bytes\n", BytesSentTotal);
     1981
     1982                RTPrintf("Received:           %llu Bytes\n", BytesReceived);
     1983                RTPrintf("Speed:              %llu B/s\n", (BytesReceived * 1000) / (EndTime - BeginTime) );
     1984                RTPrintf("Received total:     %llu Bytes\n", BytesReceivedTotal);
     1985            }
    15261986
    15271987            if (Active)
    15281988            {
    1529                 RTPrintf("User name:          %lS\n", User.raw());
    1530                 RTPrintf("Domain:             %lS\n", Domain.raw());
    1531                 RTPrintf("Client name:        %lS\n", ClientName.raw());
    1532                 RTPrintf("Client IP:          %lS\n", ClientIP.raw());
    1533                 RTPrintf("Client version:     %d\n",  ClientVersion);
    1534                 RTPrintf("Encryption:         %s\n", EncryptionStyle == 0? "RDP4": "RDP5 (X.509)");
    1535             }
    1536         }
    1537 
    1538         RTPrintf("\n");
    1539     }
    1540 
    1541     if (details == VMINFO_STANDARD || details == VMINFO_FULL)
     1989                if (details == VMINFO_MACHINEREADABLE)
     1990                {
     1991                    RTPrintf("VRDPUserName=\"%lS\"\n", User.raw());
     1992                    RTPrintf("VRDPDomain=\"%lS\"\n", Domain.raw());
     1993                    RTPrintf("VRDPClientName=\"%lS\"\n", ClientName.raw());
     1994                    RTPrintf("VRDPClientIP=\"%lS\"\n", ClientIP.raw());
     1995                    RTPrintf("VRDPClientVersion=%d\n",  ClientVersion);
     1996                    RTPrintf("VRDPEncryption=\"%s\"\n", EncryptionStyle == 0? "RDP4": "RDP5 (X.509)");
     1997                }
     1998                else
     1999                {
     2000                    RTPrintf("User name:          %lS\n", User.raw());
     2001                    RTPrintf("Domain:             %lS\n", Domain.raw());
     2002                    RTPrintf("Client name:        %lS\n", ClientName.raw());
     2003                    RTPrintf("Client IP:          %lS\n", ClientIP.raw());
     2004                    RTPrintf("Client version:     %d\n",  ClientVersion);
     2005                    RTPrintf("Encryption:         %s\n", EncryptionStyle == 0? "RDP4": "RDP5 (X.509)");
     2006                }
     2007            }
     2008        }
     2009
     2010        if (details != VMINFO_MACHINEREADABLE)
     2011            RTPrintf("\n");
     2012    }
     2013
     2014    if (    details == VMINFO_STANDARD
     2015        ||  details == VMINFO_FULL
     2016        ||  details == VMINFO_MACHINEREADABLE)
    15422017    {
    15432018        Bstr description;
     
    15452020        if (!description.isEmpty())
    15462021        {
    1547             RTPrintf("Description:\n%lS\n", description.raw());
     2022            if (details == VMINFO_MACHINEREADABLE)
     2023                RTPrintf("description=\"%lS\"\n", description.raw());
     2024            else
     2025                RTPrintf("Description:\n%lS\n", description.raw());
    15482026        }
    15492027    }
    15502028
    15512029    ULONG guestVal;
    1552     RTPrintf("Guest:\n\n");
     2030    if (details != VMINFO_MACHINEREADABLE)
     2031        RTPrintf("Guest:\n\n");
    15532032
    15542033    rc = machine->COMGETTER(MemoryBalloonSize)(&guestVal);
    15552034    if (SUCCEEDED(rc))
    1556         RTPrintf("Configured memory balloon size:      %d MB\n", guestVal);
     2035    {
     2036        if (details == VMINFO_MACHINEREADABLE)
     2037            RTPrintf("GuestMemoryBalloon=%d\n", guestVal);
     2038        else
     2039            RTPrintf("Configured memory balloon size:      %d MB\n", guestVal);
     2040    }
    15572041
    15582042    rc = machine->COMGETTER(StatisticsUpdateInterval)(&guestVal);
    15592043    if (SUCCEEDED(rc))
    15602044    {
    1561         if (guestVal == 0)
    1562             RTPrintf("Statistics update:                   disabled\n");
     2045        if (details == VMINFO_MACHINEREADABLE)
     2046            RTPrintf("GuestStatisticsUpdateInterval=%d\n", guestVal);
    15632047        else
    1564             RTPrintf("Statistics update interval:          %d seconds\n", guestVal);
    1565     }
    1566     RTPrintf("\n");
     2048        {
     2049            if (guestVal == 0)
     2050                RTPrintf("Statistics update:                   disabled\n");
     2051            else
     2052                RTPrintf("Statistics update interval:          %d seconds\n", guestVal);
     2053        }
     2054    }
     2055    if (details != VMINFO_MACHINEREADABLE)
     2056        RTPrintf("\n");
    15672057
    15682058    if (    console
    1569         &&  (details == VMINFO_STATISTICS || details == VMINFO_FULL))
     2059        &&  (   details == VMINFO_STATISTICS
     2060             || details == VMINFO_FULL
     2061             || details == VMINFO_MACHINEREADABLE))
    15702062    {
    15712063        ComPtr <IGuest> guest;
    15722064
    1573         rc = console->COMGETTER(Guest)(guest.asOutParam()); 
     2065        rc = console->COMGETTER(Guest)(guest.asOutParam());
    15742066        if (SUCCEEDED(rc))
    15752067        {
     
    15772069
    15782070            rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &statVal);
    1579             RTPrintf("Guest statistics for sample %d:\n\n", statVal);
     2071            if (details == VMINFO_MACHINEREADABLE)
     2072                RTPrintf("StatGuestSample=%d\n", statVal);
     2073            else
     2074                RTPrintf("Guest statistics for sample %d:\n\n", statVal);
    15802075
    15812076            rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
    15822077            if (SUCCEEDED(rc))
    1583                 RTPrintf("CPU%d: CPU Load Idle          %-3d%%\n", 0, statVal);
     2078            {
     2079                if (details == VMINFO_MACHINEREADABLE)
     2080                    RTPrintf("StatGuestLoadIdleCPU%d=%d\n", 0, statVal);
     2081                else
     2082                    RTPrintf("CPU%d: CPU Load Idle          %-3d%%\n", 0, statVal);
     2083            }
    15842084
    15852085            rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);
    15862086            if (SUCCEEDED(rc))
    1587                 RTPrintf("CPU%d: CPU Load Kernel        %-3d%%\n", 0, statVal);
     2087            {
     2088                if (details == VMINFO_MACHINEREADABLE)
     2089                    RTPrintf("StatGuestLoadKernelCPU%d=%d\n", 0, statVal);
     2090                else
     2091                    RTPrintf("CPU%d: CPU Load Kernel        %-3d%%\n", 0, statVal);
     2092            }
    15882093
    15892094            rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);
    15902095            if (SUCCEEDED(rc))
    1591                 RTPrintf("CPU%d: CPU Load User          %-3d%%\n", 0, statVal);
     2096            {
     2097                if (details == VMINFO_MACHINEREADABLE)
     2098                    RTPrintf("StatGuestLoadUserCPU%d=%d\n", 0, statVal);
     2099                else
     2100                    RTPrintf("CPU%d: CPU Load User          %-3d%%\n", 0, statVal);
     2101            }
    15922102
    15932103            rc = guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);
    15942104            if (SUCCEEDED(rc))
    1595                 RTPrintf("CPU%d: Threads                %d\n", 0, statVal);
     2105            {
     2106                if (details == VMINFO_MACHINEREADABLE)
     2107                    RTPrintf("StatGuestThreadsCPU%d=%d\n", 0, statVal);
     2108                else
     2109                    RTPrintf("CPU%d: Threads                %d\n", 0, statVal);
     2110            }
    15962111
    15972112            rc = guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);
    15982113            if (SUCCEEDED(rc))
    1599                 RTPrintf("CPU%d: Processes              %d\n", 0, statVal);
     2114            {
     2115                if (details == VMINFO_MACHINEREADABLE)
     2116                    RTPrintf("StatGuestProcessesCPU%d=%d\n", 0, statVal);
     2117                else
     2118                    RTPrintf("CPU%d: Processes              %d\n", 0, statVal);
     2119            }
    16002120
    16012121            rc = guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);
    16022122            if (SUCCEEDED(rc))
    1603                 RTPrintf("CPU%d: Handles                %d\n", 0, statVal);
     2123            {
     2124                if (details == VMINFO_MACHINEREADABLE)
     2125                    RTPrintf("StatGuestHandlesCPU%d=%d\n", 0, statVal);
     2126                else
     2127                    RTPrintf("CPU%d: Handles                %d\n", 0, statVal);
     2128            }
    16042129
    16052130            rc = guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);
    16062131            if (SUCCEEDED(rc))
    1607                 RTPrintf("CPU%d: Memory Load            %d%%\n", 0, statVal);
     2132            {
     2133                if (details == VMINFO_MACHINEREADABLE)
     2134                    RTPrintf("StatGuestMemoryLoadCPU%d=%d\n", 0, statVal);
     2135                else
     2136                    RTPrintf("CPU%d: Memory Load            %d%%\n", 0, statVal);
     2137            }
    16082138
    16092139            rc = guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);
    16102140            if (SUCCEEDED(rc))
    1611                 RTPrintf("CPU%d: Total physical memory  %-4d MB\n", 0, statVal);
     2141            {
     2142                if (details == VMINFO_MACHINEREADABLE)
     2143                    RTPrintf("StatGuestMemoryTotalPhysCPU%d=%d\n", 0, statVal);
     2144                else
     2145                    RTPrintf("CPU%d: Total physical memory  %-4d MB\n", 0, statVal);
     2146            }
    16122147
    16132148            rc = guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);
    16142149            if (SUCCEEDED(rc))
    1615                 RTPrintf("CPU%d: Free physical memory   %-4d MB\n", 0, statVal);
     2150            {
     2151                if (details == VMINFO_MACHINEREADABLE)
     2152                    RTPrintf("StatGuestMemoryFreePhysCPU%d=%d\n", 0, statVal);
     2153                else
     2154                    RTPrintf("CPU%d: Free physical memory   %-4d MB\n", 0, statVal);
     2155            }
    16162156
    16172157            rc = guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);
    16182158            if (SUCCEEDED(rc))
    1619                 RTPrintf("CPU%d: Memory balloon size    %-4d MB\n", 0, statVal);
     2159            {
     2160                if (details == VMINFO_MACHINEREADABLE)
     2161                    RTPrintf("StatGuestMemoryBalloonCPU%d=%d\n", 0, statVal);
     2162                else
     2163                    RTPrintf("CPU%d: Memory balloon size    %-4d MB\n", 0, statVal);
     2164            }
    16202165
    16212166            rc = guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);
    16222167            if (SUCCEEDED(rc))
    1623                 RTPrintf("CPU%d: Committed memory       %-4d MB\n", 0, statVal);
     2168            {
     2169                if (details == VMINFO_MACHINEREADABLE)
     2170                    RTPrintf("StatGuestMemoryCommittedCPU%d=%d\n", 0, statVal);
     2171                else
     2172                    RTPrintf("CPU%d: Committed memory       %-4d MB\n", 0, statVal);
     2173            }
    16242174
    16252175            rc = guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);
    16262176            if (SUCCEEDED(rc))
    1627                 RTPrintf("CPU%d: Total kernel memory    %-4d MB\n", 0, statVal);
     2177            {
     2178                if (details == VMINFO_MACHINEREADABLE)
     2179                    RTPrintf("StatGuestMemoryTotalKernelCPU%d=%d\n", 0, statVal);
     2180                else
     2181                    RTPrintf("CPU%d: Total kernel memory    %-4d MB\n", 0, statVal);
     2182            }
    16282183
    16292184            rc = guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);
    16302185            if (SUCCEEDED(rc))
    1631                 RTPrintf("CPU%d: Paged kernel memory    %-4d MB\n", 0, statVal);
     2186            {
     2187                if (details == VMINFO_MACHINEREADABLE)
     2188                    RTPrintf("StatGuestMemoryPagedKernelCPU%d=%d\n", 0, statVal);
     2189                else
     2190                    RTPrintf("CPU%d: Paged kernel memory    %-4d MB\n", 0, statVal);
     2191            }
    16322192
    16332193            rc = guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);
    16342194            if (SUCCEEDED(rc))
    1635                 RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
     2195            {
     2196                if (details == VMINFO_MACHINEREADABLE)
     2197                    RTPrintf("StatGuestMemoryNonpagedKernelCPU%d=%d\n", 0, statVal);
     2198                else
     2199                    RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
     2200            }
    16362201
    16372202            rc = guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);
    16382203            if (SUCCEEDED(rc))
    1639                 RTPrintf("CPU%d: System cache size      %-4d MB\n", 0, statVal);
     2204            {
     2205                if (details == VMINFO_MACHINEREADABLE)
     2206                    RTPrintf("StatGuestSystemCacheSizeCPU%d=%d\n", 0, statVal);
     2207                else
     2208                    RTPrintf("CPU%d: System cache size      %-4d MB\n", 0, statVal);
     2209            }
    16402210
    16412211            rc = guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);
    16422212            if (SUCCEEDED(rc))
    1643                 RTPrintf("CPU%d: Page file size         %-4d MB\n", 0, statVal);
     2213            {
     2214                if (details == VMINFO_MACHINEREADABLE)
     2215                    RTPrintf("StatGuestPageFileSizeCPU%d=%d\n", 0, statVal);
     2216                else
     2217                    RTPrintf("CPU%d: Page file size         %-4d MB\n", 0, statVal);
     2218            }
    16442219
    16452220            RTPrintf("\n");
     
    16472222        else
    16482223        {
    1649             RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);
    1650             PRINT_RC_MESSAGE(rc);
     2224            if (details != VMINFO_MACHINEREADABLE)
     2225            {
     2226                RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);
     2227                PRINT_RC_MESSAGE(rc);
     2228            }
    16512229        }
    16522230    }
     
    16592237    if (SUCCEEDED(rc) && snapshot)
    16602238    {
    1661         RTPrintf("Snapshots:\n\n");
    1662         showSnapshots(snapshot);
    1663     }
    1664 
    1665     RTPrintf("\n");
     2239        if (details != VMINFO_MACHINEREADABLE)
     2240            RTPrintf("Snapshots:\n\n");
     2241        showSnapshots(snapshot, details);
     2242    }
     2243
     2244    if (details != VMINFO_MACHINEREADABLE)
     2245        RTPrintf("\n");
    16662246    return S_OK;
    16672247}
     
    16942274        return 1;
    16952275
    1696     /* 2nd option can be -details or -statistics */
     2276    /* 2nd option can be -details, -statistics or -argdump */
    16972277    VMINFO_DETAILS details = VMINFO_NONE;
    16982278    bool fDetails = false;
    16992279    bool fStatistics = false;
     2280    bool fMachinereadable = false;
    17002281    for (int i=1;i<argc;i++)
    17012282    {
     
    17052286        if (!strcmp(argv[i], "-statistics"))
    17062287            fStatistics = true;
    1707     }
     2288        if (!strcmp(argv[1], "-machinereadable"))
     2289            fMachinereadable = true;
     2290    }
     2291    if (fMachinereadable)
     2292        details = VMINFO_MACHINEREADABLE;
     2293    else
    17082294    if (fDetails && fStatistics)
    17092295        details = VMINFO_FULL;
     
    28433429    if (!!baseFolder && !!settingsFile)
    28443430    {
    2845         return errorSyntax(USAGE_CREATEVM, "Either -basefolder or -settingsfile may be specified");
     3431        return errorSyntax(USAGE_CREATEVM, "Either -basefolder or -settingsfile must be specified");
    28463432    }
    28473433
     
    38374423                if (!hostDVDDrive)
    38384424                {
    3839                     /* 2nd try: try with the real name, important on Linux+libhal */
    3840                     char szPathReal[RTPATH_MAX];
    3841                     if (VBOX_FAILURE(RTPathReal(dvd + 5, szPathReal, sizeof(szPathReal))))
    3842                     {
    3843                         errorArgument("Invalid host DVD drive name");
    3844                         rc = E_FAIL;
    3845                         break;
    3846                     }
    3847                     rc = hostDVDs->FindByName(Bstr(szPathReal), hostDVDDrive.asOutParam());
    3848                     if (!hostDVDDrive)
    3849                     {
    3850                         errorArgument("Invalid host DVD drive name");
    3851                         rc = E_FAIL;
    3852                         break;
    3853                     }
     4425                    /* 2nd try: try with the real name, important on Linux+libhal */
     4426                    char szPathReal[RTPATH_MAX];
     4427                    if (VBOX_FAILURE(RTPathReal(dvd + 5, szPathReal, sizeof(szPathReal))))
     4428                    {
     4429                        errorArgument("Invalid host DVD drive name");
     4430                        rc = E_FAIL;
     4431                        break;
     4432                    }
     4433                    rc = hostDVDs->FindByName(Bstr(szPathReal), hostDVDDrive.asOutParam());
     4434                    if (!hostDVDDrive)
     4435                    {
     4436                        errorArgument("Invalid host DVD drive name");
     4437                        rc = E_FAIL;
     4438                        break;
     4439                    }
    38544440                }
    38554441                CHECK_ERROR(dvdDrive, CaptureHostDrive(hostDVDDrive));
     
    48465432            ComPtr <IGuest> guest;
    48475433
    4848             rc = console->COMGETTER(Guest)(guest.asOutParam()); 
     5434            rc = console->COMGETTER(Guest)(guest.asOutParam());
    48495435            if (SUCCEEDED(rc))
    48505436                CHECK_ERROR(guest, COMSETTER(MemoryBalloonSize)(uVal));
     
    48715457            ComPtr <IGuest> guest;
    48725458
    4873             rc = console->COMGETTER(Guest)(guest.asOutParam()); 
     5459            rc = console->COMGETTER(Guest)(guest.asOutParam());
    48745460            if (SUCCEEDED(rc))
    48755461                CHECK_ERROR(guest, COMSETTER(StatisticsUpdateInterval)(uVal));
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r4649 r4779  
    7373typedef enum
    7474{
    75     VMINFO_NONE         = 0,
    76     VMINFO_STANDARD     = 1,    /* standard details */
    77     VMINFO_STATISTICS   = 2,    /* guest statistics */
    78     VMINFO_FULL         = 3,    /* both */
     75    VMINFO_NONE             = 0,
     76    VMINFO_STANDARD         = 1,    /* standard details */
     77    VMINFO_STATISTICS       = 2,    /* guest statistics */
     78    VMINFO_FULL             = 3,    /* both */
     79    VMINFO_MACHINEREADABLE  = 4,    /* both, and make it machine readable */
    7980} VMINFO_DETAILS;
    8081
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