Changeset 49976 in vbox
- Timestamp:
- Dec 18, 2013 2:58:43 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
include/MachineImpl.h (modified) (1 diff)
-
src-server/ClientWatcher.cpp (modified) (5 diffs)
-
src-server/MachineImpl.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MachineImpl.h
r49644 r49976 791 791 { return isSessionOpen(aMachine, aControl, true /* aAllowClosing */); } 792 792 793 #ifndef VBOX_WITH_GENERIC_SESSION_WATCHER794 793 bool checkForSpawnFailure(); 795 #endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */796 794 797 795 HRESULT prepareRegister(); -
trunk/src/VBox/Main/src-server/ClientWatcher.cpp
r48561 r49976 692 692 #elif defined(VBOX_WITH_GENERIC_SESSION_WATCHER) 693 693 694 bool update = false;695 694 bool updateSpawned = false; 696 695 … … 733 732 break; 734 733 735 if (RT_SUCCESS(rc) || update || updateSpawned) 734 /** @todo this quite big effort for catching machines in spawning 735 * state which can't be caught by the token mechanism (as the token 736 * can't be in the other process yet) could be eliminated if the 737 * reaping is made smarter, having cross-reference information 738 * from the pid to the corresponding machine object. Both cases do 739 * more or less the same thing anyway. */ 740 if (RT_SUCCESS(rc) || updateSpawned) 736 741 { 737 742 /* RT_SUCCESS(rc) means an update event is signaled */ 738 743 739 #if 0740 744 // get reference to the machines list in VirtualBox 741 745 VirtualBox::MachinesOList &allMachines = that->mVirtualBox->getMachinesList(); … … 744 748 AutoReadLock thatLock(allMachines.getLockHandle() COMMA_LOCKVAL_SRC_POS); 745 749 746 if (RT_SUCCESS(rc) || update )747 { 748 /* obtain a new set of opened machines */749 machines.clear();750 if (RT_SUCCESS(rc) || updateSpawned) 751 { 752 /* obtain a new set of spawned machines */ 753 spawnedMachines.clear(); 750 754 751 755 for (MachinesOList::iterator it = allMachines.begin(); … … 753 757 ++it) 754 758 { 755 ComObjPtr<SessionMachine> sm;756 if ((*it)->isSessionOpenOrClosing(sm))757 machines.push_back(sm);758 }759 760 cnt = machines.size();761 LogFlowFunc(("UPDATE: direct session count = %d\n", cnt));762 }763 764 if (RT_SUCCESS(rc) || updateSpawned)765 {766 /* obtain a new set of spawned machines */767 spawnedMachines.clear();768 769 for (MachinesOList::iterator it = allMachines.begin();770 it != allMachines.end();771 ++it)772 {773 759 if ((*it)->isSessionSpawning()) 774 760 spawnedMachines.push_back(*it); … … 779 765 } 780 766 767 NOREF(cnt); 781 768 // machines lock unwinds here 782 #else 783 NOREF(cnt); 784 #endif 785 } 786 787 #if 0 788 update = false; 789 for (size_t i = 0; i < cnt; ++i) 790 update |= (machines[i])->checkForDeath(); 769 } 791 770 792 771 updateSpawned = false; 793 772 for (size_t i = 0; i < cntSpawned; ++i) 794 773 updateSpawned |= (spawnedMachines[i])->checkForSpawnFailure(); 795 #else796 NOREF(cntSpawned);797 #endif798 774 799 775 /* reap child processes */ -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r49960 r49976 8213 8213 /* restore the session state */ 8214 8214 mData->mSession.mState = SessionState_Unlocked; 8215 alock.release(); 8216 mParent->addProcessToReap(pid); 8215 8217 /* The failure may occur w/o any error info (from RPC), so provide one */ 8216 8218 return setError(VBOX_E_VM_ERROR, … … 8225 8227 mData->mSession.mState = SessionState_Spawning; 8226 8228 mData->mSession.mType = strFrontend; 8229 8230 alock.release(); 8231 mParent->addProcessToReap(pid); 8227 8232 8228 8233 LogFlowThisFuncLeave(); … … 8296 8301 } 8297 8302 8298 #ifndef VBOX_WITH_GENERIC_SESSION_WATCHER8299 8303 /** 8300 8304 * Called from the client watcher thread to check for unexpected client process … … 8390 8394 return false; 8391 8395 } 8392 #endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */8393 8396 8394 8397 /** … … 12985 12988 12986 12989 // we need to lock this object in uninit() because the lock is shared 12987 // with mPeer (as well as data we modify below). mParent ->addProcessToReap()12988 // and others need mParent lock, and USB needs host lock.12990 // with mPeer (as well as data we modify below). mParent lock is needed 12991 // by several calls to it, and USB needs host lock. 12989 12992 AutoMultiWriteLock3 multilock(mParent, mParent->host(), this COMMA_LOCKVAL_SRC_POS); 12990 12993 … … 13045 13048 mConsoleTaskData.mSnapshot->uninit(); 13046 13049 releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ ); 13047 }13048 13049 if (!mData->mSession.mType.isEmpty())13050 {13051 /* mType is not null when this machine's process has been started by13052 * Machine::LaunchVMProcess(), therefore it is our child. We13053 * need to queue the PID to reap the process (and avoid zombies on13054 * Linux). */13055 Assert(mData->mSession.mPID != NIL_RTPROCESS);13056 mParent->addProcessToReap(mData->mSession.mPID);13057 13050 } 13058 13051
Note:
See TracChangeset
for help on using the changeset viewer.

