Changeset 42551 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 2, 2012 4:44:39 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r42445 r42551 495 495 break; 496 496 } 497 CHECK_ERROR(adapter, COMGETTER(N atDriver)(engine.asOutParam()));497 CHECK_ERROR(adapter, COMGETTER(NATEngine)(engine.asOutParam())); 498 498 if (!engine) 499 499 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r42460 r42551 59 59 60 60 using namespace com; 61 62 #undef VBOX_WITH_GUEST_CONTROL2 61 63 62 64 /** … … 225 227 " --image <path to program> --username <name>\n" 226 228 " [--passwordfile <file> | --password <password>]\n" 229 " [--domain <domain>] [--verbose] [--timeout <msec>]\n" 227 230 " [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n" 228 " [--verbose] [--timeout <msec>]\n"229 231 " [--wait-exit] [--wait-stdout] [--wait-stderr]\n" 230 232 " [--dos2unix] [--unix2dos]\n" … … 236 238 " <guest source> <host dest> --username <name>\n" 237 239 " [--passwordfile <file> | --password <password>]\n" 238 " [--dryrun] [--follow] [--recursive] [--verbose]\n" 240 " [--domain <domain>] [--verbose]\n" 241 " [--dryrun] [--follow] [--recursive]\n" 239 242 "\n" 240 243 " copyto|cp\n" 241 244 " <host source> <guest dest> --username <name>\n" 242 245 " [--passwordfile <file> | --password <password>]\n" 243 " [--dryrun] [--follow] [--recursive] [--verbose]\n" 246 " [--domain <domain>] [--verbose]\n" 247 " [--dryrun] [--follow] [--recursive]\n" 244 248 "\n" 245 249 " createdir[ectory]|mkdir|md\n" 246 250 " <guest directory>... --username <name>\n" 247 251 " [--passwordfile <file> | --password <password>]\n" 248 " [--parents] [--mode <mode>] [--verbose]\n" 252 " [--domain <domain>] [--verbose]\n" 253 " [--parents] [--mode <mode>]\n" 249 254 "\n" 250 255 " stat\n" 251 256 " <file>... --username <name>\n" 252 257 " [--passwordfile <file> | --password <password>]\n" 253 " [-- verbose]\n"258 " [--domain <domain>] [--verbose]\n" 254 259 "\n" 255 260 " updateadditions\n" … … 296 301 } 297 302 303 #ifndef VBOX_WITH_GUEST_CONTROL2 298 304 /** 299 305 * Translates a process status to a human readable … … 363 369 return rc; 364 370 } 371 #else 372 /** 373 * Translates a process status to a human readable 374 * string. 375 */ 376 static const char *ctrlExecProcessStatusToText(ProcessStatus_T enmStatus) 377 { 378 switch (enmStatus) 379 { 380 case ProcessStatus_Starting: 381 return "starting"; 382 case ProcessStatus_Started: 383 return "started"; 384 case ProcessStatus_Paused: 385 return "paused"; 386 case ProcessStatus_Terminating: 387 return "terminating"; 388 case ProcessStatus_TerminatedNormally: 389 return "successfully terminated"; 390 case ProcessStatus_TerminatedSignal: 391 return "terminated by signal"; 392 case ProcessStatus_TerminatedAbnormally: 393 return "abnormally aborted"; 394 case ProcessStatus_TimedOutKilled: 395 return "timed out"; 396 case ProcessStatus_TimedOutAbnormally: 397 return "timed out, hanging"; 398 case ProcessStatus_Down: 399 return "killed"; 400 case ProcessStatus_Error: 401 return "error"; 402 default: 403 break; 404 } 405 return "unknown"; 406 } 407 408 static int ctrlExecProcessStatusToExitCode(ProcessStatus_T enmStatus, ULONG uExitCode) 409 { 410 int rc = EXITCODEEXEC_SUCCESS; 411 switch (enmStatus) 412 { 413 case ProcessStatus_Starting: 414 rc = EXITCODEEXEC_SUCCESS; 415 break; 416 case ProcessStatus_Started: 417 rc = EXITCODEEXEC_SUCCESS; 418 break; 419 case ProcessStatus_Paused: 420 rc = EXITCODEEXEC_SUCCESS; 421 break; 422 case ProcessStatus_Terminating: 423 rc = EXITCODEEXEC_SUCCESS; 424 break; 425 case ProcessStatus_TerminatedNormally: 426 rc = !uExitCode ? EXITCODEEXEC_SUCCESS : EXITCODEEXEC_CODE; 427 break; 428 case ProcessStatus_TerminatedSignal: 429 rc = EXITCODEEXEC_TERM_SIGNAL; 430 break; 431 case ProcessStatus_TerminatedAbnormally: 432 rc = EXITCODEEXEC_TERM_ABEND; 433 break; 434 case ProcessStatus_TimedOutKilled: 435 rc = EXITCODEEXEC_TIMEOUT; 436 break; 437 case ProcessStatus_TimedOutAbnormally: 438 rc = EXITCODEEXEC_TIMEOUT; 439 break; 440 case ProcessStatus_Down: 441 /* Service/OS is stopping, process was killed, so 442 * not exactly an error of the started process ... */ 443 rc = EXITCODEEXEC_DOWN; 444 break; 445 case ProcessStatus_Error: 446 rc = EXITCODEEXEC_FAILED; 447 break; 448 default: 449 AssertMsgFailed(("Unknown exit code (%u) from guest process returned!\n", enmStatus)); 450 break; 451 } 452 return rc; 453 } 454 #endif 365 455 366 456 static int ctrlPrintError(com::ErrorInfo &errorInfo) … … 482 572 } 483 573 574 #ifndef VBOX_WITH_GUEST_CONTROL2 484 575 /** 485 576 * Prints the desired guest output to a stream. … … 493 584 static int ctrlExecPrintOutput(IGuest *pGuest, ULONG uPID, 494 585 PRTSTREAM pStrmOutput, uint32_t fOutputFlags, 495 uint32_tcMsTimeout)586 RTMSINTERVAL cMsTimeout) 496 587 { 497 588 AssertPtrReturn(pGuest, VERR_INVALID_POINTER); … … 565 656 return vrc; 566 657 } 658 #else 659 /** 660 * Prints the desired guest output to a stream. 661 * 662 * @return IPRT status code. 663 * @param pProcess Pointer to appropriate process object. 664 * @param pStrmOutput Where to write the data. 665 * @param hStream Where to read the data from. 666 */ 667 static int ctrlExecPrintOutput(IProcess *pProcess, PRTSTREAM pStrmOutput, 668 ULONG uHandle) 669 { 670 AssertPtrReturn(pProcess, VERR_INVALID_POINTER); 671 AssertPtrReturn(pStrmOutput, VERR_INVALID_POINTER); 672 673 int vrc = VINF_SUCCESS; 674 675 SafeArray<BYTE> aOutputData; 676 HRESULT rc = pProcess->Read(uHandle, _64K, 1 /* timeout */, 677 ComSafeArrayAsOutParam(aOutputData)); 678 if (FAILED(rc)) 679 vrc = ctrlPrintError(pProcess, COM_IIDOF(IProcess)); 680 else 681 { 682 /** @todo implement the dos2unix/unix2dos conversions */ 683 vrc = RTStrmWrite(pStrmOutput, aOutputData.raw(), aOutputData.size()); 684 if (RT_FAILURE(vrc)) 685 RTMsgError("Unable to write output, rc=%Rrc\n", vrc); 686 } 687 688 return vrc; 689 } 690 #endif 567 691 568 692 /** … … 572 696 * @return RTMSINTERVAL Time left (in ms). 573 697 * @param u64StartMs Start time (in ms). 574 * @param u32TimeoutMsTimeout value (in ms).575 */ 576 inline RTMSINTERVAL ctrlExecGetRemainingTime(uint64_t u64StartMs, uint32_t u32TimeoutMs)577 { 578 if (! u32TimeoutMs) /* If no timeout specified, wait forever. */698 * @param cMsTimeout Timeout value (in ms). 699 */ 700 inline RTMSINTERVAL ctrlExecGetRemainingTime(uint64_t u64StartMs, RTMSINTERVAL cMsTimeout) 701 { 702 if (!cMsTimeout || cMsTimeout == RT_INDEFINITE_WAIT) /* If no timeout specified, wait forever. */ 579 703 return RT_INDEFINITE_WAIT; 580 704 581 705 uint64_t u64ElapsedMs = RTTimeMilliTS() - u64StartMs; 582 if (u64ElapsedMs >= u32TimeoutMs)706 if (u64ElapsedMs >= cMsTimeout) 583 707 return 0; 584 708 585 return u32TimeoutMs- u64ElapsedMs;709 return cMsTimeout - u64ElapsedMs; 586 710 } 587 711 … … 605 729 { "--image", 'i', RTGETOPT_REQ_STRING }, 606 730 { "--no-profile", GETOPTDEF_EXEC_NO_PROFILE, RTGETOPT_REQ_NOTHING }, 731 { "--username", 'u', RTGETOPT_REQ_STRING }, 607 732 { "--passwordfile", 'p', RTGETOPT_REQ_STRING }, 608 733 { "--password", GETOPTDEF_EXEC_PASSWORD, RTGETOPT_REQ_STRING }, 734 { "--domain", 'd', RTGETOPT_REQ_STRING }, 609 735 { "--timeout", 't', RTGETOPT_REQ_UINT32 }, 610 736 { "--unix2dos", GETOPTDEF_EXEC_UNIX2DOS, RTGETOPT_REQ_NOTHING }, 611 { "--username", 'u', RTGETOPT_REQ_STRING },612 737 { "--verbose", 'v', RTGETOPT_REQ_NOTHING }, 613 738 { "--wait-exit", GETOPTDEF_EXEC_WAITFOREXIT, RTGETOPT_REQ_NOTHING }, … … 621 746 RTGetOptInit(&GetState, pArg->argc, pArg->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0); 622 747 623 Utf8Str Utf8Cmd; 748 Utf8Str strCmd; 749 #ifndef VBOX_WITH_GUEST_CONTROL2 624 750 uint32_t fExecFlags = ExecuteProcessFlag_None; 751 #else 752 com::SafeArray<ProcessCreateFlag_T> aCreateFlags; 753 com::SafeArray<ProcessWaitForFlag_T> aWaitFlags; 754 #endif 625 755 com::SafeArray<IN_BSTR> args; 626 756 com::SafeArray<IN_BSTR> env; 627 Utf8Str Utf8UserName; 628 Utf8Str Utf8Password; 629 uint32_t cMsTimeout = 0; 757 Utf8Str strUserName; 758 Utf8Str strPassword; 759 Utf8Str strDomain; 760 RTMSINTERVAL cMsTimeout = 0; 630 761 OUTPUTTYPE eOutputType = OUTPUTTYPE_UNDEFINED; 631 bool fOutputBinary = false;632 762 bool fWaitForExit = false; 633 763 bool fVerbose = false; … … 662 792 663 793 case GETOPTDEF_EXEC_IGNOREORPHANEDPROCESSES: 794 #ifndef VBOX_WITH_GUEST_CONTROL2 664 795 fExecFlags |= ExecuteProcessFlag_IgnoreOrphanedProcesses; 796 #else 797 aCreateFlags.push_back(ProcessCreateFlag_IgnoreOrphanedProcesses); 798 #endif 665 799 break; 666 800 667 801 case GETOPTDEF_EXEC_NO_PROFILE: 802 #ifndef VBOX_WITH_GUEST_CONTROL2 668 803 fExecFlags |= ExecuteProcessFlag_NoProfile; 804 #else 805 aCreateFlags.push_back(ProcessCreateFlag_NoProfile); 806 #endif 669 807 break; 670 808 671 809 case 'i': 672 Utf8Cmd = ValueUnion.psz;810 strCmd = ValueUnion.psz; 673 811 break; 674 812 675 813 /** @todo Add a hidden flag. */ 676 814 815 case 'u': /* User name */ 816 strUserName = ValueUnion.psz; 817 break; 818 677 819 case GETOPTDEF_EXEC_PASSWORD: /* Password */ 678 Utf8Password = ValueUnion.psz;820 strPassword = ValueUnion.psz; 679 821 break; 680 822 681 823 case 'p': /* Password file */ 682 824 { 683 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, & Utf8Password);825 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &strPassword); 684 826 if (rcExit != RTEXITCODE_SUCCESS) 685 827 return rcExit; 686 828 break; 687 829 } 830 831 case 'd': /* domain */ 832 strDomain = ValueUnion.psz; 833 break; 688 834 689 835 case 't': /* Timeout */ … … 697 843 break; 698 844 699 case 'u': /* User name */700 Utf8UserName = ValueUnion.psz;701 break;702 703 845 case 'v': /* Verbose */ 704 846 fVerbose = true; … … 706 848 707 849 case GETOPTDEF_EXEC_WAITFOREXIT: 850 #ifndef VBOX_WITH_GUEST_CONTROL2 851 #else 852 aWaitFlags.push_back(ProcessWaitForFlag_Terminate); 853 #endif 708 854 fWaitForExit = true; 709 855 break; 710 856 711 857 case GETOPTDEF_EXEC_WAITFORSTDOUT: 858 #ifndef VBOX_WITH_GUEST_CONTROL2 712 859 fExecFlags |= ExecuteProcessFlag_WaitForStdOut; 860 #else 861 aCreateFlags.push_back(ProcessCreateFlag_WaitForStdOut); 862 aWaitFlags.push_back(ProcessWaitForFlag_StdOut); 863 #endif 713 864 fWaitForExit = true; 714 865 break; 715 866 716 867 case GETOPTDEF_EXEC_WAITFORSTDERR: 868 #ifndef VBOX_WITH_GUEST_CONTROL2 717 869 fExecFlags |= ExecuteProcessFlag_WaitForStdErr; 870 #else 871 aCreateFlags.push_back(ProcessCreateFlag_WaitForStdErr); 872 aWaitFlags.push_back(ProcessWaitForFlag_StdErr); 873 #endif 718 874 fWaitForExit = true; 719 875 break; … … 721 877 case VINF_GETOPT_NOT_OPTION: 722 878 { 723 if (args.size() == 0 && Utf8Cmd.isEmpty())724 Utf8Cmd = ValueUnion.psz;879 if (args.size() == 0 && strCmd.isEmpty()) 880 strCmd = ValueUnion.psz; 725 881 else 726 882 args.push_back(Bstr(ValueUnion.psz).raw()); … … 733 889 } 734 890 735 if ( Utf8Cmd.isEmpty())891 if (strCmd.isEmpty()) 736 892 return errorSyntax(USAGE_GUESTCONTROL, "No command to execute specified!"); 737 893 738 if ( Utf8UserName.isEmpty())894 if (strUserName.isEmpty()) 739 895 return errorSyntax(USAGE_GUESTCONTROL, "No user name specified!"); 740 896 … … 744 900 745 901 /* 746 * <missing comment indicating that we're done parsing args and started doing something else>902 * Start with the real work. 747 903 */ 748 904 HRESULT rc = S_OK; … … 755 911 } 756 912 913 #ifndef VBOX_WITH_GUEST_CONTROL2 757 914 /* Get current time stamp to later calculate rest of timeout left. */ 758 915 uint64_t u64StartMS = RTTimeMilliTS(); 759 916 760 /* Execute the process. */ 761 int rcExit = RTEXITCODE_FAILURE; 762 ComPtr<IProgress> progress; 917 /* 918 * Execute the process. 919 */ 920 ComPtr<IProgress> pProgress; 763 921 ULONG uPID = 0; 764 rc = pGuest->ExecuteProcess(Bstr( Utf8Cmd).raw(),922 rc = pGuest->ExecuteProcess(Bstr(strCmd).raw(), 765 923 fExecFlags, 766 924 ComSafeArrayAsInParam(args), 767 925 ComSafeArrayAsInParam(env), 768 Bstr( Utf8UserName).raw(),769 Bstr( Utf8Password).raw(),926 Bstr(strUserName).raw(), 927 Bstr(strPassword).raw(), 770 928 cMsTimeout, 771 929 &uPID, 772 p rogress.asOutParam());930 pProgress.asOutParam()); 773 931 if (FAILED(rc)) 774 return ctrlPrintError(pGuest, COM_IIDOF(IGuest)); 932 { 933 ctrlPrintError(pGuest, COM_IIDOF(IGuest)); 934 return RTEXITCODE_FAILURE; 935 } 775 936 776 937 if (fVerbose) 777 RTPrintf("Process '%s' (PID: %u) started\n", Utf8Cmd.c_str(), uPID);938 RTPrintf("Process '%s' (PID: %u) started\n", strCmd.c_str(), uPID); 778 939 if (fWaitForExit) 779 940 { … … 795 956 796 957 /* Setup signal handling if cancelable. */ 797 ASSERT(p rogress);958 ASSERT(pProgress); 798 959 bool fCanceledAlready = false; 799 960 BOOL fCancelable; 800 HRESULT hrc = p rogress->COMGETTER(Cancelable)(&fCancelable);961 HRESULT hrc = pProgress->COMGETTER(Cancelable)(&fCancelable); 801 962 if (FAILED(hrc)) 802 963 fCancelable = FALSE; … … 814 975 BOOL fCompleted = FALSE; 815 976 BOOL fCanceled = FALSE; 816 while ( SUCCEEDED(p rogress->COMGETTER(Completed(&fCompleted)))977 while ( SUCCEEDED(pProgress->COMGETTER(Completed(&fCompleted))) 817 978 && !fCompleted) 818 979 { 819 980 /* Do we need to output stuff? */ 820 uint32_tcMsTimeLeft;981 RTMSINTERVAL cMsTimeLeft; 821 982 if (fExecFlags & ExecuteProcessFlag_WaitForStdOut) 822 983 { … … 840 1001 if (g_fGuestCtrlCanceled && !fCanceledAlready) 841 1002 { 842 hrc = p rogress->Cancel();1003 hrc = pProgress->Cancel(); 843 1004 if (SUCCEEDED(hrc)) 844 1005 fCanceledAlready = TRUE; … … 848 1009 849 1010 /* Progress canceled by Main API? */ 850 if ( SUCCEEDED(p rogress->COMGETTER(Canceled(&fCanceled)))1011 if ( SUCCEEDED(pProgress->COMGETTER(Canceled(&fCanceled))) 851 1012 && fCanceled) 852 1013 break; … … 856 1017 && RTTimeMilliTS() - u64StartMS > cMsTimeout) 857 1018 { 858 p rogress->Cancel();1019 pProgress->Cancel(); 859 1020 break; 860 1021 } … … 870 1031 if (fVerbose) 871 1032 RTPrintf("Process execution canceled!\n"); 872 r cExit =EXITCODEEXEC_CANCELED;1033 return EXITCODEEXEC_CANCELED; 873 1034 } 874 1035 else if ( fCompleted … … 876 1037 { 877 1038 LONG iRc; 878 CHECK_ERROR_RET(p rogress, COMGETTER(ResultCode)(&iRc), rc);1039 CHECK_ERROR_RET(pProgress, COMGETTER(ResultCode)(&iRc), rc); 879 1040 if (FAILED(iRc)) 880 vrc = ctrlPrintProgressError(p rogress);1041 vrc = ctrlPrintProgressError(pProgress); 881 1042 else 882 1043 { … … 888 1049 if (fVerbose) 889 1050 RTPrintf("Exit code=%u (Status=%u [%s], Flags=%u)\n", uRetExitCode, retStatus, ctrlExecProcessStatusToText(retStatus), uRetFlags); 890 r cExit =ctrlExecProcessStatusToExitCode(retStatus, uRetExitCode);1051 return ctrlExecProcessStatusToExitCode(retStatus, uRetExitCode); 891 1052 } 892 1053 else 893 1054 { 894 1055 ctrlPrintError(pGuest, COM_IIDOF(IGuest)); 895 r cExit =RTEXITCODE_FAILURE;1056 return RTEXITCODE_FAILURE; 896 1057 } 897 1058 } … … 901 1062 if (fVerbose) 902 1063 RTPrintf("Process execution aborted!\n"); 903 rcExit = EXITCODEEXEC_TERM_ABEND; 904 } 905 } 906 907 if (RT_FAILURE(vrc) || FAILED(rc)) 1064 return EXITCODEEXEC_TERM_ABEND; 1065 } 1066 } 1067 #else 1068 ComPtr<IGuestSession> pGuestSession; 1069 rc = pGuest->CreateSession(Bstr(strUserName).raw(), 1070 Bstr(strPassword).raw(), 1071 Bstr(strDomain).raw(), 1072 Bstr("guest exec").raw(), 1073 pGuestSession.asOutParam()); 1074 if (FAILED(rc)) 1075 { 1076 ctrlPrintError(pGuest, COM_IIDOF(IGuest)); 908 1077 return RTEXITCODE_FAILURE; 909 return rcExit; 1078 } 1079 1080 /* Get current time stamp to later calculate rest of timeout left. */ 1081 uint64_t u64StartMS = RTTimeMilliTS(); 1082 1083 /* 1084 * Execute the process. 1085 */ 1086 ComPtr<IGuestProcess> pProcess; 1087 rc = pGuestSession->ProcessCreate(Bstr(strCmd).raw(), 1088 ComSafeArrayAsInParam(args), 1089 ComSafeArrayAsInParam(env), 1090 ComSafeArrayAsInParam(aCreateFlags), 1091 cMsTimeout, 1092 pProcess.asOutParam()); 1093 if (FAILED(rc)) 1094 { 1095 ctrlPrintError(pGuestSession, COM_IIDOF(IGuestSession)); 1096 return RTEXITCODE_FAILURE; 1097 } 1098 ULONG uPID = 0; 1099 rc = pProcess->COMGETTER(PID)(&uPID); 1100 if (FAILED(rc)) 1101 { 1102 ctrlPrintError(pProcess, COM_IIDOF(IProcess)); 1103 return RTEXITCODE_FAILURE; 1104 } 1105 1106 if (fVerbose) 1107 RTPrintf("Process '%s' (PID: %u) started\n", strCmd.c_str(), uPID); 1108 1109 if (fWaitForExit) 1110 { 1111 if (fVerbose) 1112 { 1113 if (cMsTimeout) /* Wait with a certain timeout. */ 1114 { 1115 /* Calculate timeout value left after process has been started. */ 1116 uint64_t u64Elapsed = RTTimeMilliTS() - u64StartMS; 1117 /* Is timeout still bigger than current difference? */ 1118 if (cMsTimeout > u64Elapsed) 1119 RTPrintf("Waiting for process to exit (%ums left) ...\n", cMsTimeout - u64Elapsed); 1120 else 1121 RTPrintf("No time left to wait for process!\n"); /** @todo a bit misleading ... */ 1122 } 1123 else /* Wait forever. */ 1124 RTPrintf("Waiting for process to exit ...\n"); 1125 } 1126 1127 /** @todo does this need signal handling? there's no progress object etc etc */ 1128 1129 vrc = RTStrmSetMode(g_pStdOut, 1 /* Binary mode */, -1 /* Code set, unchanged */); 1130 if (RT_FAILURE(vrc)) 1131 RTMsgError("Unable to set stdout's binary mode, rc=%Rrc\n", vrc); 1132 vrc = RTStrmSetMode(g_pStdErr, 1 /* Binary mode */, -1 /* Code set, unchanged */); 1133 if (RT_FAILURE(vrc)) 1134 RTMsgError("Unable to set stderr's binary mode, rc=%Rrc\n", vrc); 1135 1136 /* Wait for process to exit ... */ 1137 RTMSINTERVAL cMsTimeLeft = 1; 1138 bool fCompleted = false; 1139 while (!fCompleted && cMsTimeLeft != 0) 1140 { 1141 cMsTimeLeft = ctrlExecGetRemainingTime(u64StartMS, cMsTimeout); 1142 ProcessWaitResult_T waitResult; 1143 rc = pProcess->WaitForArray(ComSafeArrayAsInParam(aWaitFlags), cMsTimeLeft, &waitResult); 1144 if (FAILED(rc)) 1145 { 1146 ctrlPrintError(pProcess, COM_IIDOF(IProcess)); 1147 return RTEXITCODE_FAILURE; 1148 } 1149 1150 switch (waitResult) 1151 { 1152 case ProcessWaitResult_StdOut: 1153 /* Do we need to fetch stdout data? */ 1154 vrc = ctrlExecPrintOutput(pProcess, g_pStdOut, 1 /* StdOut */); 1155 break; 1156 case ProcessWaitResult_StdErr: 1157 /* Do we need to fetch stderr data? */ 1158 vrc = ctrlExecPrintOutput(pProcess, g_pStdErr, 2 /* StdErr */); 1159 break; 1160 case ProcessWaitResult_Terminate: 1161 /* Process terminated, we're done */ 1162 fCompleted = true; 1163 break; 1164 default: 1165 /* Ignore all other results, let the timeout expire */; 1166 } 1167 } /* while */ 1168 1169 /* Report status back to the user. */ 1170 if (fCompleted) 1171 { 1172 ProcessStatus_T status; 1173 rc = pProcess->COMGETTER(Status)(&status); 1174 if (FAILED(rc)) 1175 { 1176 ctrlPrintError(pProcess, COM_IIDOF(IProcess)); 1177 return RTEXITCODE_FAILURE; 1178 } 1179 LONG exitCode; 1180 rc = pProcess->COMGETTER(ExitCode)(&exitCode); 1181 if (FAILED(rc)) 1182 { 1183 ctrlPrintError(pProcess, COM_IIDOF(IProcess)); 1184 return RTEXITCODE_FAILURE; 1185 } 1186 if (fVerbose) 1187 RTPrintf("Exit code=%u (Status=%u [%s])\n", exitCode, status, ctrlExecProcessStatusToText(status)); 1188 return ctrlExecProcessStatusToExitCode(status, exitCode); 1189 } 1190 else 1191 { 1192 if (fVerbose) 1193 RTPrintf("Process execution aborted!\n"); 1194 return EXITCODEEXEC_TERM_ABEND; 1195 } 1196 } 1197 #endif 1198 1199 return RT_FAILURE(vrc) || FAILED(rc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS; 910 1200 } 911 1201 … … 1322 1612 1323 1613 int vrc = VINF_SUCCESS; 1324 ComPtr<IProgress> p rogress;1614 ComPtr<IProgress> pProgress; 1325 1615 HRESULT rc; 1326 1616 if (pContext->fHostToGuest) … … 1328 1618 rc = pContext->pGuest->CopyToGuest(Bstr(pszFileSource).raw(), Bstr(pszFileDest).raw(), 1329 1619 Bstr(pContext->pszUsername).raw(), Bstr(pContext->pszPassword).raw(), 1330 fFlags, p rogress.asOutParam());1620 fFlags, pProgress.asOutParam()); 1331 1621 } 1332 1622 else … … 1334 1624 rc = pContext->pGuest->CopyFromGuest(Bstr(pszFileSource).raw(), Bstr(pszFileDest).raw(), 1335 1625 Bstr(pContext->pszUsername).raw(), Bstr(pContext->pszPassword).raw(), 1336 fFlags, p rogress.asOutParam());1626 fFlags, pProgress.asOutParam()); 1337 1627 } 1338 1628 … … 1342 1632 { 1343 1633 if (pContext->fVerbose) 1344 rc = showProgress(p rogress);1634 rc = showProgress(pProgress); 1345 1635 else 1346 rc = p rogress->WaitForCompletion(-1 /* No timeout */);1636 rc = pProgress->WaitForCompletion(-1 /* No timeout */); 1347 1637 if (SUCCEEDED(rc)) 1348 CHECK_PROGRESS_ERROR(p rogress, ("File copy failed"));1349 vrc = ctrlPrintProgressError(p rogress);1638 CHECK_PROGRESS_ERROR(pProgress, ("File copy failed")); 1639 vrc = ctrlPrintProgressError(pProgress); 1350 1640 } 1351 1641 … … 1591 1881 if (pContext->fVerbose) 1592 1882 { 1593 Utf8Str Utf8Dir(strName);1594 RTPrintf("Directory: %s\n", Utf8Dir.c_str());1883 Utf8Str strDir(strName); 1884 RTPrintf("Directory: %s\n", strDir.c_str()); 1595 1885 } 1596 1886 … … 1820 2110 { "--dryrun", GETOPTDEF_COPY_DRYRUN, RTGETOPT_REQ_NOTHING }, 1821 2111 { "--follow", GETOPTDEF_COPY_FOLLOW, RTGETOPT_REQ_NOTHING }, 2112 { "--username", 'u', RTGETOPT_REQ_STRING }, 1822 2113 { "--passwordfile", 'p', RTGETOPT_REQ_STRING }, 1823 2114 { "--password", GETOPTDEF_COPY_PASSWORD, RTGETOPT_REQ_STRING }, 2115 { "--domain", 'd', RTGETOPT_REQ_STRING }, 1824 2116 { "--recursive", 'R', RTGETOPT_REQ_NOTHING }, 1825 2117 { "--target-directory", GETOPTDEF_COPY_TARGETDIR, RTGETOPT_REQ_STRING }, 1826 { "--username", 'u', RTGETOPT_REQ_STRING },1827 2118 { "--verbose", 'v', RTGETOPT_REQ_NOTHING } 1828 2119 }; … … 1834 2125 s_aOptions, RT_ELEMENTS(s_aOptions), 0, RTGETOPTINIT_FLAGS_OPTS_FIRST); 1835 2126 1836 Utf8Str Utf8Source; 1837 Utf8Str Utf8Dest; 1838 Utf8Str Utf8UserName; 1839 Utf8Str Utf8Password; 2127 Utf8Str strSource; 2128 Utf8Str strDest; 2129 Utf8Str strUserName; 2130 Utf8Str strPassword; 2131 Utf8Str strDomain; 1840 2132 uint32_t fFlags = CopyFileFlag_None; 1841 2133 bool fVerbose = false; … … 1859 2151 break; 1860 2152 2153 case 'u': /* User name */ 2154 strUserName = ValueUnion.psz; 2155 break; 2156 1861 2157 case GETOPTDEF_COPY_PASSWORD: /* Password */ 1862 Utf8Password = ValueUnion.psz;2158 strPassword = ValueUnion.psz; 1863 2159 break; 1864 2160 1865 2161 case 'p': /* Password file */ 1866 2162 { 1867 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, & Utf8Password);2163 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &strPassword); 1868 2164 if (rcExit != RTEXITCODE_SUCCESS) 1869 2165 return rcExit; … … 1871 2167 } 1872 2168 2169 case 'd': /* domain */ 2170 strDomain = ValueUnion.psz; 2171 break; 2172 1873 2173 case 'R': /* Recursive processing */ 1874 2174 fFlags |= CopyFileFlag_Recursive; … … 1876 2176 1877 2177 case GETOPTDEF_COPY_TARGETDIR: 1878 Utf8Dest = ValueUnion.psz; 1879 break; 1880 1881 case 'u': /* User name */ 1882 Utf8UserName = ValueUnion.psz; 2178 strDest = ValueUnion.psz; 1883 2179 break; 1884 2180 … … 1893 2189 * (= last) argument as destination. */ 1894 2190 if ( pArg->argc == GetState.iNext 1895 && Utf8Dest.isEmpty())2191 && strDest.isEmpty()) 1896 2192 { 1897 Utf8Dest = ValueUnion.psz;2193 strDest = ValueUnion.psz; 1898 2194 } 1899 2195 else … … 1914 2210 "No source(s) specified!"); 1915 2211 1916 if ( Utf8Dest.isEmpty())2212 if (strDest.isEmpty()) 1917 2213 return errorSyntax(USAGE_GUESTCONTROL, 1918 2214 "No destination specified!"); 1919 2215 1920 if ( Utf8UserName.isEmpty())2216 if (strUserName.isEmpty()) 1921 2217 return errorSyntax(USAGE_GUESTCONTROL, 1922 2218 "No user name specified!"); … … 1939 2235 PCOPYCONTEXT pContext; 1940 2236 vrc = ctrlCopyContextCreate(guest, fVerbose, fDryRun, fHostToGuest, 1941 Utf8UserName.c_str(), Utf8Password.c_str(),2237 strUserName.c_str(), strPassword.c_str(), 1942 2238 &pContext); 1943 2239 if (RT_FAILURE(vrc)) … … 1948 2244 1949 2245 /* If the destination is a path, (try to) create it. */ 1950 const char *pszDest = Utf8Dest.c_str();2246 const char *pszDest = strDest.c_str(); 1951 2247 if (!RTPathFilename(pszDest)) 1952 2248 { … … 2028 2324 char *pszDestFile; 2029 2325 vrc = ctrlCopyTranslatePath(pszSourceRoot, pszSource, 2030 Utf8Dest.c_str(), &pszDestFile);2326 strDest.c_str(), &pszDestFile); 2031 2327 if (RT_SUCCESS(vrc)) 2032 2328 { … … 2043 2339 /* Directory (with filter?). */ 2044 2340 vrc = ctrlCopyDirToDest(pContext, pszSource, pszFilter, 2045 Utf8Dest.c_str(), fFlags);2341 strDest.c_str(), fFlags); 2046 2342 } 2047 2343 } … … 2088 2384 { "--mode", 'm', RTGETOPT_REQ_UINT32 }, 2089 2385 { "--parents", 'P', RTGETOPT_REQ_NOTHING }, 2386 { "--username", 'u', RTGETOPT_REQ_STRING }, 2090 2387 { "--passwordfile", 'p', RTGETOPT_REQ_STRING }, 2091 2388 { "--password", GETOPTDEF_MKDIR_PASSWORD, RTGETOPT_REQ_STRING }, 2092 { "-- username", 'u', RTGETOPT_REQ_STRING },2389 { "--domain", 'd', RTGETOPT_REQ_STRING }, 2093 2390 { "--verbose", 'v', RTGETOPT_REQ_NOTHING } 2094 2391 }; … … 2100 2397 s_aOptions, RT_ELEMENTS(s_aOptions), 0, RTGETOPTINIT_FLAGS_OPTS_FIRST); 2101 2398 2102 Utf8Str Utf8UserName; 2103 Utf8Str Utf8Password; 2399 Utf8Str strUserName; 2400 Utf8Str strPassword; 2401 Utf8Str strDomain; 2104 2402 uint32_t fFlags = DirectoryCreateFlag_None; 2105 2403 uint32_t fDirMode = 0; /* Default mode. */ … … 2121 2419 break; 2122 2420 2421 case 'u': /* User name */ 2422 strUserName = ValueUnion.psz; 2423 break; 2424 2123 2425 case GETOPTDEF_MKDIR_PASSWORD: /* Password */ 2124 Utf8Password = ValueUnion.psz;2426 strPassword = ValueUnion.psz; 2125 2427 break; 2126 2428 2127 2429 case 'p': /* Password file */ 2128 2430 { 2129 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, & Utf8Password);2431 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &strPassword); 2130 2432 if (rcExit != RTEXITCODE_SUCCESS) 2131 2433 return rcExit; … … 2133 2435 } 2134 2436 2135 case ' u': /* User name*/2136 Utf8UserName= ValueUnion.psz;2437 case 'd': /* domain */ 2438 strDomain = ValueUnion.psz; 2137 2439 break; 2138 2440 … … 2156 2458 return errorSyntax(USAGE_GUESTCONTROL, "No directory to create specified!"); 2157 2459 2158 if ( Utf8UserName.isEmpty())2460 if (strUserName.isEmpty()) 2159 2461 return errorSyntax(USAGE_GUESTCONTROL, "No user name specified!"); 2160 2462 … … 2173 2475 2174 2476 hrc = guest->DirectoryCreate(Bstr(it->first).raw(), 2175 Bstr( Utf8UserName).raw(), Bstr(Utf8Password).raw(),2477 Bstr(strUserName).raw(), Bstr(strPassword).raw(), 2176 2478 fDirMode, fFlags); 2177 2479 if (FAILED(hrc)) … … 2196 2498 { "--file-system", 'f', RTGETOPT_REQ_NOTHING }, 2197 2499 { "--format", 'c', RTGETOPT_REQ_STRING }, 2500 { "--username", 'u', RTGETOPT_REQ_STRING }, 2198 2501 { "--passwordfile", 'p', RTGETOPT_REQ_STRING }, 2199 2502 { "--password", GETOPTDEF_STAT_PASSWORD, RTGETOPT_REQ_STRING }, 2503 { "--domain", 'd', RTGETOPT_REQ_STRING }, 2200 2504 { "--terse", 't', RTGETOPT_REQ_NOTHING }, 2201 { "--username", 'u', RTGETOPT_REQ_STRING },2202 2505 { "--verbose", 'v', RTGETOPT_REQ_NOTHING } 2203 2506 }; … … 2209 2512 s_aOptions, RT_ELEMENTS(s_aOptions), 0, RTGETOPTINIT_FLAGS_OPTS_FIRST); 2210 2513 2211 Utf8Str Utf8UserName; 2212 Utf8Str Utf8Password; 2514 Utf8Str strUserName; 2515 Utf8Str strPassword; 2516 Utf8Str strDomain; 2213 2517 2214 2518 bool fVerbose = false; … … 2220 2524 switch (ch) 2221 2525 { 2526 case 'u': /* User name */ 2527 strUserName = ValueUnion.psz; 2528 break; 2529 2222 2530 case GETOPTDEF_STAT_PASSWORD: /* Password */ 2223 Utf8Password = ValueUnion.psz;2531 strPassword = ValueUnion.psz; 2224 2532 break; 2225 2533 2226 2534 case 'p': /* Password file */ 2227 2535 { 2228 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, & Utf8Password);2536 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &strPassword); 2229 2537 if (rcExit != RTEXITCODE_SUCCESS) 2230 2538 return rcExit; … … 2232 2540 } 2233 2541 2234 case ' u': /* User name*/2235 Utf8UserName= ValueUnion.psz;2542 case 'd': /* domain */ 2543 strDomain = ValueUnion.psz; 2236 2544 break; 2237 2545 … … 2263 2571 return errorSyntax(USAGE_GUESTCONTROL, "No element(s) to check specified!"); 2264 2572 2265 if ( Utf8UserName.isEmpty())2573 if (strUserName.isEmpty()) 2266 2574 return errorSyntax(USAGE_GUESTCONTROL, "No user name specified!"); 2267 2575 … … 2279 2587 BOOL fExists; 2280 2588 hrc = guest->FileExists(Bstr(it->first).raw(), 2281 Bstr( Utf8UserName).raw(), Bstr(Utf8Password).raw(),2589 Bstr(strUserName).raw(), Bstr(strPassword).raw(), 2282 2590 &fExists); 2283 2591 if (FAILED(hrc)) … … 2316 2624 * arguments. 2317 2625 */ 2318 Utf8Str Utf8Source;2626 Utf8Str strSource; 2319 2627 bool fVerbose = false; 2320 2628 … … 2337 2645 { 2338 2646 case 's': 2339 Utf8Source = ValueUnion.psz;2647 strSource = ValueUnion.psz; 2340 2648 break; 2341 2649 … … 2353 2661 2354 2662 #ifdef DEBUG_andy 2355 if ( Utf8Source.isEmpty())2356 Utf8Source = "c:\\Downloads\\VBoxGuestAdditions-r67158.iso";2663 if (strSource.isEmpty()) 2664 strSource = "c:\\Downloads\\VBoxGuestAdditions-r67158.iso"; 2357 2665 #endif 2358 2666 2359 2667 /* Determine source if not set yet. */ 2360 if ( Utf8Source.isEmpty())2668 if (strSource.isEmpty()) 2361 2669 { 2362 2670 char strTemp[RTPATH_MAX]; 2363 2671 vrc = RTPathAppPrivateNoArch(strTemp, sizeof(strTemp)); 2364 2672 AssertRC(vrc); 2365 Utf8Str Utf8Src1 = Utf8Str(strTemp).append("/VBoxGuestAdditions.iso");2673 Utf8Str strSrc1 = Utf8Str(strTemp).append("/VBoxGuestAdditions.iso"); 2366 2674 2367 2675 vrc = RTPathExecDir(strTemp, sizeof(strTemp)); 2368 2676 AssertRC(vrc); 2369 Utf8Str Utf8Src2 = Utf8Str(strTemp).append("/additions/VBoxGuestAdditions.iso");2677 Utf8Str strSrc2 = Utf8Str(strTemp).append("/additions/VBoxGuestAdditions.iso"); 2370 2678 2371 2679 /* Check the standard image locations */ 2372 if (RTFileExists( Utf8Src1.c_str()))2373 Utf8Source = Utf8Src1;2374 else if (RTFileExists( Utf8Src2.c_str()))2375 Utf8Source = Utf8Src2;2680 if (RTFileExists(strSrc1.c_str())) 2681 strSource = strSrc1; 2682 else if (RTFileExists(strSrc2.c_str())) 2683 strSource = strSrc2; 2376 2684 else 2377 2685 { … … 2380 2688 } 2381 2689 } 2382 else if (!RTFileExists( Utf8Source.c_str()))2383 { 2384 RTMsgError("Source \"%s\" does not exist!\n", Utf8Source.c_str());2690 else if (!RTFileExists(strSource.c_str())) 2691 { 2692 RTMsgError("Source \"%s\" does not exist!\n", strSource.c_str()); 2385 2693 vrc = VERR_FILE_NOT_FOUND; 2386 2694 } … … 2389 2697 { 2390 2698 if (fVerbose) 2391 RTPrintf("Using source: %s\n", Utf8Source.c_str());2699 RTPrintf("Using source: %s\n", strSource.c_str()); 2392 2700 2393 2701 HRESULT rc = S_OK; 2394 2702 ComPtr<IProgress> pProgress; 2395 CHECK_ERROR(guest, UpdateGuestAdditions(Bstr( Utf8Source).raw(),2703 CHECK_ERROR(guest, UpdateGuestAdditions(Bstr(strSource).raw(), 2396 2704 /* Wait for whole update process to complete. */ 2397 2705 AdditionsUpdateFlag_None, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp
r41324 r42551 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 225 225 if (bDhcp) 226 226 { 227 CHECK_ERROR(hif, EnableDynamicI pConfig ());227 CHECK_ERROR(hif, EnableDynamicIPConfig ()); 228 228 } 229 229 else if (pIp) … … 232 232 pNetmask = "255.255.255.0"; /* ?? */ 233 233 234 CHECK_ERROR(hif, EnableStaticI pConfig(Bstr(pIp).raw(),234 CHECK_ERROR(hif, EnableStaticIPConfig(Bstr(pIp).raw(), 235 235 Bstr(pNetmask).raw())); 236 236 } … … 250 250 251 251 Bstr ipv6str(pIpv6); 252 CHECK_ERROR(hif, EnableStaticI pConfigV6(ipv6str.raw(),252 CHECK_ERROR(hif, EnableStaticIPConfigV6(ipv6str.raw(), 253 253 (ULONG)uNetmasklengthv6)); 254 254 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r42261 r42551 923 923 { 924 924 Bstr strNetwork; 925 ComPtr<INATEngine> driver;926 nic->COMGETTER(N atDriver)(driver.asOutParam());927 driver->COMGETTER(Network)(strNetwork.asOutParam());925 ComPtr<INATEngine> engine; 926 nic->COMGETTER(NATEngine)(engine.asOutParam()); 927 engine->COMGETTER(Network)(strNetwork.asOutParam()); 928 928 com::SafeArray<BSTR> forwardings; 929 driver->COMGETTER(Redirects)(ComSafeArrayAsOutParam(forwardings));929 engine->COMGETTER(Redirects)(ComSafeArrayAsOutParam(forwardings)); 930 930 strNatForwardings = ""; 931 931 for (size_t i = 0; i < forwardings.size(); ++i) … … 1000 1000 ULONG tcpSnd = 0; 1001 1001 ULONG tcpRcv = 0; 1002 driver->GetNetworkSettings(&mtu, &sockSnd, &sockRcv, &tcpSnd, &tcpRcv);1002 engine->GetNetworkSettings(&mtu, &sockSnd, &sockRcv, &tcpSnd, &tcpRcv); 1003 1003 1004 1004 if (details == VMINFO_MACHINEREADABLE) … … 1176 1176 1177 1177 /* Pointing device information */ 1178 PointingH idType_T aPointingHid;1179 const char *pszH id= "Unknown";1180 const char *pszMrH id= "unknown";1181 machine->COMGETTER(PointingH idType)(&aPointingHid);1182 switch (aPointingH id)1183 { 1184 case PointingH idType_None:1185 pszH id= "None";1186 pszMrH id= "none";1178 PointingHIDType_T aPointingHID; 1179 const char *pszHID = "Unknown"; 1180 const char *pszMrHID = "unknown"; 1181 machine->COMGETTER(PointingHIDType)(&aPointingHID); 1182 switch (aPointingHID) 1183 { 1184 case PointingHIDType_None: 1185 pszHID = "None"; 1186 pszMrHID = "none"; 1187 1187 break; 1188 case PointingH idType_PS2Mouse:1189 pszH id= "PS/2 Mouse";1190 pszMrH id= "ps2mouse";1188 case PointingHIDType_PS2Mouse: 1189 pszHID = "PS/2 Mouse"; 1190 pszMrHID = "ps2mouse"; 1191 1191 break; 1192 case PointingH idType_USBMouse:1193 pszH id= "USB Mouse";1194 pszMrH id= "usbmouse";1192 case PointingHIDType_USBMouse: 1193 pszHID = "USB Mouse"; 1194 pszMrHID = "usbmouse"; 1195 1195 break; 1196 case PointingH idType_USBTablet:1197 pszH id= "USB Tablet";1198 pszMrH id= "usbtablet";1196 case PointingHIDType_USBTablet: 1197 pszHID = "USB Tablet"; 1198 pszMrHID = "usbtablet"; 1199 1199 break; 1200 case PointingH idType_ComboMouse:1201 pszH id= "USB Tablet and PS/2 Mouse";1202 pszMrH id= "combomouse";1200 case PointingHIDType_ComboMouse: 1201 pszHID = "USB Tablet and PS/2 Mouse"; 1202 pszMrHID = "combomouse"; 1203 1203 break; 1204 1204 default: … … 1206 1206 } 1207 1207 if (details == VMINFO_MACHINEREADABLE) 1208 RTPrintf("hidpointing=\"%s\"\n", pszMrH id);1208 RTPrintf("hidpointing=\"%s\"\n", pszMrHID); 1209 1209 else 1210 RTPrintf("Pointing Device: %s\n", pszH id);1210 RTPrintf("Pointing Device: %s\n", pszHID); 1211 1211 1212 1212 /* Keyboard device information */ 1213 KeyboardH idType_T aKeyboardHid;1214 machine->COMGETTER(KeyboardH idType)(&aKeyboardHid);1215 pszH id= "Unknown";1216 pszMrH id= "unknown";1217 switch (aKeyboardH id)1218 { 1219 case KeyboardH idType_None:1220 pszH id= "None";1221 pszMrH id= "none";1213 KeyboardHIDType_T aKeyboardHID; 1214 machine->COMGETTER(KeyboardHIDType)(&aKeyboardHID); 1215 pszHID = "Unknown"; 1216 pszMrHID = "unknown"; 1217 switch (aKeyboardHID) 1218 { 1219 case KeyboardHIDType_None: 1220 pszHID = "None"; 1221 pszMrHID = "none"; 1222 1222 break; 1223 case KeyboardH idType_PS2Keyboard:1224 pszH id= "PS/2 Keyboard";1225 pszMrH id= "ps2kbd";1223 case KeyboardHIDType_PS2Keyboard: 1224 pszHID = "PS/2 Keyboard"; 1225 pszMrHID = "ps2kbd"; 1226 1226 break; 1227 case KeyboardH idType_USBKeyboard:1228 pszH id= "USB Keyboard";1229 pszMrH id= "usbkbd";1227 case KeyboardHIDType_USBKeyboard: 1228 pszHID = "USB Keyboard"; 1229 pszMrHID = "usbkbd"; 1230 1230 break; 1231 case KeyboardH idType_ComboKeyboard:1232 pszH id= "USB and PS/2 Keyboard";1233 pszMrH id= "combokbd";1231 case KeyboardHIDType_ComboKeyboard: 1232 pszHID = "USB and PS/2 Keyboard"; 1233 pszMrHID = "combokbd"; 1234 1234 break; 1235 1235 default: … … 1237 1237 } 1238 1238 if (details == VMINFO_MACHINEREADABLE) 1239 RTPrintf("hidkeyboard=\"%s\"\n", pszMrH id);1239 RTPrintf("hidkeyboard=\"%s\"\n", pszMrHID); 1240 1240 else 1241 RTPrintf("Keyboard Device: %s\n", pszH id);1241 RTPrintf("Keyboard Device: %s\n", pszHID); 1242 1242 1243 1243 ComPtr<ISystemProperties> sysProps; … … 1713 1713 { 1714 1714 BOOL fEnabled; 1715 BOOL fE hciEnabled;1715 BOOL fEHCIEnabled; 1716 1716 rc = USBCtl->COMGETTER(Enabled)(&fEnabled); 1717 1717 if (FAILED(rc)) … … 1722 1722 RTPrintf("USB: %s\n", fEnabled ? "enabled" : "disabled"); 1723 1723 1724 rc = USBCtl->COMGETTER(EnabledE hci)(&fEhciEnabled);1724 rc = USBCtl->COMGETTER(EnabledEHCI)(&fEHCIEnabled); 1725 1725 if (FAILED(rc)) 1726 fE hciEnabled = false;1726 fEHCIEnabled = false; 1727 1727 if (details == VMINFO_MACHINEREADABLE) 1728 RTPrintf("ehci=\"%s\"\n", fE hciEnabled ? "on" : "off");1728 RTPrintf("ehci=\"%s\"\n", fEHCIEnabled ? "on" : "off"); 1729 1729 else 1730 RTPrintf("EHCI: %s\n", fE hciEnabled ? "enabled" : "disabled");1730 RTPrintf("EHCI: %s\n", fEHCIEnabled ? "enabled" : "disabled"); 1731 1731 1732 1732 SafeIfaceArray <IUSBDeviceFilter> Coll; … … 1998 1998 /* Host PCI passthrough devices */ 1999 1999 { 2000 SafeIfaceArray <IP ciDeviceAttachment> assignments;2001 rc = machine->COMGETTER(P ciDeviceAssignments)(ComSafeArrayAsOutParam(assignments));2000 SafeIfaceArray <IPCIDeviceAttachment> assignments; 2001 rc = machine->COMGETTER(PCIDeviceAssignments)(ComSafeArrayAsOutParam(assignments)); 2002 2002 if (SUCCEEDED(rc)) 2003 2003 { … … 2009 2009 for (size_t index = 0; index < assignments.size(); ++index) 2010 2010 { 2011 ComPtr<IP ciDeviceAttachment> Assignment = assignments[index];2012 char szHostP ciAddress[32], szGuestPciAddress[32];2013 LONG iHostP ciAddress = -1, iGuestPciAddress = -1;2011 ComPtr<IPCIDeviceAttachment> Assignment = assignments[index]; 2012 char szHostPCIAddress[32], szGuestPCIAddress[32]; 2013 LONG iHostPCIAddress = -1, iGuestPCIAddress = -1; 2014 2014 Bstr DevName; 2015 2015 2016 2016 Assignment->COMGETTER(Name)(DevName.asOutParam()); 2017 Assignment->COMGETTER(HostAddress)(&iHostP ciAddress);2018 Assignment->COMGETTER(GuestAddress)(&iGuestP ciAddress);2019 P ciBusAddress().fromLong(iHostPciAddress).format(szHostPciAddress, sizeof(szHostPciAddress));2020 P ciBusAddress().fromLong(iGuestPciAddress).format(szGuestPciAddress, sizeof(szGuestPciAddress));2017 Assignment->COMGETTER(HostAddress)(&iHostPCIAddress); 2018 Assignment->COMGETTER(GuestAddress)(&iGuestPCIAddress); 2019 PCIBusAddress().fromLong(iHostPCIAddress).format(szHostPCIAddress, sizeof(szHostPCIAddress)); 2020 PCIBusAddress().fromLong(iGuestPCIAddress).format(szGuestPCIAddress, sizeof(szGuestPCIAddress)); 2021 2021 2022 2022 if (details == VMINFO_MACHINEREADABLE) 2023 RTPrintf("AttachedHostP ci=%s,%s\n", szHostPciAddress, szGuestPciAddress);2023 RTPrintf("AttachedHostPCI=%s,%s\n", szHostPCIAddress, szGuestPCIAddress); 2024 2024 else 2025 RTPrintf(" Host device %ls at %s attached as %s\n", DevName.raw(), szHostP ciAddress, szGuestPciAddress);2025 RTPrintf(" Host device %ls at %s attached as %s\n", DevName.raw(), szHostPCIAddress, szGuestPCIAddress); 2026 2026 } 2027 2027 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r42189 r42551 489 489 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 490 490 RTPrintf("GUID: %ls\n", interfaceGuid.raw()); 491 BOOL bD hcpEnabled;492 networkInterface->COMGETTER(D hcpEnabled)(&bDhcpEnabled);493 RTPrintf("D hcp: %s\n", bDhcpEnabled ? "Enabled" : "Disabled");491 BOOL bDHCPEnabled; 492 networkInterface->COMGETTER(DHCPEnabled)(&bDHCPEnabled); 493 RTPrintf("DHCP: %s\n", bDHCPEnabled ? "Enabled" : "Disabled"); 494 494 495 495 Bstr IPAddress; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r42538 r42551 1395 1395 { 1396 1396 ComPtr<INetworkAdapter> nic; 1397 ComPtr<INATEngine> driver;1398 1399 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1400 ASSERT(nic); 1401 1402 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1397 ComPtr<INATEngine> engine; 1398 1399 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1400 ASSERT(nic); 1401 1402 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1403 1403 1404 1404 const char *psz = ValueUnion.psz; … … 1406 1406 psz = ""; 1407 1407 1408 CHECK_ERROR( driver, COMSETTER(Network)(Bstr(psz).raw()));1408 CHECK_ERROR(engine, COMSETTER(Network)(Bstr(psz).raw())); 1409 1409 break; 1410 1410 } … … 1413 1413 { 1414 1414 ComPtr<INetworkAdapter> nic; 1415 ComPtr<INATEngine> driver;1416 1417 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1418 ASSERT(nic); 1419 1420 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1421 CHECK_ERROR( driver, COMSETTER(HostIP)(Bstr(ValueUnion.psz).raw()));1415 ComPtr<INATEngine> engine; 1416 1417 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1418 ASSERT(nic); 1419 1420 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1421 CHECK_ERROR(engine, COMSETTER(HostIP)(Bstr(ValueUnion.psz).raw())); 1422 1422 break; 1423 1423 } … … 1442 1442 { 1443 1443 ComPtr<INetworkAdapter> nic; 1444 ComPtr<INATEngine> driver;1444 ComPtr<INATEngine> engine; 1445 1445 char *strMtu; 1446 1446 char *strSockSnd; … … 1463 1463 ASSERT(nic); 1464 1464 1465 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1466 CHECK_ERROR( driver, SetNetworkSettings(RTStrToUInt32(strMtu), RTStrToUInt32(strSockSnd), RTStrToUInt32(strSockRcv),1465 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1466 CHECK_ERROR(engine, SetNetworkSettings(RTStrToUInt32(strMtu), RTStrToUInt32(strSockSnd), RTStrToUInt32(strSockRcv), 1467 1467 RTStrToUInt32(strTcpSnd), RTStrToUInt32(strTcpRcv))); 1468 1468 break; … … 1473 1473 { 1474 1474 ComPtr<INetworkAdapter> nic; 1475 ComPtr<INATEngine> driver;1476 1477 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1478 ASSERT(nic); 1479 1480 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1475 ComPtr<INATEngine> engine; 1476 1477 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1478 ASSERT(nic); 1479 1480 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1481 1481 /* format name:proto:hostip:hostport:guestip:guestport*/ 1482 1482 if (RTStrCmp(ValueUnion.psz, "delete") != 0) … … 1512 1512 break; 1513 1513 } 1514 CHECK_ERROR( driver, AddRedirect(Bstr(strName).raw(), proto,1514 CHECK_ERROR(engine, AddRedirect(Bstr(strName).raw(), proto, 1515 1515 Bstr(strHostIp).raw(), 1516 1516 RTStrToUInt16(strHostPort), … … 1525 1525 if (RT_FAILURE(vrc)) 1526 1526 return errorSyntax(USAGE_MODIFYVM, "Not enough parameters"); 1527 CHECK_ERROR( driver, RemoveRedirect(Bstr(ValueUnion.psz).raw()));1527 CHECK_ERROR(engine, RemoveRedirect(Bstr(ValueUnion.psz).raw())); 1528 1528 } 1529 1529 break; … … 1533 1533 { 1534 1534 ComPtr<INetworkAdapter> nic; 1535 ComPtr<INATEngine> driver;1535 ComPtr<INATEngine> engine; 1536 1536 uint32_t aliasMode = 0; 1537 1537 … … 1539 1539 ASSERT(nic); 1540 1540 1541 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1541 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1542 1542 if (RTStrCmp(ValueUnion.psz,"default") == 0) 1543 1543 { … … 1561 1561 } 1562 1562 } 1563 CHECK_ERROR( driver, COMSETTER(AliasMode)(aliasMode));1563 CHECK_ERROR(engine, COMSETTER(AliasMode)(aliasMode)); 1564 1564 break; 1565 1565 } … … 1568 1568 { 1569 1569 ComPtr<INetworkAdapter> nic; 1570 ComPtr<INATEngine> driver;1571 1572 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1573 ASSERT(nic); 1574 1575 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1576 CHECK_ERROR( driver, COMSETTER(TftpPrefix)(Bstr(ValueUnion.psz).raw()));1570 ComPtr<INATEngine> engine; 1571 1572 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1573 ASSERT(nic); 1574 1575 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1576 CHECK_ERROR(engine, COMSETTER(TFTPPrefix)(Bstr(ValueUnion.psz).raw())); 1577 1577 break; 1578 1578 } … … 1581 1581 { 1582 1582 ComPtr<INetworkAdapter> nic; 1583 ComPtr<INATEngine> driver;1584 1585 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1586 ASSERT(nic); 1587 1588 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1589 CHECK_ERROR( driver, COMSETTER(TftpBootFile)(Bstr(ValueUnion.psz).raw()));1583 ComPtr<INATEngine> engine; 1584 1585 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1586 ASSERT(nic); 1587 1588 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1589 CHECK_ERROR(engine, COMSETTER(TFTPBootFile)(Bstr(ValueUnion.psz).raw())); 1590 1590 break; 1591 1591 } … … 1594 1594 { 1595 1595 ComPtr<INetworkAdapter> nic; 1596 ComPtr<INATEngine> driver;1597 1598 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1599 ASSERT(nic); 1600 1601 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1602 CHECK_ERROR( driver, COMSETTER(TftpNextServer)(Bstr(ValueUnion.psz).raw()));1596 ComPtr<INATEngine> engine; 1597 1598 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1599 ASSERT(nic); 1600 1601 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1602 CHECK_ERROR(engine, COMSETTER(TFTPNextServer)(Bstr(ValueUnion.psz).raw())); 1603 1603 break; 1604 1604 } … … 1606 1606 { 1607 1607 ComPtr<INetworkAdapter> nic; 1608 ComPtr<INATEngine> driver;1609 1610 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1611 ASSERT(nic); 1612 1613 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1614 CHECK_ERROR( driver, COMSETTER(DnsPassDomain)(ValueUnion.f));1608 ComPtr<INATEngine> engine; 1609 1610 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1611 ASSERT(nic); 1612 1613 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1614 CHECK_ERROR(engine, COMSETTER(DNSPassDomain)(ValueUnion.f)); 1615 1615 break; 1616 1616 } … … 1619 1619 { 1620 1620 ComPtr<INetworkAdapter> nic; 1621 ComPtr<INATEngine> driver;1622 1623 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1624 ASSERT(nic); 1625 1626 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1627 CHECK_ERROR( driver, COMSETTER(DnsProxy)(ValueUnion.f));1621 ComPtr<INATEngine> engine; 1622 1623 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1624 ASSERT(nic); 1625 1626 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1627 CHECK_ERROR(engine, COMSETTER(DNSProxy)(ValueUnion.f)); 1628 1628 break; 1629 1629 } … … 1632 1632 { 1633 1633 ComPtr<INetworkAdapter> nic; 1634 ComPtr<INATEngine> driver;1635 1636 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1637 ASSERT(nic); 1638 1639 CHECK_ERROR(nic, COMGETTER(N atDriver)(driver.asOutParam()));1640 CHECK_ERROR( driver, COMSETTER(DnsUseHostResolver)(ValueUnion.f));1634 ComPtr<INATEngine> engine; 1635 1636 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1637 ASSERT(nic); 1638 1639 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam())); 1640 CHECK_ERROR(engine, COMSETTER(DNSUseHostResolver)(ValueUnion.f)); 1641 1641 break; 1642 1642 } … … 1665 1665 if (!strcmp(ValueUnion.psz, "ps2")) 1666 1666 { 1667 CHECK_ERROR(machine, COMSETTER(PointingH idType)(PointingHidType_PS2Mouse));1667 CHECK_ERROR(machine, COMSETTER(PointingHIDType)(PointingHIDType_PS2Mouse)); 1668 1668 } 1669 1669 else if (!strcmp(ValueUnion.psz, "usb")) 1670 1670 { 1671 CHECK_ERROR(machine, COMSETTER(PointingH idType)(PointingHidType_USBMouse));1671 CHECK_ERROR(machine, COMSETTER(PointingHIDType)(PointingHIDType_USBMouse)); 1672 1672 if (SUCCEEDED(rc)) 1673 1673 fEnableUsb = true; … … 1675 1675 else if (!strcmp(ValueUnion.psz, "usbtablet")) 1676 1676 { 1677 CHECK_ERROR(machine, COMSETTER(PointingH idType)(PointingHidType_USBTablet));1677 CHECK_ERROR(machine, COMSETTER(PointingHIDType)(PointingHIDType_USBTablet)); 1678 1678 if (SUCCEEDED(rc)) 1679 1679 fEnableUsb = true; … … 1707 1707 if (!strcmp(ValueUnion.psz, "ps2")) 1708 1708 { 1709 CHECK_ERROR(machine, COMSETTER(KeyboardH idType)(KeyboardHidType_PS2Keyboard));1709 CHECK_ERROR(machine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_PS2Keyboard)); 1710 1710 } 1711 1711 else if (!strcmp(ValueUnion.psz, "usb")) 1712 1712 { 1713 CHECK_ERROR(machine, COMSETTER(KeyboardH idType)(KeyboardHidType_USBKeyboard));1713 CHECK_ERROR(machine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_USBKeyboard)); 1714 1714 if (SUCCEEDED(rc)) 1715 1715 fEnableUsb = true; … … 2229 2229 CHECK_ERROR(machine, COMGETTER(USBController)(UsbCtl.asOutParam())); 2230 2230 if (SUCCEEDED(rc)) 2231 CHECK_ERROR(UsbCtl, COMSETTER(EnabledE hci)(ValueUnion.f));2231 CHECK_ERROR(UsbCtl, COMSETTER(EnabledEHCI)(ValueUnion.f)); 2232 2232 break; 2233 2233 } … … 2355 2355 case MODIFYVM_HPET: 2356 2356 { 2357 CHECK_ERROR(machine, COMSETTER(H petEnabled)(ValueUnion.f));2357 CHECK_ERROR(machine, COMSETTER(HPETEnabled)(ValueUnion.f)); 2358 2358 break; 2359 2359 } … … 2361 2361 case MODIFYVM_IOCACHE: 2362 2362 { 2363 CHECK_ERROR(machine, COMSETTER(I oCacheEnabled)(ValueUnion.f));2363 CHECK_ERROR(machine, COMSETTER(IOCacheEnabled)(ValueUnion.f)); 2364 2364 break; 2365 2365 } … … 2367 2367 case MODIFYVM_IOCACHESIZE: 2368 2368 { 2369 CHECK_ERROR(machine, COMSETTER(I oCacheSize)(ValueUnion.u32));2369 CHECK_ERROR(machine, COMSETTER(IOCacheSize)(ValueUnion.u32)); 2370 2370 break; 2371 2371 } … … 2445 2445 else 2446 2446 { 2447 CHECK_ERROR(machine, AttachHostP ciDevice(iHostAddr, iGuestAddr, TRUE));2447 CHECK_ERROR(machine, AttachHostPCIDevice(iHostAddr, iGuestAddr, TRUE)); 2448 2448 } 2449 2449 … … 2462 2462 else 2463 2463 { 2464 CHECK_ERROR(machine, DetachHostP ciDevice(iHostAddr));2464 CHECK_ERROR(machine, DetachHostPCIDevice(iHostAddr)); 2465 2465 } 2466 2466 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r42538 r42551 649 649 if (pMedium2Mount && (fSetNewUuid || fSetNewParentUuid)) 650 650 { 651 CHECK_ERROR(pMedium2Mount, SetI Ds(fSetNewUuid, bstrNewUuid.raw(),651 CHECK_ERROR(pMedium2Mount, SetIds(fSetNewUuid, bstrNewUuid.raw(), 652 652 fSetNewParentUuid, bstrNewParentUuid.raw())); 653 653 if (FAILED(rc)) -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp
r41819 r42551 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 250 250 else 251 251 { 252 m_pid = m_machine.GetSessionP id();252 m_pid = m_machine.GetSessionPID(); 253 253 /// @todo Remove. See @c todo in #switchTo() below. 254 254 #if 0 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp
r41587 r42551 7 7 8 8 /* 9 * Copyright (C) 2009-201 0Oracle Corporation9 * Copyright (C) 2009-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 323 323 if (data.m_interface.m_fDhcpClientEnabled) 324 324 { 325 iface.EnableDynamicI pConfig();325 iface.EnableDynamicIPConfig(); 326 326 } 327 327 else … … 333 333 QHostAddress(data.m_interface.m_strInterfaceMask).protocol() == QAbstractSocket::IPv4Protocol, 334 334 ("Interface IPv4 network mask must be empty or IPv4-valid!\n")); 335 iface.EnableStaticI pConfig(data.m_interface.m_strInterfaceAddress, data.m_interface.m_strInterfaceMask);335 iface.EnableStaticIPConfig(data.m_interface.m_strInterfaceAddress, data.m_interface.m_strInterfaceMask); 336 336 if (iface.GetIPV6Supported()) 337 337 { … … 339 339 QHostAddress(data.m_interface.m_strInterfaceAddress6).protocol() == QAbstractSocket::IPv6Protocol, 340 340 ("Interface IPv6 address must be empty or IPv6-valid!\n")); 341 iface.EnableStaticI pConfigV6(data.m_interface.m_strInterfaceAddress6, data.m_interface.m_strInterfaceMaskLength6.toULong());341 iface.EnableStaticIPConfigV6(data.m_interface.m_strInterfaceAddress6, data.m_interface.m_strInterfaceMaskLength6.toULong()); 342 342 } 343 343 } … … 554 554 /* Host-only interface settings */ 555 555 data.m_interface.m_strName = iface.GetName(); 556 data.m_interface.m_fDhcpClientEnabled = iface.GetD hcpEnabled();556 data.m_interface.m_fDhcpClientEnabled = iface.GetDHCPEnabled(); 557 557 data.m_interface.m_strInterfaceAddress = iface.GetIPAddress(); 558 558 data.m_interface.m_strInterfaceMask = iface.GetNetworkMask(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r42268 r42551 7 7 8 8 /* 9 * Copyright (C) 2008-201 1Oracle Corporation9 * Copyright (C) 2008-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 790 790 791 791 /* Gather redirect options: */ 792 QVector<QString> redirects = adapter.GetN atDriver().GetRedirects();792 QVector<QString> redirects = adapter.GetNATEngine().GetRedirects(); 793 793 for (int i = 0; i < redirects.size(); ++i) 794 794 { … … 922 922 adapter.SetCableConnected(adapterData.m_fCableConnected); 923 923 /* Redirect options: */ 924 QVector<QString> oldRedirects = adapter.GetN atDriver().GetRedirects();924 QVector<QString> oldRedirects = adapter.GetNATEngine().GetRedirects(); 925 925 for (int i = 0; i < oldRedirects.size(); ++i) 926 adapter.GetN atDriver().RemoveRedirect(oldRedirects[i].section(',', 0, 0));926 adapter.GetNATEngine().RemoveRedirect(oldRedirects[i].section(',', 0, 0)); 927 927 UIPortForwardingDataList newRedirects = adapterData.m_redirects; 928 928 for (int i = 0; i < newRedirects.size(); ++i) 929 929 { 930 930 UIPortForwardingData newRedirect = newRedirects[i]; 931 adapter.GetN atDriver().AddRedirect(newRedirect.name, newRedirect.protocol,931 adapter.GetNATEngine().AddRedirect(newRedirect.name, newRedirect.protocol, 932 932 newRedirect.hostIp, newRedirect.hostPort.value(), 933 933 newRedirect.guestIp, newRedirect.guestPort.value()); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r41819 r42551 7 7 8 8 /* 9 * Copyright (C) 2008-201 1Oracle Corporation9 * Copyright (C) 2008-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 238 238 systemData.m_fEFIEnabled = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL; 239 239 systemData.m_fUTCEnabled = m_machine.GetRTCUseUTC(); 240 systemData.m_fUseAbsHID = m_machine.GetPointingH idType() == KPointingHidType_USBTablet;240 systemData.m_fUseAbsHID = m_machine.GetPointingHIDType() == KPointingHIDType_USBTablet; 241 241 systemData.m_fPAEEnabled = m_machine.GetCPUProperty(KCPUPropertyType_PAE); 242 242 systemData.m_fHwVirtExEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled); … … 363 363 m_machine.SetFirmwareType(systemData.m_fEFIEnabled ? KFirmwareType_EFI : KFirmwareType_BIOS); 364 364 m_machine.SetRTCUseUTC(systemData.m_fUTCEnabled); 365 m_machine.SetPointingH idType(systemData.m_fUseAbsHID ? KPointingHidType_USBTablet : KPointingHidType_PS2Mouse);365 m_machine.SetPointingHIDType(systemData.m_fUseAbsHID ? KPointingHIDType_USBTablet : KPointingHIDType_PS2Mouse); 366 366 /* Processor tab: */ 367 367 m_machine.SetCPUCount(systemData.m_cCPUCount); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r41819 r42551 7 7 8 8 /* 9 * Copyright (C) 2006-201 1Oracle Corporation9 * Copyright (C) 2006-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 309 309 /* Gather USB values: */ 310 310 usbData.m_fUSBEnabled = controller.GetEnabled(); 311 usbData.m_fEHCIEnabled = controller.GetEnabledE hci();311 usbData.m_fEHCIEnabled = controller.GetEnabledEHCI(); 312 312 313 313 /* For each USB filter: */ … … 506 506 { 507 507 controller.SetEnabled(usbData.m_fUSBEnabled); 508 controller.SetEnabledE hci(usbData.m_fEHCIEnabled);508 controller.SetEnabledEHCI(usbData.m_fEHCIEnabled); 509 509 } 510 510 /* Store USB filters data: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRun.cpp
r41615 r42551 49 49 const CGuestOSType &osType = vbox.GetGuestOSType(m_machine.GetOSTypeId()); 50 50 /* Determine recommended controller's 'bus' & 'type': */ 51 KStorageBus dvdCtrBus = osType.GetRecommendedD vdStorageBus();52 KStorageControllerType dvdCtrType = osType.GetRecommendedD vdStorageController();51 KStorageBus dvdCtrBus = osType.GetRecommendedDVDStorageBus(); 52 KStorageControllerType dvdCtrType = osType.GetRecommendedDVDStorageController(); 53 53 /* Declare null 'dvd' attachment: */ 54 54 CMediumAttachment cda; … … 132 132 const CGuestOSType &osType = vbox.GetGuestOSType(machine.GetOSTypeId()); 133 133 /* Determine recommended controller's 'bus' & 'type': */ 134 KStorageBus hdCtrBus = osType.GetRecommendedH dStorageBus();135 KStorageControllerType hdCtrType = osType.GetRecommendedH dStorageController();134 KStorageBus hdCtrBus = osType.GetRecommendedHDStorageBus(); 135 KStorageControllerType hdCtrType = osType.GetRecommendedHDStorageController(); 136 136 /* Enumerate attachments vector: */ 137 137 const CMediumAttachmentVector &attachments = machine.GetMediumAttachments(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r42129 r42551 91 91 /* Enable the OHCI and EHCI controller by default for new VMs. (new in 2.2): */ 92 92 CUSBController usbController = m_machine.GetUSBController(); 93 if (!usbController.isNull() && type.GetRecommendedU sb() && usbController.GetProxyAvailable())93 if (!usbController.isNull() && type.GetRecommendedUSB() && usbController.GetProxyAvailable()) 94 94 { 95 95 usbController.SetEnabled(true); … … 101 101 CExtPackManager manager = vboxGlobal().virtualBox().GetExtensionPackManager(); 102 102 if (manager.IsExtPackUsable(GUI_ExtPackName)) 103 usbController.SetEnabledE hci(true);103 usbController.SetEnabledEHCI(true); 104 104 } 105 105 … … 114 114 115 115 /* Create recommended DVD storage controller: */ 116 KStorageBus strD vdBus = type.GetRecommendedDvdStorageBus();117 QString strD vdName = getNextControllerName(strDvdBus);118 m_machine.AddStorageController(strD vdName, strDvdBus);116 KStorageBus strDVDBus = type.GetRecommendedDVDStorageBus(); 117 QString strDVDName = getNextControllerName(strDVDBus); 118 m_machine.AddStorageController(strDVDName, strDVDBus); 119 119 120 120 /* Set recommended DVD storage controller type: */ 121 CStorageController dvdCtr = m_machine.GetStorageControllerByName(strD vdName);122 KStorageControllerType dvdStorageControllerType = type.GetRecommendedD vdStorageController();121 CStorageController dvdCtr = m_machine.GetStorageControllerByName(strDVDName); 122 KStorageControllerType dvdStorageControllerType = type.GetRecommendedDVDStorageController(); 123 123 dvdCtr.SetControllerType(dvdStorageControllerType); 124 124 125 125 /* Create recommended HD storage controller if it's not the same as the DVD controller: */ 126 KStorageBus ctrH dBus = type.GetRecommendedHdStorageBus();127 KStorageControllerType hdStorageControllerType = type.GetRecommendedH dStorageController();126 KStorageBus ctrHDBus = type.GetRecommendedHDStorageBus(); 127 KStorageControllerType hdStorageControllerType = type.GetRecommendedHDStorageController(); 128 128 CStorageController hdCtr; 129 QString strH dName;130 if (ctrH dBus != strDvdBus || hdStorageControllerType != dvdStorageControllerType)131 { 132 strH dName = getNextControllerName(ctrHdBus);133 m_machine.AddStorageController(strH dName, ctrHdBus);134 hdCtr = m_machine.GetStorageControllerByName(strH dName);129 QString strHDName; 130 if (ctrHDBus != strDVDBus || hdStorageControllerType != dvdStorageControllerType) 131 { 132 strHDName = getNextControllerName(ctrHDBus); 133 m_machine.AddStorageController(strHDName, ctrHDBus); 134 hdCtr = m_machine.GetStorageControllerByName(strHDName); 135 135 hdCtr.SetControllerType(hdStorageControllerType); 136 136 … … 143 143 /* The HD controller is the same as DVD: */ 144 144 hdCtr = dvdCtr; 145 strH dName = strDvdName;145 strHDName = strDVDName; 146 146 } 147 147 148 148 /* Turn on PAE, if recommended: */ 149 m_machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedP ae());149 m_machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedPAE()); 150 150 151 151 /* Set recommended firmware type: */ … … 154 154 155 155 /* Set recommended human interface device types: */ 156 if (type.GetRecommendedU sbHid())157 { 158 m_machine.SetKeyboardH idType(KKeyboardHidType_USBKeyboard);159 m_machine.SetPointingH idType(KPointingHidType_USBMouse);156 if (type.GetRecommendedUSBHID()) 157 { 158 m_machine.SetKeyboardHIDType(KKeyboardHIDType_USBKeyboard); 159 m_machine.SetPointingHIDType(KPointingHIDType_USBMouse); 160 160 if (!usbController.isNull()) 161 161 usbController.SetEnabled(true); 162 162 } 163 163 164 if (type.GetRecommendedU sbTablet())165 { 166 m_machine.SetPointingH idType(KPointingHidType_USBTablet);164 if (type.GetRecommendedUSBTablet()) 165 { 166 m_machine.SetPointingHIDType(KPointingHIDType_USBTablet); 167 167 if (!usbController.isNull()) 168 168 usbController.SetEnabled(true); … … 170 170 171 171 /* Set HPET flag: */ 172 m_machine.SetH petEnabled(type.GetRecommendedHpet());172 m_machine.SetHPETEnabled(type.GetRecommendedHPET()); 173 173 174 174 /* Set UTC flags: */ 175 m_machine.SetRTCUseUTC(type.GetRecommendedR tcUseUtc());175 m_machine.SetRTCUseUTC(type.GetRecommendedRTCUseUTC()); 176 176 177 177 /* Set graphic bits: */ … … 205 205 UIMedium vmedium = vboxGlobal().findMedium(strId); 206 206 CMedium medium = vmedium.medium(); // @todo r=dj can this be cached somewhere? 207 machine.AttachDevice(strH dName, 0, 0, KDeviceType_HardDisk, medium);207 machine.AttachDevice(strHDName, 0, 0, KDeviceType_HardDisk, medium); 208 208 if (!machine.isOk()) 209 209 msgCenter().cannotAttachDevice(machine, UIMediumType_HardDisk, field("virtualDiskLocation").toString(), 210 StorageSlot(ctrH dBus, 0, 0), this);210 StorageSlot(ctrHDBus, 0, 0), this); 211 211 } 212 212 213 213 /* Attach empty CD/DVD ROM Device */ 214 machine.AttachDevice(strD vdName, 1, 0, KDeviceType_DVD, CMedium());214 machine.AttachDevice(strDVDName, 1, 0, KDeviceType_DVD, CMedium()); 215 215 if (!machine.isOk()) 216 msgCenter().cannotAttachDevice(machine, UIMediumType_DVD, QString(), StorageSlot(strD vdBus, 1, 0), this);216 msgCenter().cannotAttachDevice(machine, UIMediumType_DVD, QString(), StorageSlot(strDVDBus, 1, 0), this); 217 217 218 218
Note:
See TracChangeset
for help on using the changeset viewer.