~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Frontends/VBoxManage/VBoxManage.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-13 23:06:00 UTC
  • mfrom: (0.3.2 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091013230600-xhu2pwizq0wo63l9
Tags: 3.0.8-dfsg-1ubuntu1
* Merge from debian unstable (LP: #444812), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
* Try to remove existing dkms modules before adding the new modules
  (LP: #434503)
  - debian/virtualbox-ose-source.postinst
  - debian/virtualbox-ose-guest-source.postinst
* Don't fail if dkms modules have already been removed
  - debian/virtualbox-ose-source.prerm
  - debian/virtualbox-ose-guest-source.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
520
520
        Bstr env;
521
521
#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
522
522
        /* make sure the VM process will start on the same display as VBoxManage */
523
 
        {
524
 
            const char *display = RTEnvGet ("DISPLAY");
525
 
            if (display)
526
 
                env = Utf8StrFmt ("DISPLAY=%s", display);
527
 
        }
 
523
        Utf8Str str;
 
524
        const char *pszDisplay = RTEnvGet("DISPLAY");
 
525
        if (pszDisplay)
 
526
            str = Utf8StrFmt("DISPLAY=%s\n", pszDisplay);
 
527
        const char *pszXAuth = RTEnvGet("XAUTHORITY");
 
528
        if (pszXAuth)
 
529
            str.append(Utf8StrFmt("XAUTHORITY=%s\n", pszXAuth));
 
530
        env = str;
528
531
#endif
529
532
        ComPtr<IProgress> progress;
530
533
        CHECK_ERROR_RET(a->virtualBox, OpenRemoteSession(a->session, uuid, sessionType,
890
893
                }
891
894
            }
892
895
        }
 
896
        else if (!strcmp(a->argv[1], "vrdpport"))
 
897
        {
 
898
            if (a->argc <= 1 + 1)
 
899
            {
 
900
                errorArgument("Missing argument to '%s'", a->argv[1]);
 
901
                rc = E_FAIL;
 
902
                break;
 
903
            }
 
904
            /* get the corresponding VRDP server */
 
905
            ComPtr<IVRDPServer> vrdpServer;
 
906
            sessionMachine->COMGETTER(VRDPServer)(vrdpServer.asOutParam());
 
907
            ASSERT(vrdpServer);
 
908
            if (vrdpServer)
 
909
            {
 
910
                uint16_t vrdpport;
 
911
 
 
912
                if (!strcmp(a->argv[2], "default"))
 
913
                {
 
914
                    vrdpport = 0;
 
915
                }
 
916
                else
 
917
                {
 
918
                    int vrc = RTStrToUInt16Full(a->argv[2], 0, &vrdpport);
 
919
 
 
920
                    if (vrc != VINF_SUCCESS)
 
921
                    {
 
922
                        vrdpport = UINT16_MAX;
 
923
                    }
 
924
                }
 
925
 
 
926
                if (vrdpport != UINT16_MAX)
 
927
                {
 
928
                    CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Port)(vrdpport));
 
929
                }
 
930
                else
 
931
                {
 
932
                    errorArgument("Invalid vrdp server port '%s'", Utf8Str(a->argv[2]).raw());
 
933
                    rc = E_FAIL;
 
934
                    break;
 
935
                }
 
936
            }
 
937
        }
893
938
#endif /* VBOX_WITH_VRDP */
894
939
        else if (   !strcmp (a->argv[1], "usbattach")
895
940
                 || !strcmp (a->argv[1], "usbdetach"))