Changeset 36082 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 25, 2011 12:21:57 PM (14 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r36074 r36082 5974 5974 5975 5975 /** 5976 * Adds the given IsModified_* flag to the dirty flags of the machine, taking 5977 * care of the write locking. 5978 * 5979 * @param fModifications The flag to add. 5980 */ 5981 void Machine::setModifiedLock(uint32_t fModification) 5982 { 5983 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5984 mData->flModifications |= fModification; 5985 } 5986 5987 /** 5976 5988 * Saves the registry entry of this machine to the given configuration node. 5977 5989 * -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r35638 r36082 753 753 } 754 754 755 756 STDMETHODIMP NetworkAdapter::COMGETTER(PromiscModePolicy)(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy) 757 { 758 CheckComArgOutPointerValid(aPromiscModePolicy); 759 760 AutoCaller autoCaller(this); 761 HRESULT hrc = autoCaller.rc(); 762 if (SUCCEEDED(hrc)) 763 { 764 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 765 *aPromiscModePolicy = mData->mPromiscModePolicy; 766 } 767 return hrc; 768 } 769 770 STDMETHODIMP NetworkAdapter::COMSETTER(PromiscModePolicy)(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy) 771 { 772 switch (aPromiscModePolicy) 773 { 774 case NetworkAdapterPromiscModePolicy_Deny: 775 case NetworkAdapterPromiscModePolicy_AllowNetwork: 776 case NetworkAdapterPromiscModePolicy_AllowAll: 777 break; 778 default: 779 return setError(E_INVALIDARG, tr("Invalid promiscuous mode policy (%d)"), aPromiscModePolicy); 780 } 781 782 AutoCaller autoCaller(this); 783 HRESULT hrc = autoCaller.rc(); 784 785 if (SUCCEEDED(hrc)) 786 { 787 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 788 if (aPromiscModePolicy != mData->mPromiscModePolicy) 789 { 790 mData.backup(); 791 mData->mPromiscModePolicy = aPromiscModePolicy; 792 m_fModified = true; 793 794 alock.release(); 795 mParent->setModifiedLock(Machine::IsModified_NetworkAdapters); 796 mParent->onNetworkAdapterChange(this, TRUE); 797 } 798 } 799 800 return hrc; 801 } 802 755 803 STDMETHODIMP NetworkAdapter::COMGETTER(BandwidthLimit) (ULONG *aLimit) 756 804 { … … 1258 1306 /* line speed (defaults to 100 Mbps) */ 1259 1307 mData->mLineSpeed = data.ulLineSpeed; 1308 mData->mPromiscModePolicy = data.enmPromiscModePolicy; 1260 1309 /* tracing (defaults to false) */ 1261 1310 mData->mTraceEnabled = data.fTraceEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.