Changeset 6526 in vbox
- Timestamp:
- Jan 28, 2008 1:22:22 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27552
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r6479 r6526 268 268 if (u64Cmd & USAGE_LIST) 269 269 { 270 RTPrintf("VBoxManage list vms| ostypes|hostdvds|hostfloppies|");270 RTPrintf("VBoxManage list vms|runningvms|ostypes|hostdvds|hostfloppies|\n"); 271 271 if (fWin) 272 272 RTPrintf( "hostifs|"); 273 RTPrintf( "\n" 274 " hdds|dvds|floppies|usbhost|usbfilters|\n" 273 RTPrintf(" hdds|dvds|floppies|usbhost|usbfilters|\n" 275 274 " systemproperties\n" 276 275 "\n"); … … 2434 2433 } 2435 2434 else 2435 if (strcmp(argv[0], "runningvms") == 0) 2436 { 2437 /* 2438 * Get the list of all _running_ VMs 2439 */ 2440 ComPtr<IMachineCollection> collection; 2441 rc = virtualBox->COMGETTER(Machines)(collection.asOutParam()); 2442 ComPtr<IMachineEnumerator> enumerator; 2443 if (SUCCEEDED(rc)) 2444 rc = collection->Enumerate(enumerator.asOutParam()); 2445 if (SUCCEEDED(rc)) 2446 { 2447 /* 2448 * Iterate through the collection 2449 */ 2450 BOOL hasMore = FALSE; 2451 while (enumerator->HasMore(&hasMore), hasMore) 2452 { 2453 ComPtr<IMachine> machine; 2454 rc = enumerator->GetNext(machine.asOutParam()); 2455 if ((SUCCEEDED(rc)) && machine) 2456 { 2457 MachineState_T machineState; 2458 rc = machine->COMGETTER(State)(&machineState); 2459 if (SUCCEEDED(rc)) 2460 { 2461 switch (machineState) 2462 { 2463 case MachineState_Running: 2464 case MachineState_Paused: 2465 { 2466 Guid uuid; 2467 rc = machine->COMGETTER(Id) (uuid.asOutParam()); 2468 if (SUCCEEDED(rc)) 2469 RTPrintf ("%s\n", uuid.toString().raw()); 2470 break; 2471 } 2472 } 2473 } 2474 } 2475 } 2476 } 2477 } 2478 else 2436 2479 if (strcmp(argv[0], "ostypes") == 0) 2437 2480 {
Note:
See TracChangeset
for help on using the changeset viewer.