Changeset 78261 in vbox for trunk/src/VBox
- Timestamp:
- Apr 23, 2019 4:49:28 PM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r78255 r78261 21095 21095 21096 21096 </desc> 21097 <param name="machineId" type="uuid" mod="string" dir="in"> 21098 <desc>The id of the machine containing the storage controller.</desc> 21099 </param> 21100 <param name="controllerName" type="wstring" dir="in"> 21101 <desc>The name of the storage controller.</desc> 21102 </param> 21097 21103 </method> 21098 21104 … … 24233 24239 <interface 24234 24240 name="IStorageControllerChangedEvent" extends="IEvent" 24235 uuid=" 715212BF-DA59-426E-8230-3831FAA52C56"24241 uuid="6BB335CC-1C58-440C-BB7B-3A1397284C7B" 24236 24242 wsmap="managed" autogen="VBoxEvent" id="OnStorageControllerChanged" 24237 24243 > 24238 24244 <desc> 24239 24245 Notification when a 24240 <link to="IMachine:: mediumAttachments">medium attachment</link>24246 <link to="IMachine::storageControllers">storage controllers</link> 24241 24247 changes. 24242 24248 </desc> 24243 <attribute name="midlDoesNotLikeEmptyInterfaces" readonly="yes" type="boolean"/> 24249 <attribute name="machinId" type="uuid" mod="string" readonly="yes"> 24250 <desc> 24251 The id of the machine containing the storage controller. 24252 </desc> 24253 </attribute> 24254 <attribute name="controllerName" type="wstring" readonly="yes"> 24255 <desc> 24256 The name of the storage controller. 24257 </desc> 24258 </attribute> 24244 24259 </interface> 24245 24260 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r77910 r78261 179 179 HRESULT i_onSerialPortChange(ISerialPort *aSerialPort); 180 180 HRESULT i_onParallelPortChange(IParallelPort *aParallelPort); 181 HRESULT i_onStorageControllerChange( );181 HRESULT i_onStorageControllerChange(const com::Guid& aMachineId, const com::Utf8Str& aControllerName); 182 182 HRESULT i_onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce); 183 183 HRESULT i_onCPUChange(ULONG aCPU, BOOL aRemove); -
trunk/src/VBox/Main/include/MachineImpl.h
r77910 r78261 519 519 virtual HRESULT i_onVRDEServerChange(BOOL /* aRestart */) { return S_OK; } 520 520 virtual HRESULT i_onUSBControllerChange() { return S_OK; } 521 virtual HRESULT i_onStorageControllerChange( ) { return S_OK; }521 virtual HRESULT i_onStorageControllerChange(const com::Guid & /* aMachineId */, const com::Utf8Str & /* aControllerName */) { return S_OK; } 522 522 virtual HRESULT i_onCPUChange(ULONG /* aCPU */, BOOL /* aRemove */) { return S_OK; } 523 523 virtual HRESULT i_onCPUExecutionCapChange(ULONG /* aExecutionCap */) { return S_OK; } … … 1326 1326 NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, 1327 1327 IN_BSTR aGuestIp, LONG aGuestPort); 1328 HRESULT i_onStorageControllerChange( );1328 HRESULT i_onStorageControllerChange(const com::Guid &aMachineId, const com::Utf8Str &aControllerName); 1329 1329 HRESULT i_onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce); 1330 1330 HRESULT i_onVMProcessPriorityChange(VMProcPriority_T aPriority); -
trunk/src/VBox/Main/include/SessionImpl.h
r77910 r78261 93 93 HRESULT onSerialPortChange(const ComPtr<ISerialPort> &aSerialPort); 94 94 HRESULT onParallelPortChange(const ComPtr<IParallelPort> &aParallelPort); 95 HRESULT onStorageControllerChange( );95 HRESULT onStorageControllerChange(const Guid &aMachineId, const com::Utf8Str& aControllerName); 96 96 HRESULT onMediumChange(const ComPtr<IMediumAttachment> &aMediumAttachment, 97 97 BOOL aForce); -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r76562 r78261 156 156 void i_onMediumConfigChanged(IMedium *aMedium); 157 157 void i_onMediumChanged(IMediumAttachment* aMediumAttachment); 158 void i_onStorageControllerChanged(const Guid &aMachineId, const com::Utf8Str &aControllerName); 158 159 void i_onStorageDeviceChanged(IMediumAttachment* aStorageDevice, const BOOL fRemoved, const BOOL fSilent); 159 160 void i_onMachineStateChange(const Guid &aId, MachineState_T aState); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r78090 r78261 5246 5246 * Called by IInternalSessionControl::OnStorageControllerChange(). 5247 5247 */ 5248 HRESULT Console::i_onStorageControllerChange( )5248 HRESULT Console::i_onStorageControllerChange(const Guid &aMachineId, const Utf8Str &aControllerName) 5249 5249 { 5250 5250 LogFlowThisFunc(("\n")); … … 5253 5253 AssertComRCReturnRC(autoCaller.rc()); 5254 5254 5255 fireStorageControllerChangedEvent(mEventSource );5255 fireStorageControllerChangedEvent(mEventSource, Bstr(aMachineId.toString()).raw(), Bstr(aControllerName).raw()); 5256 5256 5257 5257 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK)); -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r77910 r78261 640 640 } 641 641 642 HRESULT Session::onStorageControllerChange() 643 { 644 LogFlowThisFunc(("\n")); 645 646 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 647 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 648 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 649 #ifndef VBOX_COM_INPROC_API_CLIENT 650 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 651 652 return mConsole->i_onStorageControllerChange(); 653 #else 642 HRESULT Session::onStorageControllerChange(const Guid &aMachineId, const Utf8Str &aControllerName) 643 { 644 LogFlowThisFunc(("\n")); 645 646 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 647 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 648 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 649 #ifndef VBOX_COM_INPROC_API_CLIENT 650 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 651 652 return mConsole->i_onStorageControllerChange(aMachineId, aControllerName); 653 #else 654 NOREF(aMachineId); 655 NOREF(aControllerName); 654 656 return S_OK; 655 657 #endif -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r78202 r78261 4178 4178 mParent->i_saveModifiedRegistries(); 4179 4179 4180 if (aM) 4181 mParent->i_onMediumConfigChanged(aM); 4180 if (SUCCEEDED(rc)) 4181 { 4182 if (fIndirect && medium != aM) 4183 mParent->i_onMediumConfigChanged(medium); 4184 mParent->i_onStorageDeviceChanged(attachment, FALSE, fSilent); 4185 } 4186 4182 4187 return rc; 4183 4188 } … … 4263 4268 mParent->i_saveModifiedRegistries(); 4264 4269 4270 if (SUCCEEDED(rc)) 4271 mParent->i_onStorageDeviceChanged(pAttach, TRUE, fSilent); 4272 4265 4273 return rc; 4266 4274 } … … 4334 4342 alock.release(); 4335 4343 rc = i_onStorageDeviceChange(pAttach, FALSE /* aRemove */, FALSE /* aSilent */); 4344 if (SUCCEEDED(rc)) 4345 mParent->i_onStorageDeviceChanged(pAttach, FALSE, FALSE); 4336 4346 4337 4347 return rc; … … 6043 6053 /* inform the direct session if any */ 6044 6054 alock.release(); 6045 i_onStorageControllerChange( );6055 i_onStorageControllerChange(i_getId(), aName); 6046 6056 6047 6057 return S_OK; … … 6130 6140 /* inform the direct session if any */ 6131 6141 alock.release(); 6132 i_onStorageControllerChange( );6142 i_onStorageControllerChange(i_getId(), aName); 6133 6143 } 6134 6144 … … 6183 6193 /* inform the direct session if any */ 6184 6194 alock.release(); 6185 i_onStorageControllerChange( );6195 i_onStorageControllerChange(i_getId(), aName); 6186 6196 6187 6197 return S_OK; … … 11841 11851 11842 11852 if (flModifications & IsModified_Storage) 11843 that->i_onStorageControllerChange(); 11853 { 11854 for (StorageControllerList::const_iterator 11855 it = mStorageControllers->begin(); 11856 it != mStorageControllers->end(); 11857 ++it) 11858 { 11859 that->i_onStorageControllerChange(that->i_getId(), (*it)->i_getName()); 11860 } 11861 } 11862 11844 11863 11845 11864 #if 0 … … 14024 14043 * @note Locks this object for reading. 14025 14044 */ 14026 HRESULT SessionMachine::i_onStorageControllerChange( )14045 HRESULT SessionMachine::i_onStorageControllerChange(const Guid &aMachineId, const Utf8Str &aControllerName) 14027 14046 { 14028 14047 LogFlowThisFunc(("\n")); … … 14038 14057 } 14039 14058 14059 mParent->i_onStorageControllerChanged(aMachineId, aControllerName); 14060 14040 14061 /* ignore notifications sent after #OnSessionEnd() is called */ 14041 14062 if (!directControl) 14042 14063 return S_OK; 14043 14064 14044 return directControl->OnStorageControllerChange( );14065 return directControl->OnStorageControllerChange(Bstr(aMachineId.toString()).raw(), Bstr(aControllerName).raw()); 14045 14066 } 14046 14067 … … 14321 14342 directControl = mData->mSession.mDirectControl; 14322 14343 } 14323 14324 mParent->i_onStorageDeviceChanged(aAttachment, aRemove, aSilent);14325 14344 14326 14345 /* ignore notifications sent after #OnSessionEnd() is called */ -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r77857 r78261 2382 2382 Guid uId = i_getId(); 2383 2383 DeviceType_T devType = i_getDeviceType(); 2384 bool wasCreated = m->state != MediumState_NotCreated;2385 2384 MultiResult mrc = i_close(aAutoCaller); 2386 2385 2387 2386 pVirtualBox->i_saveModifiedRegistries(); 2388 2387 2389 if (SUCCEEDED(mrc) && wasCreated)2388 if (SUCCEEDED(mrc)) 2390 2389 pVirtualBox->i_onMediumRegistered(uId, devType, FALSE); 2391 2390 … … 8453 8452 m->pVirtualBox->i_saveModifiedRegistries(); 8454 8453 } 8455 if (task.NotifyAboutChanges())8456 m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);8457 8454 } 8458 8455 else … … 8465 8462 unconst(m->id).clear(); 8466 8463 } 8464 8465 if (task.NotifyAboutChanges() && SUCCEEDED(rc)) 8466 m->pVirtualBox->i_onMediumConfigChanged(this); 8467 8467 8468 8468 return rc; … … 8691 8691 8692 8692 if (task.NotifyAboutChanges() && SUCCEEDED(mrc)) 8693 {8694 m->pVirtualBox->i_onMediumRegistered(pTarget->i_getId(), pTarget->i_getDeviceType(), TRUE);8695 8693 m->pVirtualBox->i_onMediumConfigChanged(this); 8696 }8697 8694 8698 8695 return mrc; -
trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
r76592 r78261 334 334 alock.release(); 335 335 336 m->pParent->i_onStorageControllerChange( );336 m->pParent->i_onStorageControllerChange(m->pParent->i_getId(), aName); 337 337 } 338 338 … … 435 435 mlock.release(); 436 436 437 m->pParent->i_onStorageControllerChange( );437 m->pParent->i_onStorageControllerChange(m->pParent->i_getId(), m->bd->strName); 438 438 } 439 439 … … 576 576 mlock.release(); 577 577 578 m->pParent->i_onStorageControllerChange( );578 m->pParent->i_onStorageControllerChange(m->pParent->i_getId(), m->bd->strName); 579 579 } 580 580 … … 609 609 mlock.release(); 610 610 611 m->pParent->i_onStorageControllerChange( );611 m->pParent->i_onStorageControllerChange(m->pParent->i_getId(), m->bd->strName); 612 612 } 613 613 … … 642 642 mlock.release(); 643 643 644 m->pParent->i_onStorageControllerChange( );644 m->pParent->i_onStorageControllerChange(m->pParent->i_getId(), m->bd->strName); 645 645 } 646 646 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r78202 r78261 3020 3020 } 3021 3021 3022 /** Event for onStorageControllerChanged() */ 3023 struct StorageControllerChangedEventStruct : public VirtualBox::CallbackEvent 3024 { 3025 StorageControllerChangedEventStruct(VirtualBox *aVB, const Guid &aMachineId, 3026 const com::Utf8Str &aControllerName) 3027 : CallbackEvent(aVB, VBoxEventType_OnStorageControllerChanged) 3028 , mMachineId(aMachineId.toUtf16()), mControllerName(aControllerName) 3029 {} 3030 3031 virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc) 3032 { 3033 return aEvDesc.init(aSource, VBoxEventType_OnStorageControllerChanged, mMachineId.raw(), mControllerName.raw()); 3034 } 3035 3036 Bstr mMachineId; 3037 Bstr mControllerName; 3038 }; 3039 3040 /** 3041 * @note Doesn't lock any object. 3042 */ 3043 void VirtualBox::i_onStorageControllerChanged(const Guid &aMachineId, const com::Utf8Str &aControllerName) 3044 { 3045 i_postEvent(new StorageControllerChangedEventStruct(this, aMachineId, aControllerName)); 3046 } 3047 3022 3048 /** Event for onStorageDeviceChanged() */ 3023 3049 struct StorageDeviceChangedEventStruct : public VirtualBox::CallbackEvent
Note:
See TracChangeset
for help on using the changeset viewer.