Moti Asayag has uploaded a new change for review.

Change subject: engine: Modify EnableMACAntiSpoofing version to general
......................................................................

engine: Modify EnableMACAntiSpoofing version to general

There used to be a mix in the declaration and usage of
MacAntiSpoofingFilterRulesSupported configuration value
which allowed the user to determine in which cluster
level the feature should be used. This should be determined
by the engine itself and not by the user.

Therefore the versioning is removed from this parameter
which will define for the entire system if no-mac-spoofing
filter should be applied to running vms or not.

Change-Id: Ia2c7659844318dd38241a6ae56895ca3c4bf91cf
ug-Url: https://bugzilla.redhat.com/1063711
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/FeatureSupported.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
4 files changed, 16 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/24570/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/FeatureSupported.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/FeatureSupported.java
index fe72eb1..cccdaa6 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/FeatureSupported.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/FeatureSupported.java
@@ -74,7 +74,7 @@
      * @return <code>true</code> if anti MAC spoofing is supported for the 
version, <code>false</code> if it's not.
      */
     public static boolean antiMacSpoofing(Version version) {
-        return 
supportedInConfig(ConfigValues.EnableMACAntiSpoofingFilterRules, version);
+        return 
supportedInConfig(ConfigValues.MacAntiSpoofingFilterRulesSupported, version);
     }
 
     /**
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index 9a71fb3..757c36b 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -1118,6 +1118,11 @@
     @TypeConverterAttribute(Boolean.class)
     @DefaultValueAttribute("true")
     EnableMACAntiSpoofingFilterRules,
+
+    @TypeConverterAttribute(Boolean.class)
+    @DefaultValueAttribute("true")
+    MacAntiSpoofingFilterRulesSupported,
+
     // Gluster peer status command
     @TypeConverterAttribute(String.class)
     @DefaultValueAttribute("gluster peer status --xml")
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
index 5ec0ee1..fceeccc 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
@@ -11,7 +11,6 @@
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.common.FeatureSupported;
-import org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory;
 import org.ovirt.engine.core.common.businessentities.Disk;
 import org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType;
 import org.ovirt.engine.core.common.businessentities.DiskImage;
@@ -31,6 +30,8 @@
 import org.ovirt.engine.core.common.businessentities.network.VmInterfaceType;
 import org.ovirt.engine.core.common.businessentities.network.VmNic;
 import org.ovirt.engine.core.common.businessentities.network.VnicProfile;
+import org.ovirt.engine.core.common.config.Config;
+import org.ovirt.engine.core.common.config.ConfigValues;
 import org.ovirt.engine.core.common.osinfo.OsRepository;
 import org.ovirt.engine.core.common.utils.SimpleDependecyInjector;
 import org.ovirt.engine.core.common.utils.VmDeviceCommonUtils;
@@ -38,6 +39,7 @@
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
+import org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory;
 import 
org.ovirt.engine.core.vdsbroker.architecture.CreateAdditionalControllers;
 import org.ovirt.engine.core.vdsbroker.architecture.GetControllerIndices;
 import org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils;
@@ -686,7 +688,8 @@
     }
 
     public static void addNetworkFiltersToNic(Map<String, Object> struct, 
Version clusterVersion) {
-        if (FeatureSupported.antiMacSpoofing(clusterVersion)) {
+        if (FeatureSupported.antiMacSpoofing(clusterVersion)
+                && Config.<Boolean> 
getValue(ConfigValues.EnableMACAntiSpoofingFilterRules)) {
             struct.put(VdsProperties.NW_FILTER, 
NetworkFilters.NO_MAC_SPOOFING.getFilterName());
         }
     }
diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql 
b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 3448a89..85c7d9a 100644
--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -360,8 +360,9 @@
 select fn_db_add_config_value('NumberVmRefreshesBeforeSave','5','general');
 select fn_db_add_config_value('SupportBridgesReportByVDSM','false','3.0');
 select fn_db_add_config_value('SupportBridgesReportByVDSM','false','3.1');
-select fn_db_add_config_value('EnableMACAntiSpoofingFilterRules','false', 
'3.0');
-select fn_db_add_config_value('EnableMACAntiSpoofingFilterRules','false', 
'3.1');
+select fn_db_add_config_value('MacAntiSpoofingFilterRulesSupported','false', 
'3.0');
+select fn_db_add_config_value('MacAntiSpoofingFilterRulesSupported','false', 
'3.1');
+select fn_db_add_config_value('EnableMACAntiSpoofingFilterRules','true', 
'general');
 select fn_db_add_config_value('GlusterFsStorageEnabled','false','3.0');
 select fn_db_add_config_value('GlusterFsStorageEnabled','false','3.1');
 select fn_db_add_config_value('GlusterFsStorageEnabled','false','3.2');
@@ -901,6 +902,8 @@
 select fn_db_delete_config_value('AverageToBurstRatio','general');
 select fn_db_delete_config_value('DocsURL','general');
 select fn_db_delete_config_value('VirtIoScsiUnsupportedOsList','general');
+select fn_db_delete_config_value('EnableMACAntiSpoofingFilterRules', '3.0');
+select fn_db_delete_config_value('EnableMACAntiSpoofingFilterRules', '3.1');
 
------------------------------------------------------------------------------------
 --                  Split config section
 -- The purpose of this section is to treat config option that was once


-- 
To view, visit http://gerrit.ovirt.org/24570
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2c7659844318dd38241a6ae56895ca3c4bf91cf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to