Changeset 24493 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 9, 2009 11:59:49 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r24441 r24493 2745 2745 * 2746 2746 * @param aMediumAttachment The medium attachment with the new medium state. 2747 * @param fForce Force medium chance, if it is locked or not. 2747 2748 * 2748 2749 * @note Locks this object for writing. 2749 2750 */ 2750 HRESULT Console::doMediumChange(IMediumAttachment *aMediumAttachment )2751 HRESULT Console::doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce) 2751 2752 { 2752 2753 AutoCaller autoCaller(this); … … 2820 2821 PVMREQ pReq; 2821 2822 int vrc = VMR3ReqCall(mpVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 2822 (PFNRT)Console::changeDrive, 8,2823 this, pszDevice, uInstance, uLun, !!fHostDrive, location.raw(), format.raw(), !!fPassthrough );2823 (PFNRT)Console::changeDrive, 9, 2824 this, pszDevice, uInstance, uLun, !!fHostDrive, location.raw(), format.raw(), !!fPassthrough, fForce); 2824 2825 2825 2826 /* leave the lock before waiting for a result (EMT will call us back!) */ … … 2873 2874 */ 2874 2875 DECLCALLBACK(int) Console::changeDrive(Console *pThis, const char *pszDevice, unsigned uInstance, unsigned uLun, 2875 bool fHostDrive, const char *pszPath, const char *pszFormat, bool fPassthrough )2876 bool fHostDrive, const char *pszPath, const char *pszFormat, bool fPassthrough, bool fForce) 2876 2877 { 2877 2878 /// @todo change this to use the same code as in ConsoleImpl2.cpp 2878 LogFlowFunc(("pThis=%p pszDevice=%p:{%s} uInstance=%u uLun=%u fHostDrive=%d pszPath=%p:{%s} pszFormat=%p:{%s} fPassthrough=%d \n",2879 pThis, pszDevice, pszDevice, uInstance, uLun, fHostDrive, pszPath, pszPath, pszFormat, pszFormat, fPassthrough ));2879 LogFlowFunc(("pThis=%p pszDevice=%p:{%s} uInstance=%u uLun=%u fHostDrive=%d pszPath=%p:{%s} pszFormat=%p:{%s} fPassthrough=%d fForce=%d\n", 2880 pThis, pszDevice, pszDevice, uInstance, uLun, fHostDrive, pszPath, pszPath, pszFormat, pszFormat, fPassthrough, fForce)); 2880 2881 2881 2882 AssertReturn(pThis, VERR_INVALID_PARAMETER); … … 2962 2963 * Unmount the media. 2963 2964 */ 2964 rc = pIMount->pfnUnmount(pIMount, f alse);2965 rc = pIMount->pfnUnmount(pIMount, fForce); 2965 2966 if (rc == VERR_PDM_MEDIA_NOT_MOUNTED) 2966 2967 rc = VINF_SUCCESS; … … 3526 3527 * @note Locks this object for writing. 3527 3528 */ 3528 HRESULT Console::onMediumChange(IMediumAttachment *aMediumAttachment )3529 HRESULT Console::onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce) 3529 3530 { 3530 3531 LogFlowThisFunc(("\n")); … … 3545 3546 CheckComRCReturnRC(autoVMCaller.rc()); 3546 3547 3547 rc = doMediumChange(aMediumAttachment );3548 rc = doMediumChange(aMediumAttachment, !!aForce); 3548 3549 3549 3550 /* notify console callbacks on success */ -
trunk/src/VBox/Main/MachineImpl.cpp
r24490 r24493 2797 2797 LONG aControllerPort, 2798 2798 LONG aDevice, 2799 IN_BSTR aId) 2799 IN_BSTR aId, 2800 BOOL aForce) 2800 2801 { 2801 2802 int rc = S_OK; 2802 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld \n",2803 aControllerName, aControllerPort, aDevice ));2803 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld aForce=%d\n", 2804 aControllerName, aControllerPort, aDevice, aForce)); 2804 2805 2805 2806 CheckComArgNotNull(aControllerName); … … 2897 2898 2898 2899 alock.unlock(); 2899 onMediumChange(pAttach );2900 onMediumChange(pAttach, aForce); 2900 2901 2901 2902 return rc; … … 9214 9215 * @note Locks this object for reading. 9215 9216 */ 9216 HRESULT SessionMachine::onMediumChange(IMediumAttachment *aAttachment )9217 HRESULT SessionMachine::onMediumChange(IMediumAttachment *aAttachment, BOOL aForce) 9217 9218 { 9218 9219 LogFlowThisFunc(("\n")); … … 9231 9232 return S_OK; 9232 9233 9233 return directControl->OnMediumChange(aAttachment );9234 return directControl->OnMediumChange(aAttachment, aForce); 9234 9235 } 9235 9236 -
trunk/src/VBox/Main/SessionImpl.cpp
r24079 r24493 558 558 } 559 559 560 STDMETHODIMP Session::OnMediumChange(IMediumAttachment *aMediumAttachment )560 STDMETHODIMP Session::OnMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce) 561 561 { 562 562 LogFlowThisFunc(("\n")); … … 569 569 AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 570 570 571 return mConsole->onMediumChange(aMediumAttachment );571 return mConsole->onMediumChange(aMediumAttachment, aForce); 572 572 } 573 573 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r24490 r24493 4097 4097 <interface 4098 4098 name="IMachine" extends="$unknown" 4099 uuid=" 25472915-3da2-42f6-82f2-70a3bc74d73c"4099 uuid="c5669e1a-491a-4367-99c6-28110dd474c6" 4100 4100 wsmap="managed" 4101 4101 > … … 4884 4884 currently mounted medium.</desc> 4885 4885 </param> 4886 <param name="force" type="boolean" dir="in"> 4887 <desc>Allows to force unmount/mount of a medium which is locked by 4888 theDevice slot in the given port to attach the medium to.</desc> 4889 </param> 4886 4890 </method> 4887 4891 … … 12510 12514 <interface 12511 12515 name="IInternalSessionControl" extends="$unknown" 12512 uuid=" 989e2c33-8dfa-437a-9a15-5ad441d50dbf"12516 uuid="f9aac6d0-41b3-46b7-bea4-6370b4036de6" 12513 12517 internal="yes" 12514 12518 wsmap="suppress" … … 12675 12679 12676 12680 <param name="mediumAttachment" type="IMediumAttachment" dir="in"/> 12681 <param name="force" type="boolean" dir="in"/> 12677 12682 </method> 12678 12683 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r24353 r24493 178 178 HRESULT onParallelPortChange (IParallelPort *aParallelPort); 179 179 HRESULT onStorageControllerChange (); 180 HRESULT onMediumChange(IMediumAttachment *aMediumAttachment );180 HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce); 181 181 HRESULT onVRDPServerChange(); 182 182 HRESULT onUSBControllerChange(); … … 441 441 unsigned uInstance, unsigned uLun, 442 442 bool fHostDrive, const char *pszPath, 443 const char *pszFormat, bool fPassthrough); 443 const char *pszFormat, bool fPassthrough, 444 bool fForce); 444 445 const char *controllerTypeToDev(StorageControllerType_T enmCtrlType); 445 446 HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun); 446 HRESULT doMediumChange(IMediumAttachment *aMediumAttachment );447 HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce); 447 448 448 449 #ifdef VBOX_DYNAMIC_NET_ATTACH -
trunk/src/VBox/Main/include/MachineImpl.h
r24490 r24493 586 586 STDMETHOD(PassthroughDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aPassthrough); 587 587 STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort, 588 LONG aDevice, IN_BSTR aId );588 LONG aDevice, IN_BSTR aId, BOOL aForce); 589 589 STDMETHOD(GetMedium)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, 590 590 IMedium **aMedium); … … 701 701 virtual HRESULT onUSBControllerChange() { return S_OK; } 702 702 virtual HRESULT onStorageControllerChange() { return S_OK; } 703 virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */ ) { return S_OK; }703 virtual HRESULT onMediumChange(IMediumAttachment * /* mediumAttachment */, BOOL /* force */) { return S_OK; } 704 704 virtual HRESULT onSharedFolderChange() { return S_OK; } 705 705 … … 1008 1008 HRESULT onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter); 1009 1009 HRESULT onStorageControllerChange(); 1010 HRESULT onMediumChange(IMediumAttachment *aMediumAttachment );1010 HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce); 1011 1011 HRESULT onSerialPortChange(ISerialPort *serialPort); 1012 1012 HRESULT onParallelPortChange(IParallelPort *parallelPort); -
trunk/src/VBox/Main/include/SessionImpl.h
r23223 r24493 95 95 STDMETHOD(OnParallelPortChange)(IParallelPort *parallelPort); 96 96 STDMETHOD(OnStorageControllerChange)(); 97 STDMETHOD(OnMediumChange)(IMediumAttachment *aMediumAttachment );97 STDMETHOD(OnMediumChange)(IMediumAttachment *aMediumAttachment, BOOL aForce); 98 98 STDMETHOD(OnVRDPServerChange)(); 99 99 STDMETHOD(OnUSBControllerChange)();
Note:
See TracChangeset
for help on using the changeset viewer.