Changeset 28290 in vbox for trunk/src/VBox
- Timestamp:
- Apr 14, 2010 10:30:03 AM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Builtins.cpp
r28287 r28290 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 #endif246 /* /ENABLE VDE */247 240 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet); 248 241 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Builtins.h
r28287 r28290 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 #endif112 109 extern const PDMDRVREG g_DrvIntNet; 113 110 extern const PDMDRVREG g_DrvNAT; -
trunk/src/VBox/Devices/Makefile.kmk
r28287 r28290 1004 1004 Drivers_SOURCES.linux = \ 1005 1005 Network/DrvTAP.cpp \ 1006 Network/DrvVDE.cpp \1007 1006 Audio/ossaudio.c \ 1008 1007 Parallel/DrvHostParallel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r28287 r28290 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 */2162 2157 else 2163 2158 attType = attType.arg (vboxGlobal().toString (type)); … … 3118 3113 mNetworkAttachmentTypes [KNetworkAttachmentType_HostOnly] = 3119 3114 tr ("Host-only Adapter", "NetworkAttachmentType"); 3120 /* ENABLE VDE */3121 mNetworkAttachmentTypes [KNetworkAttachmentType_VDE] =3122 tr ("VDE Adapter", "NetworkAttachmentType");3123 /* /ENABLE VDE */3124 3115 3125 3116 mClipboardTypes [KClipboardMode_Disabled] = -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.cpp
r28287 r28290 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 */113 107 default: 114 108 break; … … 151 145 mAdapter.AttachToHostOnlyInterface(); 152 146 break; 153 /* ENABLE VDE */154 case KNetworkAttachmentType_VDE:155 mAdapter.SetVDENetwork (alternativeName());156 mAdapter.AttachToVDE();157 break;158 /* /ENABLE VDE */159 147 default: 160 148 break; … … 269 257 result = mHoiName; 270 258 break; 271 /* ENABLE VDE*/272 case KNetworkAttachmentType_VDE:273 result = mVDEName;274 break;275 /* /ENABLE VDE*/276 259 default: 277 260 break; … … 350 333 mCbAdapterName->setEditable (false); 351 334 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 */359 335 default: 360 336 break; … … 456 432 break; 457 433 } 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 */472 434 default: 473 435 break; … … 586 548 mCbAttachmentType->setItemData (4, 587 549 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 */596 550 597 551 /* Set the old value */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.h
r28287 r28290 77 77 QString mIntName; 78 78 QString mHoiName; 79 /* ENABLE VDE */80 QString mVDEName;81 /* /ENABLE VDE */82 79 83 80 bool mPolished; … … 96 93 QStringList intList (bool aRefresh = false); 97 94 QStringList hoiList (bool aRefresh = false); 98 QStringList vdeList (bool aRefresh = false);99 95 100 96 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsNetwork.ui
r28287 r28290 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> or the switch for <b>VDE</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> attachments.</string> 114 114 </property> 115 115 </widget> -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28287 r28290 3416 3416 } 3417 3417 3418 /* ENABLE VDE */3419 case NetworkAttachmentType_VDE:3420 {3421 hrc = aNetworkAdapter->COMGETTER(VDENetwork)(&str); H();3422 #if 03423 if (str) {3424 Utf8Str strUtf8 = str;3425 LogRel(("VDE Network %s\n",(char *)strUtf8.raw()));3426 }3427 #endif3428 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 3441 3418 default: 3442 3419 AssertMsgFailed(("should not get here!\n")); … … 3456 3433 case NetworkAttachmentType_HostOnly: 3457 3434 case NetworkAttachmentType_NAT: 3458 case NetworkAttachmentType_VDE:3459 3435 { 3460 3436 if (SUCCEEDED(hrc) && SUCCEEDED(rc)) -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r28287 r28290 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 658 612 STDMETHODIMP NetworkAdapter::COMGETTER(CableConnected) (BOOL *aConnected) 659 613 { … … 1093 1047 return S_OK; 1094 1048 } 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->mHostInterface1115 // 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 assume1127 * that the previous attachment will attach correctly1128 * and thus return error along with dettaching all1129 * attachments.1130 */1131 Detach();1132 return rc;1133 }1134 }1135 1136 return S_OK;1137 }1138 1139 /* /ENABLE VDE */1140 1049 1141 1050 STDMETHODIMP NetworkAdapter::Detach() … … 1247 1156 break; 1248 1157 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 1258 1158 case NetworkAttachmentType_Null: 1259 1159 rc = Detach(); … … 1319 1219 case NetworkAttachmentType_HostOnly: 1320 1220 data.strName = mData->mHostInterface; 1321 break;1322 1323 case NetworkAttachmentType_VDE:1324 data.strName = mData->mVDENetwork;1325 1221 break; 1326 1222 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r28289 r28290 11541 11541 <const name="Internal" value="3"/> 11542 11542 <const name="HostOnly" value="4"/> 11543 <!-- ENABLE VDE -->11544 <const name="VDE" value="5"/>11545 <!-- /ENABLE VDE -->11546 11543 </enum> 11547 11544 … … 11646 11643 </attribute> 11647 11644 11648 <!-- ENABLE VDE -->11649 <attribute name="VDENetwork" type="wstring">11650 <desc>11651 Name of the VDE switch the VM is attached to.11652 </desc>11653 </attribute>11654 <!-- /ENABLE VDE -->11655 11656 11645 <attribute name="cableConnected" type="boolean"> 11657 11646 <desc> … … 11719 11708 </desc> 11720 11709 </method> 11721 11722 <!-- ENABLE VDE -->11723 <method name="attachToVDE">11724 <desc>11725 Attach the network adapter to a VDE network.11726 </desc>11727 </method>11728 <!-- /ENABLE VDE -->11729 11710 11730 11711 <method name="detach"> -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r28287 r28290 50 50 mHostInterface("") /* cannot be null */, 51 51 mNATNetwork("") /* cannot be null */ 52 /* ENABLE VDE */53 , mVDENetwork("") /* can be null */54 /* /ENABLE VDE */55 52 {} 56 53 … … 67 64 Bstr mInternalNetwork; 68 65 Bstr mNATNetwork; 69 /* ENABLE VDE */70 Bstr mVDENetwork;71 66 ULONG mBootPriority; 72 67 }; … … 110 105 STDMETHOD(COMGETTER(NATNetwork)) (BSTR *aNATNetwork); 111 106 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 */116 107 STDMETHOD(COMGETTER(CableConnected)) (BOOL *aConnected); 117 108 STDMETHOD(COMSETTER(CableConnected)) (BOOL aConnected); … … 131 122 STDMETHOD(AttachToInternalNetwork)(); 132 123 STDMETHOD(AttachToHostOnlyInterface)(); 133 /* ENABLE VDE */134 STDMETHOD(AttachToVDE)();135 /* /ENABLE VDE */136 124 STDMETHOD(Detach)(); 137 125 -
trunk/src/VBox/Main/xml/Settings.cpp
r28287 r28290 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 name1896 }1897 /* /ENABLE VDE */1898 1891 // else: default is NetworkAttachmentType_Null 1899 1892 … … 3395 3388 break; 3396 3389 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 3405 3390 default: /*case NetworkAttachmentType_Null:*/ 3406 3391 break;
Note:
See TracChangeset
for help on using the changeset viewer.