VirtualBox

Changeset 20313 in vbox


Ignore:
Timestamp:
Jun 5, 2009 11:00:32 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48212
Message:

Frontends/VBoxManage, Main/Machine: implement new session type "headless" which suppresses any output. Based on the contribution by Josh Wright.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r20294 r20313  
    462462                }
    463463#endif
     464#ifdef VBOX_WITH_HEADLESS
    464465                else if (!RTStrICmp(ValueUnion.psz, "capture"))
    465466                {
    466467                    sessionType = "capture";
    467468                }
     469                else if (!RTStrICmp(ValueUnion.psz, "headless"))
     470                {
     471                    sessionType = "headless";
     472                }
     473#endif
    468474                else
    469475                    return errorArgument("Invalid session type '%s'", ValueUnion.psz);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r20054 r20313  
    259259    {
    260260        RTPrintf("VBoxManage startvm          <uuid>|<name>\n");
     261        RTPrintf("                            [--type gui");
    261262        if (fVRDP)
    262             RTPrintf("                            [--type gui|vrdp]\n");
     263            RTPrintf(                         "|vrdp");
     264        RTPrintf(                             "|headless]\n");
    263265        RTPrintf("\n");
    264266    }
  • trunk/src/VBox/Main/MachineImpl.cpp

    r20206 r20313  
    38713871    else
    38723872
     3873#ifdef VBOX_WITH_HEADLESS
     3874    if (   type == "headless"
     3875        || type == "capture"
    38733876#ifdef VBOX_WITH_VRDP
    3874     if (type == "vrdp")
     3877        || type == "vrdp"
     3878#endif
     3879       )
    38753880    {
    38763881        const char VBoxVRDP_exe[] = "VBoxHeadless" HOSTSUFF_EXE;
     
    38793884
    38803885        Utf8Str idStr = mData->mUuid.toString();
     3886        /* Leave space for 2 args, as "headless" needs --vrdp off on non-OSE. */
    38813887# ifdef RT_OS_WINDOWS
    3882         const char * args[] = {path, "--startvm", idStr, 0 };
     3888        const char * args[] = {path, "--startvm", idStr, 0, 0, 0 };
    38833889# else
    38843890        Utf8Str name = mUserData->mName;
    3885         const char * args[] = {path, "--comment", name, "--startvm", idStr, 0 };
     3891        const char * args[] = {path, "--comment", name, "--startvm", idStr, 0, 0, 0 };
    38863892# endif
    3887         vrc = RTProcCreate (path, args, env, 0, &pid);
    3888     }
    3889 #else /* !VBOX_WITH_VRDP */
    3890     if (0)
    3891         ;
    3892 #endif /* !VBOX_WITH_VRDP */
    3893 
    3894     else
    3895 
    3896 #ifdef VBOX_WITH_HEADLESS
    3897     if (type == "capture")
    3898     {
    3899         const char VBoxVRDP_exe[] = "VBoxHeadless" HOSTSUFF_EXE;
    3900         Assert (sz >= sizeof (VBoxVRDP_exe));
    3901         strcpy (cmd, VBoxVRDP_exe);
    3902 
    3903         Utf8Str idStr = mData->mUuid.toString();
    3904 # ifdef RT_OS_WINDOWS
    3905         const char * args[] = {path, "--startvm", idStr, "--capture", 0 };
    3906 # else
    3907         Utf8Str name = mUserData->mName;
    3908         const char * args[] = {path, "--comment", name, "--startvm", idStr, "--capture", 0 };
    3909 # endif
     3893#ifdef VBOX_WITH_VRDP
     3894        if (type == "headless")
     3895        {
     3896            unsigned pos = RT_ELEMENTS(args) - 3;
     3897            args[pos++] = "--vrdp";
     3898            args[pos] = "off";
     3899        }
     3900#endif
     3901        if (type == "capture")
     3902        {
     3903            unsigned pos = RT_ELEMENTS(args) - 3;
     3904            args[pos] = "--capture";
     3905        }
    39103906        vrc = RTProcCreate (path, args, env, 0, &pid);
    39113907    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette