- Timestamp:
- Nov 15, 2024 9:35:45 AM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/tstCAPIGlue.c
r106061 r107012 846 846 * List the registered VMs. 847 847 * 848 * @param argv0 executable name 848 * @param argc number of arguments 849 * @param argv argument vector 849 850 * @param virtualBox ptr to IVirtualBox object 850 851 * @param session ptr to ISession object 851 852 */ 852 static void listVMs(const char *argv0, IVirtualBox *virtualBox, ISession *session) 853 { 853 static void listVMs(int argc, char **argv, IVirtualBox *virtualBox, ISession *session) 854 { 855 const char *argv0 = argv[0]; 856 854 857 HRESULT hrc; 855 858 SAFEARRAY *machinesSA = g_pVBoxFuncs->pfnSafeArrayOutParamAlloc(); … … 970 973 /* 971 974 * Let the user chose a machine to start. 975 * 976 * Note! Testcases need to run without interaction required by default, 977 * so only do this if manually specifying the 'start' command. 972 978 */ 973 printf("Type Machine# to start (0 - %u) or 'quit' to do nothing: ", 974 (unsigned)(machineCnt - 1)); 975 fflush(stdout); 976 977 if (scanf("%u", &start_id) == 1 && start_id < machineCnt) 978 { 979 IMachine *machine = machines[start_id]; 980 981 if (machine) 979 if ( argc >= 2 980 && !stricmp(argv[1], "start")) 981 { 982 printf("Type Machine# to start (0 - %u) or 'quit' to do nothing: ", 983 (unsigned)(machineCnt - 1)); 984 fflush(stdout); 985 986 if (scanf("%u", &start_id) == 1 && start_id < machineCnt) 982 987 { 983 BSTR uuidUtf16 = NULL; 984 985 IMachine_get_Id(machine, &uuidUtf16); 986 startVM(argv0, virtualBox, session, uuidUtf16); 987 g_pVBoxFuncs->pfnComUnallocString(uuidUtf16); 988 IMachine *machine = machines[start_id]; 989 990 if (machine) 991 { 992 BSTR uuidUtf16 = NULL; 993 994 IMachine_get_Id(machine, &uuidUtf16); 995 startVM(argv0, virtualBox, session, uuidUtf16); 996 g_pVBoxFuncs->pfnComUnallocString(uuidUtf16); 997 } 988 998 } 989 999 } 1000 else 1001 printf("Note: Use 'start' to start a VM when running interactively.\n\n"); 990 1002 991 1003 /* … … 1103 1115 PrintErrorInfo(argv[0], "GetHomeFolder() failed", hrc); 1104 1116 1105 listVMs(arg v[0], vbox, session);1117 listVMs(argc, argv, vbox, session); 1106 1118 ISession_UnlockMachine(session); 1107 1119
Note:
See TracChangeset
for help on using the changeset viewer.