Changeset 55800 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 11, 2015 2:09:09 PM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55674 r55800 4170 4170 <interface 4171 4171 name="IMachine" extends="$unknown" 4172 uuid="7 01464d0-7284-42e9-b7b3-894cf31536b7"4172 uuid="77a44043-a68a-4ef9-ac26-e9567b1e6bbc" 4173 4173 wsmap="managed" 4174 4174 wrap-hint-server-addinterfaces="IInternalMachineControl" … … 4670 4670 </attribute> 4671 4671 4672 <attribute name="session Type" type="wstring" readonly="yes">4673 <desc> 4674 Type of the session. If <link to="#sessionState"/> is4672 <attribute name="sessionName" type="wstring" readonly="yes"> 4673 <desc> 4674 Name of the session. If <link to="#sessionState"/> is 4675 4675 Spawning or Locked, this attribute contains the 4676 4676 same value as passed to the 4677 4677 <link to="IMachine::launchVMProcess"/> method in the 4678 @a type parameter. If the session was used with 4679 <link to="IMachine::lockMachine" />, or if 4678 @a name parameter. If the session was established with 4679 <link to="IMachine::lockMachine" />, it is the name of the session 4680 (if set, otherwise empty string). If 4680 4681 <link to="#sessionState"/> is SessionClosed, the value of this 4681 4682 attribute is an empty string. … … 5191 5192 </desc> 5192 5193 </param> 5193 <param name=" type" type="wstring" dir="in">5194 <param name="name" type="wstring" dir="in"> 5194 5195 <desc> 5195 5196 Front-end to use for the new VM process. The following are currently supported: … … 19266 19267 <interface 19267 19268 name="ISession" extends="$unknown" 19268 uuid=" 12F4DCDB-12B2-4EC1-B7CD-DDD9F6C5BF4D"19269 uuid="3d4f472c-aac8-4387-94be-54042bcd8901" 19269 19270 wsmap="managed" 19270 19271 wrap-hint-server-addinterfaces="IInternalSessionControl" … … 19339 19340 </attribute> 19340 19341 19342 <attribute name="name" type="wstring"> 19343 <desc> 19344 Name of this session. Important only for VM sessions, otherwise it 19345 it will be remembered, but not used for anything significant (and can 19346 be left at the empty string which is the default). The value can only 19347 be changed when the session state is SessionState_Unlocked. Make sure 19348 that you use a descriptive name which does not conflict with the VM 19349 process session names: "GUI/Qt", "GUI/SDL" and "headless". 19350 </desc> 19351 </attribute> 19352 19341 19353 <attribute name="machine" type="IMachine" readonly="yes"> 19342 19354 <desc>Machine object associated with this session.</desc> … … 19344 19356 19345 19357 <attribute name="console" type="IConsole" readonly="yes"> 19346 <desc>Console object associated with this session.</desc> 19358 <desc>Console object associated with this session. Only sessions 19359 which locked the machine for a VM process have a non-null console.</desc> 19347 19360 </attribute> 19348 19361 -
trunk/src/VBox/Main/include/MachineImpl.h
r55674 r55800 149 149 SessionState_T mState; 150 150 151 /** Session type string (for indirect sessions) */152 Utf8Str m Type;151 /** Session name string (of the primary session) */ 152 Utf8Str mName; 153 153 154 154 /** Session machine object */ … … 928 928 HRESULT getSettingsModified(BOOL *aSettingsModified); 929 929 HRESULT getSessionState(SessionState_T *aSessionState); 930 HRESULT getSessionType(com::Utf8Str &aSessionType); 930 HRESULT getSessionType(SessionType_T *aSessionType); 931 HRESULT getSessionName(com::Utf8Str &aSessionType); 931 932 HRESULT getSessionPID(ULONG *aSessionPID); 932 933 HRESULT getState(MachineState_T *aState); -
trunk/src/VBox/Main/include/SessionImpl.h
r55401 r55800 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 57 57 HRESULT getState(SessionState_T *aState); 58 58 HRESULT getType(SessionType_T *aType); 59 HRESULT getName(com::Utf8Str &aName); 60 HRESULT setName(const com::Utf8Str &aName); 59 61 HRESULT getMachine(ComPtr<IMachine> &aMachine); 60 62 HRESULT getConsole(ComPtr<IConsole> &aConsole); … … 143 145 SessionState_T mState; 144 146 SessionType_T mType; 147 Utf8Str mName; 145 148 146 149 ComPtr<IInternalMachineControl> mControl; -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r55214 r55800 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 149 149 150 150 *aType = mType; 151 return S_OK; 152 } 153 154 HRESULT Session::getName(com::Utf8Str &aName) 155 { 156 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 157 158 aName = mName; 159 return S_OK; 160 } 161 162 HRESULT Session::setName(const com::Utf8Str &aName) 163 { 164 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 165 166 if (mState != SessionState_Unlocked) 167 return setError(VBOX_E_INVALID_OBJECT_STATE, tr("Trying to set name for a session which is not in state \"unlocked\"")); 168 169 mName = aName; 151 170 return S_OK; 152 171 } -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r55769 r55800 2674 2674 HRESULT Machine::getSessionState(SessionState_T *aSessionState) 2675 2675 { 2676 2677 2676 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2678 2677 … … 2682 2681 } 2683 2682 2684 HRESULT Machine::getSession Type(com::Utf8Str &aSessionType)2683 HRESULT Machine::getSessionName(com::Utf8Str &aSessionName) 2685 2684 { 2686 2685 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2687 2686 2688 aSession Type = mData->mSession.mType;2687 aSessionName = mData->mSession.mName; 2689 2688 2690 2689 return S_OK; … … 3223 3222 E_INVALIDARG); 3224 3223 3224 // session name (only used in some code paths) 3225 Utf8Str strSessionName; 3226 3225 3227 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3226 3228 … … 3437 3439 tr("Failed to assign the machine to the session (%Rhrc)"), rc); 3438 3440 3441 // get session name, either to remember or to compare against 3442 // the already known session name. 3443 { 3444 Bstr bstrSessionName; 3445 HRESULT rc2 = aSession->COMGETTER(Name)(bstrSessionName.asOutParam()); 3446 if (SUCCEEDED(rc2)) 3447 strSessionName = bstrSessionName; 3448 } 3449 3439 3450 if ( SUCCEEDED(rc) 3440 3451 && fLaunchingVMProcess … … 3485 3496 if (fLaunchingVMProcess) 3486 3497 { 3498 Assert(mData->mSession.mName == strSessionName); 3487 3499 /* Note that the progress object is finalized later */ 3488 3500 /** @todo Consider checking mData->mSession.mProgress for cancellation … … 3522 3534 mData->mSession.mDirectControl = pSessionControl; 3523 3535 mData->mSession.mState = SessionState_Locked; 3536 if (!fLaunchingVMProcess) 3537 mData->mSession.mName = strSessionName; 3524 3538 /* associate the SessionMachine with this Machine */ 3525 3539 mData->mSession.mMachine = sessionMachine; … … 3561 3575 */ 3562 3576 HRESULT Machine::launchVMProcess(const ComPtr<ISession> &aSession, 3563 const com::Utf8Str &a Type,3577 const com::Utf8Str &aName, 3564 3578 const com::Utf8Str &aEnvironment, 3565 3579 ComPtr<IProgress> &aProgress) 3566 3580 { 3567 Utf8Str strFrontend(a Type);3581 Utf8Str strFrontend(aName); 3568 3582 /* "emergencystop" doesn't need the session, so skip the checks/interface 3569 3583 * retrieval. This code doesn't quite fit in here, but introducing a … … 7430 7444 if (fSeparate) 7431 7445 { 7432 if (mData->mSession.mState != SessionState_Unlocked && mData->mSession.m Type.compare("headless", Utf8Str::CaseInsensitive))7446 if (mData->mSession.mState != SessionState_Unlocked && mData->mSession.mName == "headless") 7433 7447 return setError(VBOX_E_INVALID_OBJECT_STATE, 7434 7448 tr("The machine '%s' is in a state which is incompatible with launching a separate UI process"), … … 7531 7545 #endif 7532 7546 7547 Utf8Str strCanonicalName; 7533 7548 7534 7549 #ifdef VBOX_WITH_QTGUI … … 7539 7554 || !strFrontend.compare("GUI/Qt/separate", Utf8Str::CaseInsensitive)) 7540 7555 { 7556 strCanonicalName = "GUI/Qt"; 7541 7557 # ifdef RT_OS_DARWIN /* Avoid Launch Services confusing this with the selector by using a helper app. */ 7542 7558 /* Modify the base path so that we don't need to use ".." below. */ … … 7607 7623 || !strFrontend.compare("GUI/SDL/separate", Utf8Str::CaseInsensitive)) 7608 7624 { 7625 strCanonicalName = "GUI/SDL"; 7609 7626 static const char s_szVBoxSDL_exe[] = "VBoxSDL" HOSTSUFF_EXE; 7610 7627 Assert(cchBufLeft >= sizeof(s_szVBoxSDL_exe)); … … 7641 7658 ) 7642 7659 { 7660 strCanonicalName = "headless"; 7643 7661 /* On pre-4.0 the "headless" type was used for passing "--vrdp off" to VBoxHeadless to let it work in OSE, 7644 7662 * which did not contain VRDP server. In VBox 4.0 the remote desktop server (VRDE) is optional, … … 7732 7750 mData->mSession.mPID = pid; 7733 7751 mData->mSession.mState = SessionState_Spawning; 7734 mData->mSession.mType = strFrontend; 7752 Assert(strCanonicalName.isNotEmpty()); 7753 mData->mSession.mName = strCanonicalName; 7735 7754 } 7736 7755 else … … 12654 12673 mData->mSession.mMachine.setNull(); 12655 12674 mData->mSession.mState = SessionState_Unlocked; 12656 mData->mSession.m Type.setNull();12675 mData->mSession.mName.setNull(); 12657 12676 12658 12677 /* destroy the machine client token before leaving the exclusive lock */
Note:
See TracChangeset
for help on using the changeset viewer.