- Timestamp:
- Jun 7, 2007 7:37:56 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r3001 r3079 585 585 { 586 586 RTPrintf("Usage:\n" 587 " -list List all registered virtual machines and exit\n"588 587 " -vm <id|name> Virtual machine to start, either UUID or name\n" 589 588 " -hda <file> Set temporary first hard disk to file\n" … … 752 751 bool fXPCOMEventThreadSignaled = false; 753 752 #endif 754 bool fListVMs = false;755 753 char *hdaFile = NULL; 756 754 char *cdromFile = NULL; … … 920 918 for (int curArg = 1; curArg < argc; curArg++) 921 919 { 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) 928 922 { 929 923 if (++curArg >= argc) … … 1255 1249 if (FAILED (rc)) 1256 1250 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 VMs1266 */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 collection1276 */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 }1307 1251 1308 1252 /*
Note:
See TracChangeset
for help on using the changeset viewer.