Changeset 45284 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 2, 2013 11:55:41 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84679
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r45138 r45284 1339 1339 <attribute name="gateway" type="wstring" readonly="yes"> 1340 1340 <desc> 1341 This attribute is read-only. It's recalculated on changing 1341 This attribute is read-only. It's recalculated on changing 1342 1342 network attribute (low address of network + 1). 1343 1343 </desc> … … 1357 1357 <attribute name="eventSource" type="IEventSource" readonly="yes"/> 1358 1358 <attribute name="portForwardRules4" type="wstring" readonly="yes" safearray="yes"> 1359 <desc>Array of NAT port-forwarding rules in string representation, 1360 in the following format: 1359 <desc>Array of NAT port-forwarding rules in string representation, 1360 in the following format: 1361 1361 "name:protocolid:[host ip]:host port:[guest ip]:guest port". 1362 1362 </desc> 1363 1363 </attribute> 1364 1364 <attribute name="portForwardRules6" type="wstring" readonly="yes" safearray="yes"> 1365 <desc>Array of NAT port-forwarding rules in string representation, in the 1365 <desc>Array of NAT port-forwarding rules in string representation, in the 1366 1366 following format: "name:protocolid:[host ip]:host port:[guest ip]:guest port". 1367 1367 </desc> … … 1374 1374 </param> 1375 1375 <param name="hostIP" type="wstring" dir="in"> 1376 <desc>IP of the host interface to which the rule should apply. 1377 An empty ip address is acceptable, in which case the NAT engine 1376 <desc>IP of the host interface to which the rule should apply. 1377 An empty ip address is acceptable, in which case the NAT engine 1378 1378 binds the handling socket to any interface. 1379 1379 </desc> … … 1383 1383 </param> 1384 1384 <param name="guestIP" type="wstring" dir="in"> 1385 <desc>The IP address of the guest which the NAT engine will forward 1385 <desc>The IP address of the guest which the NAT engine will forward 1386 1386 matching packets to. An empty IP address is not acceptable.</desc> 1387 1387 </param> … … 2366 2366 <!-- bunch of metods to create NAT --> 2367 2367 <method name="createNATNetwork"> 2368 <!-- Here we create a record in NAT network array with name 2369 and gateway/network parameters this information should 2370 be enough for VBoxNet[Lwip]NAT and VBoxNetDHCP for 2371 servicing the guests. 2368 <!-- Here we create a record in NAT network array with name 2369 and gateway/network parameters this information should 2370 be enough for VBoxNet[Lwip]NAT and VBoxNetDHCP for 2371 servicing the guests. 2372 2372 --> 2373 2373 <param name="networkName" type="wstring" dir="in"/> 2374 2374 <param name="network" type="INATNetwork" dir="return"/> 2375 2375 </method> 2376 2376 2377 2377 <!-- 2378 2378 Returns the NATNetwork by name, e.g. for adding porforward rule or delition. … … 9135 9135 </const> 9136 9136 </enum> 9137 9137 9138 9138 <enum 9139 9139 name="GuestSessionWaitResult" … … 9146 9146 9147 9147 To wait for a guest session to terminate after it has been 9148 created by <link to="IGuest::createSession"/> one would specify 9148 created by <link to="IGuest::createSession"/> one would specify 9149 9149 GuestSessionWaitResult_Terminate. 9150 9150 </desc> … … 9182 9182 </const> 9183 9183 </enum> 9184 9184 9185 9185 <enum 9186 9186 name="FileSeekType" … … 10410 10410 </param> 10411 10411 </method> 10412 10412 10413 10413 <method name="waitFor"> 10414 10414 <desc> … … 16823 16823 <param name="remove" type="boolean" dir="in"> 16824 16824 <desc>TRUE if the device is removed, FALSE if it was added.</desc> 16825 </param> 16826 <param name="silent" type="boolean" dir="in"> 16827 <desc>TRUE if the device is is silently reconfigured without 16828 notifying the guest about it.</desc> 16825 16829 </param> 16826 16830 </method> … … 20306 20310 <interface 20307 20311 name="IStorageDeviceChangedEvent" extends="IEvent" 20308 uuid=" 8a5c2dce-e341-49d4-afce-c95979f7d70c"20312 uuid="232e9151-ae84-4b8e-b0f3-5c20c35caac9" 20309 20313 wsmap="managed" autogen="VBoxEvent" id="OnStorageDeviceChanged" 20310 20314 > … … 20322 20326 <desc> 20323 20327 Flag whether the device was removed or added to the VM. 20328 </desc> 20329 </attribute> 20330 <attribute name="silent" type="boolean" readonly="yes"> 20331 <desc> 20332 Flag whether the guest should be notified about the change. 20324 20333 </desc> 20325 20334 </attribute> … … 20335 20344 <!-- base class for start/stop events --> 20336 20345 <interface name="INATNetworkStartStopEvent" extends="INATNetworkChangedEvent" 20337 uuid="269d8f6b-fa1e-4cee-91c7-6d8496bea3c1" 20346 uuid="269d8f6b-fa1e-4cee-91c7-6d8496bea3c1" 20338 20347 wsmap="managed" autogen="VBoxEvent" id="OnNATNetworkStartStop"> 20339 20348 <attribute name="startEvent" type="boolean" readonly="yes"> … … 20343 20352 </attribute> 20344 20353 </interface> 20345 20354 20346 20355 <!-- base class for modification events --> 20347 20356 <interface name="INATNetworkAlterEvent" extends="INATNetworkChangedEvent" 20348 uuid="3f5a0822-163a-43b1-ad16-8d58b0ef6e75" 20357 uuid="3f5a0822-163a-43b1-ad16-8d58b0ef6e75" 20349 20358 wsmap="managed" autogen="VBoxEvent" id="OnNATNetworkAlter"/> 20350 20359 20351 20360 <interface name="INATNetworkCreationDeletionEvent" extends="INATNetworkAlterEvent" 20352 uuid="8d984a7e-b855-40b8-ab0c-44d3515b4528" 20361 uuid="8d984a7e-b855-40b8-ab0c-44d3515b4528" 20353 20362 wsmap="managed" autogen="VBoxEvent" id="OnNATNetworkCreationDeletion"> 20354 20363 <attribute name="creationEvent" type="boolean" readonly="yes"/> 20355 20364 </interface> 20356 20365 <interface name="INATNetworkSettingEvent" extends="INATNetworkAlterEvent" 20357 uuid="9db3a9e6-7f29-4aae-a627-5a282c83092c" 20366 uuid="9db3a9e6-7f29-4aae-a627-5a282c83092c" 20358 20367 wsmap="managed" autogen="VBoxEvent" id="OnNATNetworkSetting"> 20359 20368 <attribute name="enabled" type="boolean" readonly="yes"/> … … 20364 20373 </interface> 20365 20374 <interface name="INATNetworkPortForwardEvent" extends="INATNetworkAlterEvent" 20366 uuid="2514881b-23d0-430a-a7ff-7ed7f05534bc" 20375 uuid="2514881b-23d0-430a-a7ff-7ed7f05534bc" 20367 20376 wsmap="managed" autogen="VBoxEvent" id="OnNATNetworkPortForward"> 20368 20377 <attribute name="create" type="boolean" readonly="yes"/> … … 20375 20384 <attribute name="guestPort" type="long" readonly="yes"/> 20376 20385 </interface> 20377 20386 20378 20387 <module name="VBoxSVC" context="LocalServer"> 20379 20388 <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F" -
trunk/src/VBox/Main/include/ConsoleImpl.h
r44425 r45284 206 206 HRESULT onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError); 207 207 HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup); 208 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove );208 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); 209 209 HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags); 210 210 HRESULT setGuestProperty(IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags); … … 621 621 StorageBus_T enmBus, 622 622 bool fUseHostIOCache, 623 IMediumAttachment *aMediumAtt); 623 IMediumAttachment *aMediumAtt, 624 bool fSilent); 624 625 static DECLCALLBACK(int) detachStorageDevice(Console *pThis, 625 626 PUVM pUVM, … … 627 628 unsigned uInstance, 628 629 StorageBus_T enmBus, 629 IMediumAttachment *aMediumAtt); 630 HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM); 631 HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM); 630 IMediumAttachment *aMediumAtt, 631 bool fSilent); 632 HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent); 633 HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent); 632 634 633 635 static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser); -
trunk/src/VBox/Main/include/MachineImpl.h
r45068 r45284 722 722 virtual HRESULT onDragAndDropModeChange(DragAndDropMode_T /* aDragAndDropMode */) { return S_OK; } 723 723 virtual HRESULT onBandwidthGroupChange(IBandwidthGroup * /* aBandwidthGroup */) { return S_OK; } 724 virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */ ) { return S_OK; }724 virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */, BOOL /* silent */) { return S_OK; } 725 725 726 726 HRESULT saveRegistryEntry(settings::MachineRegistryEntry &data); … … 1111 1111 HRESULT onDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode); 1112 1112 HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup); 1113 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove );1113 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); 1114 1114 1115 1115 bool hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs); -
trunk/src/VBox/Main/include/SessionImpl.h
r42382 r45284 101 101 STDMETHOD(OnShowWindow)(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId); 102 102 STDMETHOD(OnBandwidthGroupChange)(IBandwidthGroup *aBandwidthGroup); 103 STDMETHOD(OnStorageDeviceChange)(IMediumAttachment *aMediumAttachment, BOOL aRemove );103 STDMETHOD(OnStorageDeviceChange)(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); 104 104 STDMETHOD(AccessGuestProperty)(IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags, 105 105 BOOL aIsSetter, BSTR *aRetValue, LONG64 *aRetTimestamp, BSTR *aRetFlags); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r45030 r45284 3915 3915 * @param aMediumAttachment The medium attachment which is added. 3916 3916 * @param pUVM Safe VM handle. 3917 * @param fSilent Flag whether to notify the guest about the attached device. 3917 3918 * 3918 3919 * @note Locks this object for writing. 3919 3920 */ 3920 HRESULT Console::doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM )3921 HRESULT Console::doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent) 3921 3922 { 3922 3923 AutoCaller autoCaller(this); … … 3988 3989 VMREQFLAGS_VBOX_STATUS, 3989 3990 (PFNRT)Console::attachStorageDevice, 3990 7,3991 8, 3991 3992 this, 3992 3993 pUVM, … … 3995 3996 enmBus, 3996 3997 fUseHostIOCache, 3997 aMediumAttachment); 3998 aMediumAttachment, 3999 fSilent); 3998 4000 3999 4001 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4035 4037 * @param pcszDevice The PDM device name. 4036 4038 * @param uInstance The PDM device instance. 4039 * @param fSilent Flag whether to inform the guest about the attached device. 4037 4040 * 4038 4041 * @thread EMT … … 4044 4047 StorageBus_T enmBus, 4045 4048 bool fUseHostIOCache, 4046 IMediumAttachment *aMediumAtt) 4049 IMediumAttachment *aMediumAtt, 4050 bool fSilent) 4047 4051 { 4048 4052 LogFlowFunc(("pConsole=%p uInstance=%u pszDevice=%p:{%s} enmBus=%u, aMediumAtt=%p\n", … … 4118 4122 true /* fAttachDetach */, 4119 4123 false /* fForceUnmount */, 4120 true/* fHotplug */,4124 !fSilent /* fHotplug */, 4121 4125 pUVM, 4122 4126 NULL /* paLedDevType */); … … 4160 4164 * @param aMediumAttachment The medium attachment which is added. 4161 4165 * @param pUVM Safe VM handle. 4166 * @param fSilent Flag whether to notify the guest about the detached device. 4162 4167 * 4163 4168 * @note Locks this object for writing. 4164 4169 */ 4165 HRESULT Console::doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM )4170 HRESULT Console::doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent) 4166 4171 { 4167 4172 AutoCaller autoCaller(this); … … 4230 4235 VMREQFLAGS_VBOX_STATUS, 4231 4236 (PFNRT)Console::detachStorageDevice, 4232 6,4237 7, 4233 4238 this, 4234 4239 pUVM, … … 4236 4241 uInstance, 4237 4242 enmBus, 4238 aMediumAttachment); 4243 aMediumAttachment, 4244 fSilent); 4239 4245 4240 4246 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4275 4281 * @param pcszDevice The PDM device name. 4276 4282 * @param uInstance The PDM device instance. 4283 * @param fSilent Flag whether to notify the guest about the detached device. 4277 4284 * 4278 4285 * @thread EMT … … 4283 4290 unsigned uInstance, 4284 4291 StorageBus_T enmBus, 4285 IMediumAttachment *pMediumAtt) 4292 IMediumAttachment *pMediumAtt, 4293 bool fSilent) 4286 4294 { 4287 4295 LogFlowFunc(("pConsole=%p uInstance=%u pszDevice=%p:{%s} enmBus=%u, pMediumAtt=%p\n", … … 4363 4371 if (pLunL0) 4364 4372 { 4365 rc = PDMR3DeviceDetach(pUVM, pcszDevice, uInstance, uLUN, 0); 4373 uint32_t fFlags = 0; 4374 4375 if (fSilent) 4376 fFlags |= PDM_TACH_FLAGS_NOT_HOT_PLUG; 4377 4378 rc = PDMR3DeviceDetach(pUVM, pcszDevice, uInstance, uLUN, fFlags); 4366 4379 if (rc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN) 4367 4380 rc = VINF_SUCCESS; … … 5368 5381 * @note Locks this object for writing. 5369 5382 */ 5370 HRESULT Console::onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove )5383 HRESULT Console::onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent) 5371 5384 { 5372 5385 LogFlowThisFunc(("\n")); … … 5382 5395 { 5383 5396 if (aRemove) 5384 rc = doStorageDeviceDetach(aMediumAttachment, ptrVM.rawUVM() );5397 rc = doStorageDeviceDetach(aMediumAttachment, ptrVM.rawUVM(), aSilent); 5385 5398 else 5386 rc = doStorageDeviceAttach(aMediumAttachment, ptrVM.rawUVM() );5399 rc = doStorageDeviceAttach(aMediumAttachment, ptrVM.rawUVM(), aSilent); 5387 5400 ptrVM.release(); 5388 5401 } … … 5390 5403 /* notify console callbacks on success */ 5391 5404 if (SUCCEEDED(rc)) 5392 fireStorageDeviceChangedEvent(mEventSource, aMediumAttachment, aRemove );5405 fireStorageDeviceChangedEvent(mEventSource, aMediumAttachment, aRemove, aSilent); 5393 5406 5394 5407 LogFlowThisFunc(("Leaving rc=%#x\n", rc)); -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r42382 r45284 775 775 } 776 776 777 STDMETHODIMP Session::OnStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove )778 { 779 LogFlowThisFunc(("\n")); 780 781 AutoCaller autoCaller(this); 782 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 783 784 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 785 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 786 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 787 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 788 789 return mConsole->onStorageDeviceChange(aMediumAttachment, aRemove );777 STDMETHODIMP Session::OnStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent) 778 { 779 LogFlowThisFunc(("\n")); 780 781 AutoCaller autoCaller(this); 782 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 783 784 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 785 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 786 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 787 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 788 789 return mConsole->onStorageDeviceChange(aMediumAttachment, aRemove, aSilent); 790 790 } 791 791 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r45068 r45284 3775 3775 aControllerName); 3776 3776 3777 bool fSilent = false; 3778 Bstr strReconfig; 3779 3780 /* Check whether the flag to allow silent storage attachment reconfiguration is set. */ 3781 rc = mParent->GetExtraData(Bstr("StorageMgmt/SilentReconfigureWhilePaused").raw(), strReconfig.asOutParam()); 3782 if (FAILED(rc)) 3783 return rc; 3784 if ( mData->mMachineState == MachineState_Paused 3785 && strReconfig == "1") 3786 fSilent = true; 3787 3777 3788 /* Check that the controller can do hotplugging if we detach the device while the VM is running. */ 3778 3789 bool fHotplug = false; 3779 if ( Global::IsOnlineOrTransient(mData->mMachineState))3790 if (!fSilent && Global::IsOnlineOrTransient(mData->mMachineState)) 3780 3791 fHotplug = true; 3781 3792 … … 4176 4187 alock.release(); 4177 4188 4178 if (fHotplug )4179 rc = onStorageDeviceChange(attachment, FALSE /* aRemove */ );4189 if (fHotplug || fSilent) 4190 rc = onStorageDeviceChange(attachment, FALSE /* aRemove */, fSilent); 4180 4191 4181 4192 mParent->saveModifiedRegistries(); … … 4214 4225 aControllerName); 4215 4226 4227 bool fSilent = false; 4228 Bstr strReconfig; 4229 4230 /* Check whether the flag to allow silent storage attachment reconfiguration is set. */ 4231 rc = mParent->GetExtraData(Bstr("StorageMgmt/SilentReconfigureWhilePaused").raw(), strReconfig.asOutParam()); 4232 if (FAILED(rc)) 4233 return rc; 4234 if ( mData->mMachineState == MachineState_Paused 4235 && strReconfig == "1") 4236 fSilent = true; 4237 4216 4238 /* Check that the controller can do hotplugging if we detach the device while the VM is running. */ 4217 4239 bool fHotplug = false; 4218 if ( Global::IsOnlineOrTransient(mData->mMachineState))4240 if (!fSilent && Global::IsOnlineOrTransient(mData->mMachineState)) 4219 4241 fHotplug = true; 4220 4242 … … 4237 4259 * If this fails we can roll back without loosing data. 4238 4260 */ 4239 if (fHotplug )4261 if (fHotplug || fSilent) 4240 4262 { 4241 4263 alock.release(); 4242 rc = onStorageDeviceChange(pAttach, TRUE /* aRemove */ );4264 rc = onStorageDeviceChange(pAttach, TRUE /* aRemove */, fSilent); 4243 4265 alock.acquire(); 4244 4266 } … … 13506 13528 * @note Locks this object for reading. 13507 13529 */ 13508 HRESULT SessionMachine::onStorageDeviceChange(IMediumAttachment *aAttachment, BOOL aRemove )13530 HRESULT SessionMachine::onStorageDeviceChange(IMediumAttachment *aAttachment, BOOL aRemove, BOOL aSilent) 13509 13531 { 13510 13532 LogFlowThisFunc(("\n")); … … 13523 13545 return S_OK; 13524 13546 13525 return directControl->OnStorageDeviceChange(aAttachment, aRemove );13547 return directControl->OnStorageDeviceChange(aAttachment, aRemove, aSilent); 13526 13548 } 13527 13549
Note:
See TracChangeset
for help on using the changeset viewer.