Changeset 36082 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Feb 25, 2011 12:21:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r35885 r36082 1459 1459 { 1460 1460 return ( (this == &n) 1461 || ( (ulSlot == n.ulSlot) 1462 && (type == n.type) 1463 && (fEnabled == n.fEnabled) 1464 && (strMACAddress == n.strMACAddress) 1465 && (fCableConnected == n.fCableConnected) 1466 && (ulLineSpeed == n.ulLineSpeed) 1467 && (fTraceEnabled == n.fTraceEnabled) 1468 && (strTraceFile == n.strTraceFile) 1469 && (mode == n.mode) 1470 && (nat == n.nat) 1471 && (strName == n.strName) 1472 && (ulBootPriority == n.ulBootPriority) 1473 && (fHasDisabledNAT == n.fHasDisabledNAT) 1461 || ( (ulSlot == n.ulSlot) 1462 && (type == n.type) 1463 && (fEnabled == n.fEnabled) 1464 && (strMACAddress == n.strMACAddress) 1465 && (fCableConnected == n.fCableConnected) 1466 && (ulLineSpeed == n.ulLineSpeed) 1467 && (enmPromiscModePolicy == n.enmPromiscModePolicy) 1468 && (fTraceEnabled == n.fTraceEnabled) 1469 && (strTraceFile == n.strTraceFile) 1470 && (mode == n.mode) 1471 && (nat == n.nat) 1472 && (strName == n.strName) 1473 && (ulBootPriority == n.ulBootPriority) 1474 && (fHasDisabledNAT == n.fHasDisabledNAT) 1474 1475 ) 1475 1476 ); … … 1932 1933 pelmAdapter->getAttributeValue("cable", nic.fCableConnected); 1933 1934 pelmAdapter->getAttributeValue("speed", nic.ulLineSpeed); 1935 1936 if (pelmAdapter->getAttributeValue("promiscuousModePolicy", strTemp)) 1937 { 1938 if (strTemp == "Deny") 1939 nic.enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_Deny; 1940 else if (strTemp == "AllowNetwork") 1941 nic.enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowNetwork; 1942 else if (strTemp == "AllowAll") 1943 nic.enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowAll; 1944 else 1945 throw ConfigFileError(this, pelmAdapter, 1946 N_("Invalid value '%s' in Adapter/@promiscuousModePolicy attribute"), strTemp.c_str()); 1947 } 1948 1934 1949 pelmAdapter->getAttributeValue("trace", nic.fTraceEnabled); 1935 1950 pelmAdapter->getAttributeValue("tracefile", nic.strTraceFile); … … 3687 3702 pelmAdapter->setAttribute("bandwidthLimit", nic.ulBandwidthLimit); 3688 3703 3704 const char *pszPolicy; 3705 switch (nic.enmPromiscModePolicy) 3706 { 3707 case NetworkAdapterPromiscModePolicy_Deny: pszPolicy = NULL; break; 3708 case NetworkAdapterPromiscModePolicy_AllowNetwork: pszPolicy = "AllowNetwork"; break; 3709 case NetworkAdapterPromiscModePolicy_AllowAll: pszPolicy = "AllowAll"; break; 3710 default: pszPolicy = NULL; AssertFailed(); break; 3711 } 3712 if (pszPolicy) 3713 pelmAdapter->setAttribute("promiscuousModePolicy", pszPolicy); 3714 3689 3715 const char *pcszType; 3690 3716 switch (nic.type) … … 4469 4495 if (m->sv < SettingsVersion_v1_12) 4470 4496 { 4471 // VirtualBox 4.1 adds PCI passthrough 4497 // VirtualBox 4.1 adds PCI passthrough. 4472 4498 if (hardwareMachine.pciAttachments.size()) 4473 4499 m->sv = SettingsVersion_v1_12; 4500 4501 // VirtualBox 4.1 adds a promiscuous mode policy to the network adapters. 4502 NetworkAdaptersList::const_iterator netit; 4503 for (netit = hardwareMachine.llNetworkAdapters.begin(); 4504 netit != hardwareMachine.llNetworkAdapters.end(); 4505 ++netit) 4506 { 4507 if (netit->enmPromiscModePolicy != NetworkAdapterPromiscModePolicy_Deny) 4508 { 4509 m->sv = SettingsVersion_v1_12; 4510 break; 4511 } 4512 } 4474 4513 } 4475 4514
Note:
See TracChangeset
for help on using the changeset viewer.