Changeset 64434 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Oct 27, 2016 11:38:06 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111563
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r64315 r64434 950 950 RTStrmPrintf(pStrm, "|headless|separate]\n"); 951 951 RTStrmPrintf(pStrm, 952 " [-E|--putenv <NAME>[=<VALUE>]]\n" 952 953 "\n"); 953 954 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r62493 r64434 496 496 std::list<const char *> VMs; 497 497 Bstr sessionType; 498 Utf8Str strEnv; 499 500 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 501 /* make sure the VM process will by default start on the same display as VBoxManage */ 502 { 503 const char *pszDisplay = RTEnvGet("DISPLAY"); 504 if (pszDisplay) 505 strEnv = Utf8StrFmt("DISPLAY=%s\n", pszDisplay); 506 const char *pszXAuth = RTEnvGet("XAUTHORITY"); 507 if (pszXAuth) 508 strEnv.append(Utf8StrFmt("XAUTHORITY=%s\n", pszXAuth)); 509 } 510 #endif 498 511 499 512 static const RTGETOPTDEF s_aStartVMOptions[] = … … 501 514 { "--type", 't', RTGETOPT_REQ_STRING }, 502 515 { "-type", 't', RTGETOPT_REQ_STRING }, // deprecated 516 { "--putenv", 'E', RTGETOPT_REQ_STRING }, 503 517 }; 504 518 int c; … … 537 551 break; 538 552 553 case 'E': // --putenv 554 if (!RTStrStr(ValueUnion.psz, "\n")) 555 strEnv.append(Utf8StrFmt("%s\n", ValueUnion.psz)); 556 else 557 return errorSyntax(USAGE_STARTVM, "Parameter to option --putenv must not contain any newline character"); 558 break; 559 539 560 case VINF_GETOPT_NOT_OPTION: 540 561 VMs.push_back(ValueUnion.psz); … … 573 594 if (machine) 574 595 { 575 Bstr env;576 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)577 /* make sure the VM process will start on the same display as VBoxManage */578 Utf8Str str;579 const char *pszDisplay = RTEnvGet("DISPLAY");580 if (pszDisplay)581 str = Utf8StrFmt("DISPLAY=%s\n", pszDisplay);582 const char *pszXAuth = RTEnvGet("XAUTHORITY");583 if (pszXAuth)584 str.append(Utf8StrFmt("XAUTHORITY=%s\n", pszXAuth));585 env = str;586 #endif587 596 ComPtr<IProgress> progress; 588 597 CHECK_ERROR(machine, LaunchVMProcess(a->session, sessionType.raw(), 589 env.raw(), progress.asOutParam()));598 Bstr(strEnv).raw(), progress.asOutParam())); 590 599 if (SUCCEEDED(rc) && !progress.isNull()) 591 600 {
Note:
See TracChangeset
for help on using the changeset viewer.