Changeset 42382 in vbox
- Timestamp:
- Jul 25, 2012 9:35:56 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/SDKRef.xml
r42183 r42382 3530 3530 <itemizedlist> 3531 3531 <listitem> 3532 <para>The <xref linkend="LockType" xreflabel="LockType" /> 3533 enumeration now has an additional value <computeroutput>VM</computeroutput> 3534 which tells <xref linkend="IMachine__lockMachine" 3535 xreflabel="IMachine::lockMachine()" /> to create a full-blown 3536 object structure for running a VM. This was the previous behavior 3537 with <computeroutput>Write</computeroutput>, which now only creates 3538 the minimal object structure to save time and resources (at the 3539 moment the Console object is still created, but all sub-objects 3540 such as Display, Keyboard, Mouse, Guest are not.</para> 3541 </listitem> 3542 3543 <listitem> 3532 3544 <para>Machines can be put in groups (actually an array of groups). 3533 3545 The primary group affects the default placement of files belonging -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r41959 r42382 43 43 #include <VBox/VBoxVideo.h> 44 44 45 #ifdef VBOX_WITH_VIDEO_REC 45 #ifdef VBOX_WITH_VIDEO_REC 46 46 #include <cstdlib> 47 47 #include <cerrno> … … 827 827 828 828 // open a session 829 CHECK_ERROR_BREAK(m, LockMachine(session, LockType_ Write));829 CHECK_ERROR_BREAK(m, LockMachine(session, LockType_VM)); 830 830 fSessionOpened = true; 831 831 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r42248 r42382 1415 1415 AssertReleaseRC(vrc); 1416 1416 1417 rc = pMachine->LockMachine(pSession, LockType_ Write);1417 rc = pMachine->LockMachine(pSession, LockType_VM); 1418 1418 if (FAILED(rc)) 1419 1419 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotDetailsDlg.cpp
r41610 r42382 112 112 113 113 /* We need a session when we manipulate the snapshot data of a machine. */ 114 CSession session = vboxGlobal().open Session(mSnapshot.GetMachine().GetId(), true);114 CSession session = vboxGlobal().openExistingSession(mSnapshot.GetMachine().GetId()); 115 115 if (session.isNull()) 116 116 return; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r42209 r42382 469 469 AssertMsg(!m_pVirtualMachine, ("Machine already started")); 470 470 471 /* Create session: */472 CSession session = vboxGlobal().openSession(strMachineId );471 /* Create VM session: */ 472 CSession session = vboxGlobal().openSession(strMachineId, KLockType_VM); 473 473 if (session.isNull()) 474 474 return false; … … 1813 1813 * 1814 1814 * @param aId Machine ID. 1815 * @param aExisting @c true to open an existing session with the machine 1816 * which is already running, @c false to open a new direct 1817 * session. 1818 */ 1819 CSession VBoxGlobal::openSession(const QString &aId, bool aExisting /* = false */) 1815 * @param aLockType @c KLockType_Shared to open an existing session with 1816 * the machine which is already running, @c KLockType_Write 1817 * to open a new direct session, @c KLockType_VM to open 1818 * a new session for running a VM in this process. 1819 */ 1820 CSession VBoxGlobal::openSession(const QString &aId, KLockType aLockType /* = KLockType_Shared */) 1820 1821 { 1821 1822 CSession session; … … 1830 1831 if (!foundMachine.isNull()) 1831 1832 { 1832 foundMachine.LockMachine(session, 1833 (aExisting) ? KLockType_Shared : KLockType_Write); 1833 foundMachine.LockMachine(session, aLockType); 1834 1834 if (session.GetType() == KSessionType_Shared) 1835 1835 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r42209 r42382 239 239 #endif 240 240 241 CSession openSession(const QString &aId, bool aExisting = false);241 CSession openSession(const QString &aId, KLockType aLockType = KLockType_Write); 242 242 243 243 /** Shortcut to openSession (aId, true). */ 244 CSession openExistingSession(const QString &aId) { return openSession (aId, true); }244 CSession openExistingSession(const QString &aId) { return openSession(aId, KLockType_Shared); } 245 245 246 246 void startEnumeratingMedia(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r41819 r42382 645 645 /* Open a direct session (this call will handle all errors) */ 646 646 bool busy = mSessionState != KSessionState_Unlocked; 647 CSession session = vboxGlobal().openSession (mMachineId, busy /* aExisting */); 647 CSession session; 648 if (busy) 649 session = vboxGlobal().openExistingSession(mMachineId); 650 else 651 session = vboxGlobal().openSession(mMachineId); 648 652 if (session.isNull()) 649 653 return; … … 779 783 780 784 /* Open a session to work with corresponding VM: */ 781 CSession session = vboxGlobal().openSession(mMachineId, 782 mSessionState != KSessionState_Unlocked /* connect to existing */); 785 CSession session; 786 if (mSessionState != KSessionState_Unlocked) 787 session = vboxGlobal().openExistingSession(mMachineId); 788 else 789 session = vboxGlobal().openSession(mMachineId); 783 790 fIsValid = !session.isNull(); 784 791 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r41689 r42382 748 748 749 749 /* Prepare session: */ 750 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().open Session(m_strMachineId, true /* shared */);750 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().openExistingSession(m_strMachineId); 751 751 /* Check that session was created: */ 752 752 if (m_session.isNull()) … … 787 787 788 788 /* Prepare session: */ 789 bool fSessionShared = dialogType() != SettingsDialogType_Offline; 790 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().openSession(m_strMachineId, fSessionShared); 789 if (dialogType() == SettingsDialogType_Wrong) 790 m_session = CSession(); 791 else if (dialogType() != SettingsDialogType_Offline) 792 m_session = vboxGlobal().openExistingSession(m_strMachineId); 793 else 794 m_session = vboxGlobal().openSession(m_strMachineId); 791 795 /* Check that session was created: */ 792 796 if (m_session.isNull()) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r42354 r42382 961 961 <enum 962 962 name="LockType" 963 uuid="1 38b53f8-db4b-47c5-b32b-4ef52f769413"963 uuid="168a6a8e-12fd-4878-a1f9-38a750a56089" 964 964 > 965 965 <desc> … … 971 971 <const name="Shared" value="1"> 972 972 <desc>Request only a shared read lock for remote-controlling the machine.</desc> 973 </const> 974 <const name="VM" value="3"> 975 <desc>Lock the machine for writing, and create objects necessary for 976 running a VM in this process.</desc> 973 977 </const> 974 978 </enum> … … 16396 16400 </desc> 16397 16401 <param name="machine" type="IMachine" dir="in"/> 16402 <param name="lockType" type="LockType" dir="in"/> 16398 16403 </method> 16399 16404 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r42261 r42382 114 114 115 115 // public initializers/uninitializers for internal purposes only 116 HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl );116 HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl, LockType_T aLockType); 117 117 void uninit(); 118 118 -
trunk/src/VBox/Main/include/SessionImpl.h
r42261 r42382 81 81 STDMETHOD(GetPID)(ULONG *aPid); 82 82 STDMETHOD(GetRemoteConsole)(IConsole **aConsole); 83 STDMETHOD(AssignMachine)(IMachine *aMachine );83 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType); 84 84 STDMETHOD(AssignRemoteMachine)(IMachine *aMachine, IConsole *aConsole); 85 85 STDMETHOD(UpdateMachineState)(MachineState_T aMachineState); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r42261 r42382 434 434 ///////////////////////////////////////////////////////////////////////////// 435 435 436 HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl )436 HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, LockType_T aLockType) 437 437 { 438 438 AssertReturn(aMachine && aControl, E_INVALIDARG); … … 450 450 unconst(mControl) = aControl; 451 451 452 /* Cache essential properties and objects */452 /* Cache essential properties and objects, and create child objects */ 453 453 454 454 rc = mMachine->COMGETTER(State)(&mMachineState); 455 455 AssertComRCReturnRC(rc); 456 456 457 rc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam()); 458 AssertComRCReturnRC(rc); 459 460 /* Create associated child COM objects */ 457 #ifdef VBOX_WITH_EXTPACK 458 unconst(mptrExtPackManager).createObject(); 459 rc = mptrExtPackManager->initExtPackManager(NULL, VBOXEXTPACKCTX_VM_PROCESS); 460 AssertComRCReturnRC(rc); 461 #endif 461 462 462 463 // Event source may be needed by other children … … 465 466 AssertComRCReturnRC(rc); 466 467 467 unconst(mGuest).createObject();468 rc = mGuest->init(this);469 AssertComRCReturnRC(rc);470 471 unconst(mKeyboard).createObject();472 rc = mKeyboard->init(this);473 AssertComRCReturnRC(rc);474 475 unconst(mMouse).createObject();476 rc = mMouse->init(this);477 AssertComRCReturnRC(rc);478 479 unconst(mDisplay).createObject();480 rc = mDisplay->init(this);481 AssertComRCReturnRC(rc);482 483 unconst(mVRDEServerInfo).createObject();484 rc = mVRDEServerInfo->init(this);485 AssertComRCReturnRC(rc);486 487 #ifdef VBOX_WITH_EXTPACK488 unconst(mptrExtPackManager).createObject();489 rc = mptrExtPackManager->initExtPackManager(NULL, VBOXEXTPACKCTX_VM_PROCESS);490 AssertComRCReturnRC(rc);491 #endif492 493 /* Grab global and machine shared folder lists */494 495 rc = fetchSharedFolders(true /* aGlobal */);496 AssertComRCReturnRC(rc);497 rc = fetchSharedFolders(false /* aGlobal */);498 AssertComRCReturnRC(rc);499 500 /* Create other child objects */501 502 unconst(mConsoleVRDPServer) = new ConsoleVRDPServer(this);503 AssertReturn(mConsoleVRDPServer, E_FAIL);504 505 468 mcAudioRefs = 0; 506 469 mcVRDPClients = 0; … … 508 471 mcGuestCredentialsProvided = false; 509 472 510 /* Figure out size of meAttachmentType vector */ 511 ComPtr<IVirtualBox> pVirtualBox; 512 rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 513 AssertComRC(rc); 514 ComPtr<ISystemProperties> pSystemProperties; 515 if (pVirtualBox) 516 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 517 ChipsetType_T chipsetType = ChipsetType_PIIX3; 518 aMachine->COMGETTER(ChipsetType)(&chipsetType); 519 ULONG maxNetworkAdapters = 0; 520 if (pSystemProperties) 521 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 522 meAttachmentType.resize(maxNetworkAdapters); 523 for (ULONG slot = 0; slot < maxNetworkAdapters; ++slot) 524 meAttachmentType[slot] = NetworkAttachmentType_Null; 525 526 527 // VirtualBox 4.0: We no longer initialize the VMMDev instance here, 528 // which starts the HGCM thread. Instead, this is now done in the 529 // power-up thread when a VM is actually being powered up to avoid 530 // having HGCM threads all over the place every time a session is 531 // opened, even if that session will not run a VM. 532 // unconst(m_pVMMDev) = new VMMDev(this); 533 // AssertReturn(mVMMDev, E_FAIL); 534 535 unconst(mAudioSniffer) = new AudioSniffer(this); 536 AssertReturn(mAudioSniffer, E_FAIL); 473 /* Now the VM specific parts */ 474 if (aLockType == LockType_VM) 475 { 476 rc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam()); 477 AssertComRCReturnRC(rc); 478 479 unconst(mGuest).createObject(); 480 rc = mGuest->init(this); 481 AssertComRCReturnRC(rc); 482 483 unconst(mKeyboard).createObject(); 484 rc = mKeyboard->init(this); 485 AssertComRCReturnRC(rc); 486 487 unconst(mMouse).createObject(); 488 rc = mMouse->init(this); 489 AssertComRCReturnRC(rc); 490 491 unconst(mDisplay).createObject(); 492 rc = mDisplay->init(this); 493 AssertComRCReturnRC(rc); 494 495 unconst(mVRDEServerInfo).createObject(); 496 rc = mVRDEServerInfo->init(this); 497 AssertComRCReturnRC(rc); 498 499 /* Grab global and machine shared folder lists */ 500 501 rc = fetchSharedFolders(true /* aGlobal */); 502 AssertComRCReturnRC(rc); 503 rc = fetchSharedFolders(false /* aGlobal */); 504 AssertComRCReturnRC(rc); 505 506 /* Create other child objects */ 507 508 unconst(mConsoleVRDPServer) = new ConsoleVRDPServer(this); 509 AssertReturn(mConsoleVRDPServer, E_FAIL); 510 511 /* Figure out size of meAttachmentType vector */ 512 ComPtr<IVirtualBox> pVirtualBox; 513 rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 514 AssertComRC(rc); 515 ComPtr<ISystemProperties> pSystemProperties; 516 if (pVirtualBox) 517 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 518 ChipsetType_T chipsetType = ChipsetType_PIIX3; 519 aMachine->COMGETTER(ChipsetType)(&chipsetType); 520 ULONG maxNetworkAdapters = 0; 521 if (pSystemProperties) 522 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 523 meAttachmentType.resize(maxNetworkAdapters); 524 for (ULONG slot = 0; slot < maxNetworkAdapters; ++slot) 525 meAttachmentType[slot] = NetworkAttachmentType_Null; 526 527 // VirtualBox 4.0: We no longer initialize the VMMDev instance here, 528 // which starts the HGCM thread. Instead, this is now done in the 529 // power-up thread when a VM is actually being powered up to avoid 530 // having HGCM threads all over the place every time a session is 531 // opened, even if that session will not run a VM. 532 // unconst(m_pVMMDev) = new VMMDev(this); 533 // AssertReturn(mVMMDev, E_FAIL); 534 535 unconst(mAudioSniffer) = new AudioSniffer(this); 536 AssertReturn(mAudioSniffer, E_FAIL); 537 537 #ifdef VBOX_WITH_USB_VIDEO 538 unconst(mUsbWebcamInterface) = new UsbWebcamInterface(this);539 AssertReturn(mUsbWebcamInterface, E_FAIL);538 unconst(mUsbWebcamInterface) = new UsbWebcamInterface(this); 539 AssertReturn(mUsbWebcamInterface, E_FAIL); 540 540 #endif 541 541 #ifdef VBOX_WITH_USB_CARDREADER 542 unconst(mUsbCardReader) = new UsbCardReader(this);543 AssertReturn(mUsbCardReader, E_FAIL);542 unconst(mUsbCardReader) = new UsbCardReader(this); 543 AssertReturn(mUsbCardReader, E_FAIL); 544 544 #endif 545 545 546 /* VirtualBox events registration. */547 {548 ComPtr<IEventSource> pES;549 rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam());550 AssertComRC(rc);551 ComObjPtr<VmEventListenerImpl> aVmListener;552 aVmListener.createObject();553 aVmListener->init(new VmEventListener(), this);554 mVmListener = aVmListener;555 com::SafeArray<VBoxEventType_T> eventTypes;556 eventTypes.push_back(VBoxEventType_OnNATRedirect);557 eventTypes.push_back(VBoxEventType_OnHostPciDevicePlug);558 rc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true);559 AssertComRC(rc);560 }561 546 /* VirtualBox events registration. */ 547 { 548 ComPtr<IEventSource> pES; 549 rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam()); 550 AssertComRC(rc); 551 ComObjPtr<VmEventListenerImpl> aVmListener; 552 aVmListener.createObject(); 553 aVmListener->init(new VmEventListener(), this); 554 mVmListener = aVmListener; 555 com::SafeArray<VBoxEventType_T> eventTypes; 556 eventTypes.push_back(VBoxEventType_OnNATRedirect); 557 eventTypes.push_back(VBoxEventType_OnHostPciDevicePlug); 558 rc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true); 559 AssertComRC(rc); 560 } 561 } 562 562 563 563 /* Confirm a successful initialization when it's the case */ -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r42261 r42382 300 300 } 301 301 302 STDMETHODIMP Session::AssignMachine(IMachine *aMachine )302 STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType) 303 303 { 304 304 LogFlowThisFuncEnter(); … … 337 337 AssertComRCReturn(rc, rc); 338 338 339 rc = mConsole->init(aMachine, mControl );339 rc = mConsole->init(aMachine, mControl, aLockType); 340 340 AssertComRCReturn(rc, rc); 341 341 … … 358 358 /* some cleanup */ 359 359 mControl.setNull(); 360 mConsole->uninit(); 361 mConsole.setNull(); 360 if (!mConsole.isNull()) 361 { 362 mConsole->uninit(); 363 mConsole.setNull(); 364 } 362 365 } 363 366 … … 531 534 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 532 535 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 536 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 533 537 534 538 return mConsole->onNetworkAdapterChange(networkAdapter, changeAdapter); … … 545 549 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 546 550 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 551 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 547 552 548 553 return mConsole->onSerialPortChange(serialPort); … … 559 564 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 560 565 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 566 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 561 567 562 568 return mConsole->onParallelPortChange(parallelPort); … … 573 579 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 574 580 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 581 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 575 582 576 583 return mConsole->onStorageControllerChange(); … … 587 594 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 588 595 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 596 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 589 597 590 598 return mConsole->onMediumChange(aMediumAttachment, aForce); … … 601 609 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 602 610 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 611 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 603 612 604 613 return mConsole->onCPUChange(aCPU, aRemove); … … 615 624 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 616 625 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 626 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 617 627 618 628 return mConsole->onCPUExecutionCapChange(aExecutionCap); … … 629 639 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 630 640 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 641 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 631 642 632 643 return mConsole->onVRDEServerChange(aRestart); … … 643 654 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 644 655 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 656 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 645 657 646 658 return mConsole->onUSBControllerChange(); … … 657 669 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 658 670 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 671 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 659 672 660 673 return mConsole->onSharedFolderChange(aGlobal); … … 671 684 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 672 685 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 686 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 673 687 674 688 return mConsole->onClipboardModeChange(aClipboardMode); … … 701 715 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 702 716 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 717 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 703 718 704 719 return mConsole->onUSBDeviceAttach(aDevice, aError, aMaskedIfs); … … 716 731 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 717 732 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 733 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 718 734 719 735 return mConsole->onUSBDeviceDetach(aId, aError); … … 728 744 729 745 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 746 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 730 747 731 748 if (mState != SessionState_Locked) … … 753 770 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 754 771 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 772 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 755 773 756 774 return mConsole->onBandwidthGroupChange(aBandwidthGroup); … … 767 785 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 768 786 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 787 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 769 788 770 789 return mConsole->onStorageDeviceChange(aMediumAttachment, aRemove); … … 796 815 if (aIsSetter && (aFlags != NULL) && !VALID_PTR(aFlags)) 797 816 return E_INVALIDARG; 817 818 /* If this session is not in a VM process fend off the call. The caller 819 * handles this correctly, by doing the operation in VBoxSVC. */ 820 if (!mConsole) 821 return E_ACCESSDENIED; 822 798 823 if (!aIsSetter) 799 824 return mConsole->getGuestProperty(aName, aRetValue, aRetTimestamp, aRetFlags); … … 830 855 if (ComSafeArrayOutIsNull(aFlags)) 831 856 return E_POINTER; 857 858 /* If this session is not in a VM process fend off the call. The caller 859 * handles this correctly, by doing the operation in VBoxSVC. */ 860 if (!mConsole) 861 return E_ACCESSDENIED; 862 832 863 return mConsole->enumerateGuestProperties(aPatterns, 833 864 ComSafeArrayOutArg(aNames), … … 856 887 Global::stringifySessionState(mState)); 857 888 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 889 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 858 890 CheckComArgNotNull(aMediumAttachment); 859 891 CheckComArgSafeArrayNotNull(aChildrenToReparent); … … 874 906 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 875 907 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 908 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 876 909 877 910 mConsole->enableVMMStatistics(aEnable); … … 940 973 if (mType == SessionType_WriteLock) 941 974 { 942 mConsole->uninit(); 943 mConsole.setNull(); 975 if (!mConsole.isNull()) 976 { 977 mConsole->uninit(); 978 mConsole.setNull(); 979 } 944 980 } 945 981 else -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r42261 r42382 3304 3304 3305 3305 LogFlowThisFunc(("Calling AssignMachine()...\n")); 3306 rc = pSessionControl->AssignMachine(sessionMachine );3306 rc = pSessionControl->AssignMachine(sessionMachine, lockType); 3307 3307 LogFlowThisFunc(("AssignMachine() returned %08X\n", rc)); 3308 3308 … … 3419 3419 { 3420 3420 /* 3421 * tell the client watcher thread to update the set of3422 * machines that have open sessions3423 */3421 * tell the client watcher thread to update the set of 3422 * machines that have open sessions 3423 */ 3424 3424 mParent->updateClientWatcher(); 3425 3425 … … 7239 7239 /* inform the session that it will be a remote one */ 7240 7240 LogFlowThisFunc(("Calling AssignMachine (NULL)...\n")); 7241 HRESULT rc = aControl->AssignMachine(NULL );7241 HRESULT rc = aControl->AssignMachine(NULL, LockType_Write); 7242 7242 LogFlowThisFunc(("AssignMachine (NULL) returned %08X\n", rc)); 7243 7243
Note:
See TracChangeset
for help on using the changeset viewer.