VirtualBox

Changeset 3079 in vbox for trunk


Ignore:
Timestamp:
Jun 7, 2007 7:37:56 PM (18 years ago)
Author:
vboxsync
Message:

VBoxSDL -list is redundant

File:
1 edited

Legend:

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

    r3001 r3079  
    585585{
    586586    RTPrintf("Usage:\n"
    587              "  -list                    List all registered virtual machines and exit\n"
    588587             "  -vm <id|name>            Virtual machine to start, either UUID or name\n"
    589588             "  -hda <file>              Set temporary first hard disk to file\n"
     
    752751    bool fXPCOMEventThreadSignaled = false;
    753752#endif
    754     bool fListVMs = false;
    755753    char *hdaFile   = NULL;
    756754    char *cdromFile = NULL;
     
    920918    for (int curArg = 1; curArg < argc; curArg++)
    921919    {
    922         if (strcmp(argv[curArg], "-list") == 0)
    923         {
    924             fListVMs = true;
    925         }
    926         else if (strcmp(argv[curArg], "-vm") == 0
    927               || strcmp(argv[curArg], "-startvm") == 0)
     920        if (strcmp(argv[curArg], "-vm") == 0
     921            || strcmp(argv[curArg], "-startvm") == 0)
    928922        {
    929923            if (++curArg >= argc)
     
    12551249    if (FAILED (rc))
    12561250        break;
    1257 
    1258     /*
    1259      * Are we supposed to display the list of registered VMs?
    1260      */
    1261     if (fListVMs)
    1262     {
    1263         RTPrintf("\nList of registered VMs:\n");
    1264         /*
    1265          * Get the list of all registered VMs
    1266          */
    1267         ComPtr<IMachineCollection> collection;
    1268         rc = virtualBox->COMGETTER(Machines)(collection.asOutParam());
    1269         ComPtr<IMachineEnumerator> enumerator;
    1270         if (SUCCEEDED(rc))
    1271             rc = collection->Enumerate(enumerator.asOutParam());
    1272         if (SUCCEEDED(rc))
    1273         {
    1274             /*
    1275              * Iterate through the collection
    1276              */
    1277             BOOL hasMore = FALSE;
    1278             while (enumerator->HasMore(&hasMore), hasMore)
    1279             {
    1280                 ComPtr<IMachine> machine;
    1281                 rc =enumerator->GetNext(machine.asOutParam());
    1282                 if ((SUCCEEDED(rc)) && machine)
    1283                 {
    1284                     Bstr machineName;
    1285                     Guid machineGUID;
    1286                     Bstr settingsFilePath;
    1287                     ULONG memorySize;
    1288                     ULONG vramSize;
    1289                     machine->COMGETTER(Name)(machineName.asOutParam());
    1290                     machine->COMGETTER(Id)(machineGUID.asOutParam());
    1291                     machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());
    1292                     machine->COMGETTER(MemorySize)(&memorySize);
    1293                     machine->COMGETTER(VRAMSize)(&vramSize);
    1294                     Utf8Str machineNameUtf8(machineName);
    1295                     Utf8Str settingsFilePathUtf8(settingsFilePath);
    1296                     RTPrintf("\tName:        %s\n", machineNameUtf8.raw());
    1297                     RTPrintf("\tUUID:        %s\n", machineGUID.toString().raw());
    1298                     RTPrintf("\tConfig file: %s\n", settingsFilePathUtf8.raw());
    1299                     RTPrintf("\tMemory size: %uMB\n", memorySize);
    1300                     RTPrintf("\tVRAM size:   %uMB\n\n", vramSize);
    1301                 }
    1302             }
    1303         }
    1304         /* terminate application */
    1305         goto leave;
    1306     }
    13071251
    13081252    /*
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