Changeset 28287 in vbox
- Timestamp:
- Apr 14, 2010 10:10:40 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60036
- Location:
- trunk/src/VBox
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Builtins.cpp
r27559 r28287 238 238 return rc; 239 239 #endif 240 /* ENABLE VDE */ 241 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 242 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE); 243 if (RT_FAILURE(rc)) 244 return rc; 245 #endif 246 /* /ENABLE VDE */ 240 247 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet); 241 248 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Builtins.h
r27559 r28287 107 107 extern const PDMDRVREG g_DrvHostInterface; 108 108 #endif 109 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 110 extern const PDMDRVREG g_DrvVDE; 111 #endif 109 112 extern const PDMDRVREG g_DrvIntNet; 110 113 extern const PDMDRVREG g_DrvNAT; -
trunk/src/VBox/Devices/Makefile.kmk
r28228 r28287 1004 1004 Drivers_SOURCES.linux = \ 1005 1005 Network/DrvTAP.cpp \ 1006 Network/DrvVDE.cpp \ 1006 1007 Audio/ossaudio.c \ 1007 1008 Parallel/DrvHostParallel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r28205 r28287 2155 2155 attType = attType.arg (tr ("Host-only adapter, '%1'", 2156 2156 "details report (network)").arg (adapter.GetHostInterface())); 2157 /* ENABLE VDE */ 2158 else if (type == KNetworkAttachmentType_VDE) 2159 attType = attType.arg (tr ("VDE network, '%1'", 2160 "details report (network)").arg (adapter.GetVDENetwork())); 2161 /* /ENABLE VDE */ 2157 2162 else 2158 2163 attType = attType.arg (vboxGlobal().toString (type)); … … 3113 3118 mNetworkAttachmentTypes [KNetworkAttachmentType_HostOnly] = 3114 3119 tr ("Host-only Adapter", "NetworkAttachmentType"); 3120 /* ENABLE VDE */ 3121 mNetworkAttachmentTypes [KNetworkAttachmentType_VDE] = 3122 tr ("VDE Adapter", "NetworkAttachmentType"); 3123 /* /ENABLE VDE */ 3115 3124 3116 3125 mClipboardTypes [KClipboardMode_Disabled] = -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.cpp
r26714 r28287 105 105 if (mHoiName.isEmpty()) mHoiName = QString::null; 106 106 break; 107 /* ENABLE VDE */ 108 case KNetworkAttachmentType_VDE: 109 mVDEName = mAdapter.GetVDENetwork(); 110 if (mVDEName.isEmpty()) mVDEName = QString::null; 111 break; 112 /* /ENABLE VDE */ 107 113 default: 108 114 break; … … 145 151 mAdapter.AttachToHostOnlyInterface(); 146 152 break; 153 /* ENABLE VDE */ 154 case KNetworkAttachmentType_VDE: 155 mAdapter.SetVDENetwork (alternativeName()); 156 mAdapter.AttachToVDE(); 157 break; 158 /* /ENABLE VDE */ 147 159 default: 148 160 break; … … 257 269 result = mHoiName; 258 270 break; 271 /* ENABLE VDE*/ 272 case KNetworkAttachmentType_VDE: 273 result = mVDEName; 274 break; 275 /* /ENABLE VDE*/ 259 276 default: 260 277 break; … … 333 350 mCbAdapterName->setEditable (false); 334 351 break; 352 /* ENABLE VDE */ 353 case KNetworkAttachmentType_VDE: 354 mCbAdapterName->insertItem(0, alternativeName()); 355 mCbAdapterName->setEditable (true); 356 mCbAdapterName->setCompleter (0); 357 break; 358 /* /ENABLE VDE */ 335 359 default: 336 360 break; … … 432 456 break; 433 457 } 458 /* ENABLE VDE */ 459 case KNetworkAttachmentType_VDE: 460 { 461 QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() == 462 QString (emptyItemCode) && 463 mCbAdapterName->currentText() == 464 mCbAdapterName->itemText (mCbAdapterName->currentIndex())) || 465 mCbAdapterName->currentText().isEmpty() ? 466 QString::null : mCbAdapterName->currentText()); 467 if (mVDEName != newName) 468 mVDEName = newName; 469 break; 470 } 471 /* /ENABLE VDE */ 434 472 default: 435 473 break; … … 548 586 mCbAttachmentType->setItemData (4, 549 587 mCbAttachmentType->itemText (4), Qt::ToolTipRole); 588 /* ENABLE VDE */ 589 mCbAttachmentType->insertItem (5, 590 vboxGlobal().toString (KNetworkAttachmentType_VDE)); 591 mCbAttachmentType->setItemData (5, 592 KNetworkAttachmentType_VDE); 593 mCbAttachmentType->setItemData (5, 594 mCbAttachmentType->itemText (5), Qt::ToolTipRole); 595 /* /ENABLE VDE */ 550 596 551 597 /* Set the old value */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.h
r25177 r28287 77 77 QString mIntName; 78 78 QString mHoiName; 79 /* ENABLE VDE */ 80 QString mVDEName; 81 /* /ENABLE VDE */ 79 82 80 83 bool mPolished; … … 93 96 QStringList intList (bool aRefresh = false); 94 97 QStringList hoiList (bool aRefresh = false); 98 QStringList vdeList (bool aRefresh = false); 95 99 96 100 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.ui
r25196 r28287 111 111 </property> 112 112 <property name="whatsThis" > 113 <string>Selects the name of the network adapter for <b>Bridged Adapter</b> or <b>Host-only Adapter</b> attachments and the name of the network <b>Internal Network</b> attachments.</string>113 <string>Selects the name of the network adapter for <b>Bridged Adapter</b> or <b>Host-only Adapter</b> attachments and the name of the network <b>Internal Network</b> or the switch for <b>VDE</b> attachments.</string> 114 114 </property> 115 115 </widget> -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28286 r28287 3416 3416 } 3417 3417 3418 /* ENABLE VDE */ 3419 case NetworkAttachmentType_VDE: 3420 { 3421 hrc = aNetworkAdapter->COMGETTER(VDENetwork)(&str); H(); 3422 #if 0 3423 if (str) { 3424 Utf8Str strUtf8 = str; 3425 LogRel(("VDE Network %s\n",(char *)strUtf8.raw())); 3426 } 3427 #endif 3428 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 3429 rc = CFGMR3InsertString(pLunL0, "Driver", "VDE"); RC_CHECK(); 3430 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3431 if (str && *str) { 3432 rc = CFGMR3InsertStringW(pCfg, "Network", str); RC_CHECK(); 3433 networkName = str; 3434 } 3435 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_WhateverNone); RC_CHECK(); 3436 STR_FREE(); 3437 break; 3438 } 3439 /* /ENABLE VDE */ 3440 3418 3441 default: 3419 3442 AssertMsgFailed(("should not get here!\n")); … … 3433 3456 case NetworkAttachmentType_HostOnly: 3434 3457 case NetworkAttachmentType_NAT: 3458 case NetworkAttachmentType_VDE: 3435 3459 { 3436 3460 if (SUCCEEDED(hrc) && SUCCEEDED(rc)) -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r28106 r28287 610 610 } 611 611 612 /* ENABLE VDE */ 613 STDMETHODIMP NetworkAdapter::COMGETTER(VDENetwork) (BSTR *aVDENetwork) 614 { 615 CheckComArgOutPointerValid(aVDENetwork); 616 617 AutoCaller autoCaller(this); 618 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 619 620 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 621 622 mData->mVDENetwork.cloneTo(aVDENetwork); 623 624 return S_OK; 625 } 626 627 STDMETHODIMP NetworkAdapter::COMSETTER(VDENetwork) (IN_BSTR aVDENetwork) 628 { 629 Bstr bstrEmpty(""); 630 if (!aVDENetwork) 631 aVDENetwork = bstrEmpty; 632 633 AutoCaller autoCaller(this); 634 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 635 636 /* the machine needs to be mutable */ 637 AutoMutableStateDependency adep (mParent); 638 if (FAILED(adep.rc())) return adep.rc(); 639 640 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 641 642 if (mData->mVDENetwork != aVDENetwork) 643 { 644 mData.backup(); 645 mData->mVDENetwork = aVDENetwork; 646 647 /* leave the lock before informing callbacks */ 648 alock.release(); 649 650 mParent->onNetworkAdapterChange (this, FALSE); 651 } 652 653 return S_OK; 654 } 655 656 /* /ENABLE VDE */ 657 612 658 STDMETHODIMP NetworkAdapter::COMGETTER(CableConnected) (BOOL *aConnected) 613 659 { … … 1047 1093 return S_OK; 1048 1094 } 1095 1096 /* ENABLE VDE */ 1097 STDMETHODIMP NetworkAdapter::AttachToVDE() 1098 { 1099 AutoCaller autoCaller(this); 1100 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1101 1102 /* the machine needs to be mutable */ 1103 AutoMutableStateDependency adep (mParent); 1104 if (FAILED(adep.rc())) return adep.rc(); 1105 1106 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1107 1108 /* don't do anything if we're already host interface attached */ 1109 if (mData->mAttachmentType != NetworkAttachmentType_VDE) 1110 { 1111 mData.backup(); 1112 1113 /* first detach the current attachment */ 1114 // Commented this for now as it reset the parameter mData->mHostInterface 1115 // which is essential while changing the Attachment dynamically. 1116 //detach(); 1117 1118 mData->mAttachmentType = NetworkAttachmentType_VDE; 1119 1120 /* leave the lock before informing callbacks */ 1121 alock.release(); 1122 1123 HRESULT rc = mParent->onNetworkAdapterChange (this, TRUE); 1124 if (FAILED (rc)) 1125 { 1126 /* If changing the attachment failed then we can't assume 1127 * that the previous attachment will attach correctly 1128 * and thus return error along with dettaching all 1129 * attachments. 1130 */ 1131 Detach(); 1132 return rc; 1133 } 1134 } 1135 1136 return S_OK; 1137 } 1138 1139 /* /ENABLE VDE */ 1049 1140 1050 1141 STDMETHODIMP NetworkAdapter::Detach() … … 1156 1247 break; 1157 1248 1249 /* ENABLE VDE */ 1250 case NetworkAttachmentType_VDE: 1251 mData->mVDENetwork = data.strName; 1252 rc = AttachToVDE(); 1253 if (FAILED(rc)) return rc; 1254 break; 1255 /* ENABLE VDE */ 1256 1257 1158 1258 case NetworkAttachmentType_Null: 1159 1259 rc = Detach(); … … 1219 1319 case NetworkAttachmentType_HostOnly: 1220 1320 data.strName = mData->mHostInterface; 1321 break; 1322 1323 case NetworkAttachmentType_VDE: 1324 data.strName = mData->mVDENetwork; 1221 1325 break; 1222 1326 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r28235 r28287 11537 11537 <const name="Internal" value="3"/> 11538 11538 <const name="HostOnly" value="4"/> 11539 <!-- ENABLE VDE --> 11540 <const name="VDE" value="5"/> 11541 <!-- /ENABLE VDE --> 11539 11542 </enum> 11540 11543 … … 11639 11642 </attribute> 11640 11643 11644 <!-- ENABLE VDE --> 11645 <attribute name="VDENetwork" type="wstring"> 11646 <desc> 11647 Name of the VDE switch the VM is attached to. 11648 </desc> 11649 </attribute> 11650 <!-- /ENABLE VDE --> 11651 11641 11652 <attribute name="cableConnected" type="boolean"> 11642 11653 <desc> … … 11704 11715 </desc> 11705 11716 </method> 11717 11718 <!-- ENABLE VDE --> 11719 <method name="attachToVDE"> 11720 <desc> 11721 Attach the network adapter to a VDE network. 11722 </desc> 11723 </method> 11724 <!-- /ENABLE VDE --> 11706 11725 11707 11726 <method name="detach"> -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r28106 r28287 50 50 mHostInterface("") /* cannot be null */, 51 51 mNATNetwork("") /* cannot be null */ 52 /* ENABLE VDE */ 53 , mVDENetwork("") /* can be null */ 54 /* /ENABLE VDE */ 52 55 {} 53 56 … … 64 67 Bstr mInternalNetwork; 65 68 Bstr mNATNetwork; 69 /* ENABLE VDE */ 70 Bstr mVDENetwork; 66 71 ULONG mBootPriority; 67 72 }; … … 105 110 STDMETHOD(COMGETTER(NATNetwork)) (BSTR *aNATNetwork); 106 111 STDMETHOD(COMSETTER(NATNetwork)) (IN_BSTR aNATNetwork); 112 /* ENABLE VDE */ 113 STDMETHOD(COMGETTER(VDENetwork)) (BSTR *aVDENetwork); 114 STDMETHOD(COMSETTER(VDENetwork)) (IN_BSTR aVDENetwork); 115 /* /ENABLE VDE */ 107 116 STDMETHOD(COMGETTER(CableConnected)) (BOOL *aConnected); 108 117 STDMETHOD(COMSETTER(CableConnected)) (BOOL aConnected); … … 122 131 STDMETHOD(AttachToInternalNetwork)(); 123 132 STDMETHOD(AttachToHostOnlyInterface)(); 133 /* ENABLE VDE */ 134 STDMETHOD(AttachToVDE)(); 135 /* /ENABLE VDE */ 124 136 STDMETHOD(Detach)(); 125 137 -
trunk/src/VBox/Main/xml/Settings.cpp
r28204 r28287 1889 1889 throw ConfigFileError(this, pelmAdapterChild, N_("Required HostOnlyInterface/@name element is missing")); 1890 1890 } 1891 /* ENABLE VDE */ 1892 else if ((pelmAdapterChild = pelmAdapter->findChildElement("VDE"))) 1893 { 1894 nic.mode = NetworkAttachmentType_VDE; 1895 pelmAdapterChild->getAttributeValue("network", nic.strName); // optional network name 1896 } 1897 /* /ENABLE VDE */ 1891 1898 // else: default is NetworkAttachmentType_Null 1892 1899 … … 3388 3395 break; 3389 3396 3397 /* ENABLE VDE */ 3398 case NetworkAttachmentType_VDE: 3399 pelmNAT = pelmAdapter->createChild("VDE"); 3400 if (nic.strName.length()) 3401 pelmNAT->setAttribute("network", nic.strName); 3402 break; 3403 /* /ENABLE VDE */ 3404 3390 3405 default: /*case NetworkAttachmentType_Null:*/ 3391 3406 break;
Note:
See TracChangeset
for help on using the changeset viewer.