Changeset 5060 in vbox
- Timestamp:
- Sep 26, 2007 5:14:35 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r4505 r5060 851 851 hrc = networkAdapter->COMGETTER(CableConnected)(&fCableConnected); H(); 852 852 rc = CFGMR3InsertInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0); RC_CHECK(); 853 854 /* 855 * Line speed to report from custom drivers 856 */ 857 ULONG ulLineSpeed; 858 hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed); H(); 859 rc = CFGMR3InsertInteger(pCfg, "LineSpeed", ulLineSpeed); RC_CHECK(); 853 860 854 861 /* -
trunk/src/VBox/Main/MachineImpl.cpp
r4859 r5060 4375 4375 bool cableConnected; 4376 4376 CFGLDRQueryBool (adapterNode, "cable", &cableConnected); 4377 /* line speed (defaults to 100 Mbps) */ 4378 uint32_t lineSpeed = 100000; 4379 CFGLDRQueryUInt32 (adapterNode, "speed", &lineSpeed); 4377 4380 /* tracing (defaults to false) */ 4378 4381 bool traceEnabled; … … 4384 4387 mNetworkAdapters [slot]->COMSETTER(MACAddress) (macAddr); 4385 4388 mNetworkAdapters [slot]->COMSETTER(CableConnected) (cableConnected); 4389 mNetworkAdapters [slot]->COMSETTER(LineSpeed) (lineSpeed); 4386 4390 mNetworkAdapters [slot]->COMSETTER(TraceEnabled) (traceEnabled); 4387 4391 mNetworkAdapters [slot]->COMSETTER(TraceFile) (traceFile); … … 6214 6218 CFGLDRSetBool (networkAdapterNode, "cable", 6215 6219 !!mNetworkAdapters [slot]->data()->mCableConnected); 6220 6221 CFGLDRSetUInt32 (networkAdapterNode, "speed", 6222 mNetworkAdapters [slot]->data()->mLineSpeed); 6216 6223 6217 6224 if (mNetworkAdapters [slot]->data()->mTraceEnabled) -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r4071 r5060 664 664 mData.backup(); 665 665 mData->mCableConnected = aConnected; 666 667 /* leave the lock before informing callbacks */ 668 alock.unlock(); 669 670 mParent->onNetworkAdapterChange (this); 671 } 672 673 return S_OK; 674 } 675 676 STDMETHODIMP NetworkAdapter::COMGETTER(LineSpeed) (ULONG *aSpeed) 677 { 678 if (!aSpeed) 679 return E_POINTER; 680 681 AutoCaller autoCaller (this); 682 CheckComRCReturnRC (autoCaller.rc()); 683 684 AutoReaderLock alock (this); 685 686 *aSpeed = mData->mLineSpeed; 687 688 return S_OK; 689 } 690 691 STDMETHODIMP NetworkAdapter::COMSETTER(LineSpeed) (ULONG aSpeed) 692 { 693 AutoCaller autoCaller (this); 694 CheckComRCReturnRC (autoCaller.rc()); 695 696 /* the machine needs to be mutable */ 697 Machine::AutoMutableStateDependency adep (mParent); 698 CheckComRCReturnRC (adep.rc()); 699 700 AutoLock alock (this); 701 702 if (aSpeed != mData->mLineSpeed) 703 { 704 mData.backup(); 705 mData->mLineSpeed = aSpeed; 666 706 667 707 /* leave the lock before informing callbacks */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r4685 r5060 7106 7106 </attribute> 7107 7107 7108 <attribute name="lineSpeed" type="unsigned long"> 7109 <desc> 7110 Line speed reported by custom drivers, in units of 1 kbps. 7111 </desc> 7112 </attribute> 7113 7108 7114 <attribute name="traceEnabled" type="boolean"> 7109 7115 <desc> -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r4071 r5060 37 37 : mSlot (0), mEnabled (FALSE) 38 38 , mAttachmentType (NetworkAttachmentType_NoNetworkAttachment) 39 , mCableConnected (TRUE), m TraceEnabled (FALSE)39 , mCableConnected (TRUE), mLineSpeed (0), mTraceEnabled (FALSE) 40 40 #ifdef RT_OS_WINDOWS 41 41 , mHostInterface ("") // cannot be null … … 55 55 mAttachmentType == that.mAttachmentType && 56 56 mCableConnected == that.mCableConnected && 57 mLineSpeed == that.mLineSpeed && 57 58 mTraceEnabled == that.mTraceEnabled && 58 59 mHostInterface == that.mHostInterface && … … 71 72 NetworkAttachmentType_T mAttachmentType; 72 73 BOOL mCableConnected; 74 ULONG mLineSpeed; 73 75 BOOL mTraceEnabled; 74 76 Bstr mTraceFile; … … 131 133 STDMETHOD(COMGETTER(TraceEnabled)) (BOOL *aEnabled); 132 134 STDMETHOD(COMSETTER(TraceEnabled)) (BOOL aEnabled); 135 STDMETHOD(COMGETTER(LineSpeed)) (ULONG *aSpeed); 136 STDMETHOD(COMSETTER(LineSpeed)) (ULONG aSpeed); 133 137 STDMETHOD(COMGETTER(TraceFile)) (BSTR *aTraceFile); 134 138 STDMETHOD(COMSETTER(TraceFile)) (INPTR BSTR aTraceFile); -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r4859 r5060 531 531 </xsd:attribute> 532 532 <xsd:attribute name="cable" type="xsd:boolean" use="required"/> 533 <xsd:attribute name="speed" type="xsd:unsignedInt"/> 533 534 <xsd:attribute name="trace" type="xsd:boolean" default="false"/> 534 535 <xsd:attribute name="tracefile" type="xsd:string"/>
Note:
See TracChangeset
for help on using the changeset viewer.