cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [4/5] sdn hosted vpc gateways (using lswitch)
Date Wed, 18 Sep 2013 15:08:06 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2614b00c/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index eb987ea..f001bf7 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -75,7 +75,7 @@ import com.cloud.utils.db.ScriptRunner;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 
-@Local(value = { SystemIntegrityChecker.class })
+@Local(value = {SystemIntegrityChecker.class})
 public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
     private final Logger s_logger = Logger.getLogger(DatabaseUpgradeChecker.class);
 
@@ -85,114 +85,122 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
 
     public DatabaseUpgradeChecker() {
         _dao = new VersionDaoImpl();
-        _upgradeMap.put("2.1.7", new DbUpgrade[] { new Upgrade217to218(), new Upgrade218to22(),
new Upgrade221to222(),
+        _upgradeMap.put("2.1.7", new DbUpgrade[] {new Upgrade217to218(), new Upgrade218to22(),
new Upgrade221to222(),
                 new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.1.8", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
+        _upgradeMap.put("2.1.8", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
                 new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.1.9", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
+        _upgradeMap.put("2.1.9", new DbUpgrade[] {new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
                 new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.1", new DbUpgrade[] { new Upgrade221to222(), new UpgradeSnapshot223to224(),
new Upgrade222to224(),
+        _upgradeMap.put("2.2.1", new DbUpgrade[] {new Upgrade221to222(), new UpgradeSnapshot223to224(),
new Upgrade222to224(),
                 new Upgrade224to225(), new Upgrade225to226(), new Upgrade227to228(), new
Upgrade228to229(),
                 new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
+                new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.2", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
+        _upgradeMap.put("2.2.2", new DbUpgrade[] {new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
                 new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new
Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.3", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
+        _upgradeMap.put("2.2.3", new DbUpgrade[] {new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
                 new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new
Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.4", new DbUpgrade[] { new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(),
+        _upgradeMap.put("2.2.4", new DbUpgrade[] {new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(),
                 new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(), new
Upgrade2211to2212(),
                 new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.5", new DbUpgrade[] { new Upgrade225to226(), new Upgrade227to228(),
new Upgrade228to229(),
+        _upgradeMap.put("2.2.5", new DbUpgrade[] {new Upgrade225to226(), new Upgrade227to228(),
new Upgrade228to229(),
                 new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
                 new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(),
-                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
+                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.6", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
+        _upgradeMap.put("2.2.6", new DbUpgrade[] {new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.7", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
+        _upgradeMap.put("2.2.7", new DbUpgrade[] {new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
+                new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.8", new DbUpgrade[] { new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(),
+        _upgradeMap.put("2.2.8", new DbUpgrade[] {new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30()
-        , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
+                , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new
Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.9", new DbUpgrade[] { new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(),
+        _upgradeMap.put("2.2.9", new DbUpgrade[] {new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(),
                 new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.10", new DbUpgrade[] { new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
+        _upgradeMap.put("2.2.10", new DbUpgrade[] {new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
+                new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.11", new DbUpgrade[] { new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+        _upgradeMap.put("2.2.11", new DbUpgrade[] {new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.12", new DbUpgrade[] { new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
+        _upgradeMap.put("2.2.12", new DbUpgrade[] {new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.13", new DbUpgrade[] { new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+        _upgradeMap.put("2.2.13", new DbUpgrade[] {new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("2.2.14", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
-        
-        
+        _upgradeMap.put("2.2.14", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
+                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("3.0.0", new DbUpgrade[] { new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+        _upgradeMap.put("3.0.0", new DbUpgrade[] {new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
+                new Upgrade420to430()});
 
-        _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
+        _upgradeMap.put("3.0.1", new DbUpgrade[] {new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
+        _upgradeMap.put("3.0.2", new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430()});
 
-        _upgradeMap.put("4.0.0", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("4.0.1", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("4.0.2", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
+        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430()});
 
-        _upgradeMap.put("4.1.0", new DbUpgrade[] { new Upgrade410to420(), new Upgrade420to430()
});
+        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to430()});
+
+        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to430()});
+
+        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to430()});
 
-        _upgradeMap.put("4.2.0", new DbUpgrade[] { new Upgrade420to430() });
-        
         //CP Upgrades
-        _upgradeMap.put("3.0.3", new DbUpgrade[] { new Upgrade303to304(), new Upgrade304to305(),
new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to430() });
-        
-        _upgradeMap.put("3.0.4", new DbUpgrade[] { new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to430()
});
-        
-        _upgradeMap.put("3.0.5", new DbUpgrade[] { new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to430() });
-        
-        _upgradeMap.put("3.0.6", new DbUpgrade[] { new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to430() });
-        
-        _upgradeMap.put("3.0.7", new DbUpgrade[] { new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to430() });
-        
-        _upgradeMap.put("2.2.15", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420(), new
Upgrade420to430()});
-        
-        _upgradeMap.put("2.2.16", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420(), new
Upgrade420to430()});
+        _upgradeMap.put("3.0.3", new DbUpgrade[] {new Upgrade303to304(), new Upgrade304to305(),
new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(),
+                new Upgrade410to420(), new Upgrade420to430()});
+
+        _upgradeMap.put("3.0.4", new DbUpgrade[] {new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
+                new Upgrade420to430()});
+
+        _upgradeMap.put("3.0.5", new DbUpgrade[] {new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to430()});
+
+        _upgradeMap.put("3.0.6", new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to430()});
+
+        _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to430()});
+
+        _upgradeMap.put("2.2.15", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
+                new Upgrade420to430()});
+
+        _upgradeMap.put("2.2.16", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
+                new Upgrade420to430()});
     }
 
     protected void runScript(Connection conn, File file) {
@@ -225,8 +233,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         }
 
         if (Version.compare(trimmedCurrentVersion, upgrades[upgrades.length - 1].getUpgradedVersion())
!= 0) {
-            s_logger.error("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion() + " but our management server code version is at " + currentVersion);
-            throw new CloudRuntimeException("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion() + " but our management server code version is at "
+            s_logger.error("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion() + " but our management server code version is at "
+                    + currentVersion);
+            throw new CloudRuntimeException("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion()
+                    + " but our management server code version is at "
                     + currentVersion);
         }
 
@@ -241,11 +251,13 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         if (!supportsRollingUpgrade && false) { // FIXME: Needs to detect if there
are management servers running
                                                 // ClusterManagerImpl.arePeersRunning(null))
{
             s_logger.error("Unable to run upgrade because the upgrade sequence does not support
rolling update and there are other management server nodes running");
-            throw new CloudRuntimeException("Unable to run upgrade because the upgrade sequence
does not support rolling update and there are other management server nodes running");
+            throw new CloudRuntimeException(
+                    "Unable to run upgrade because the upgrade sequence does not support
rolling update and there are other management server nodes running");
         }
 
         for (DbUpgrade upgrade : upgrades) {
-            s_logger.debug("Running upgrade " + upgrade.getClass().getSimpleName() + " to
upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-" + upgrade.getUpgradableVersionRange()[1]
+            s_logger.debug("Running upgrade " + upgrade.getClass().getSimpleName() + " to
upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-"
+                    + upgrade.getUpgradableVersionRange()[1]
                     + " to " + upgrade.getUpgradedVersion());
             Transaction txn = Transaction.open("Upgrade");
             txn.start();
@@ -289,10 +301,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
                 }
 
                 txn.commit();
-            } catch (CloudRuntimeException e){
+            } catch (CloudRuntimeException e) {
                 s_logger.error("Unable to upgrade the database", e);
                 throw new CloudRuntimeException("Unable to upgrade the database", e);
-            }finally {
+            } finally {
                 txn.close();
             }
         }
@@ -375,7 +387,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
                     currentVersion = this.getClass().getSuperclass().getPackage().getImplementationVersion();
                 }
 
-                if ( currentVersion == null )
+                if (currentVersion == null)
                     return;
 
                 s_logger.info("DB version = " + dbVersion + " Code Version = " + currentVersion);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2614b00c/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
index 56bbb28..7871377 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
@@ -57,7 +57,7 @@ import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Local(value = { NetworkGuru.class })
+@Local(value = {NetworkGuru.class})
 public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
     private static final Logger s_logger = Logger.getLogger(BaremetaNetworkGuru.class);
     @Inject

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2614b00c/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
index c94856d..2f79576 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
@@ -42,7 +42,7 @@ public class BridgeVifDriver extends VifDriverBase {
     private static final Logger s_logger = Logger
             .getLogger(BridgeVifDriver.class);
     private int _timeout;
-    
+
     private static final Object _vnetBridgeMonitor = new Object();
     private String _modifyVlanPath;
 
@@ -54,13 +54,12 @@ public class BridgeVifDriver extends VifDriverBase {
         // Set the domr scripts directory
         params.put("domr.scripts.dir", "scripts/network/domr/kvm");
 
-
-        String networkScriptsDir = (String) params.get("network.scripts.dir");
+        String networkScriptsDir = (String)params.get("network.scripts.dir");
         if (networkScriptsDir == null) {
             networkScriptsDir = "scripts/vm/network/vnet";
         }
 
-        String value = (String) params.get("scripts.timeout");
+        String value = (String)params.get("scripts.timeout");
         _timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
 
         _modifyVlanPath = Script.findScript(networkScriptsDir, "modifyvlan.sh");
@@ -94,10 +93,10 @@ public class BridgeVifDriver extends VifDriverBase {
         }
         String trafficLabel = nic.getName();
         if (nic.getType() == Networks.TrafficType.Guest) {
-            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1)? nic.getNetworkRateMbps().intValue() * 128: 0;
+            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null && !trafficLabel.isEmpty()) {
+                if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for guest traffic per
traffic label " + trafficLabel);
                     String brName = createVlanBr(vlanId, _pifs.get(trafficLabel));
                     intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
@@ -113,10 +112,10 @@ public class BridgeVifDriver extends VifDriverBase {
             createControlNetwork();
             intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType));
         } else if (nic.getType() == Networks.TrafficType.Public) {
-            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1)? nic.getNetworkRateMbps().intValue() * 128: 0;
+            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null && !trafficLabel.isEmpty()){
+                if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for public traffic per
traffic label " + trafficLabel);
                     String brName = createVlanBr(vlanId, _pifs.get(trafficLabel));
                     intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
@@ -143,7 +142,7 @@ public class BridgeVifDriver extends VifDriverBase {
     }
 
     private String setVnetBrName(String pifName, String vnetId) {
-        String brName = "br" + pifName + "-"+ vnetId;
+        String brName = "br" + pifName + "-" + vnetId;
         String oldStyleBrName = "cloudVirBr" + vnetId;
 
         String cmdout = Script.runSimpleBashScript("brctl show | grep " + oldStyleBrName);
@@ -170,7 +169,7 @@ public class BridgeVifDriver extends VifDriverBase {
             command.add("-p", pif);
             command.add("-b", brName);
             command.add("-o", "add");
-            
+
             final String result = command.execute();
             if (result != null) {
                 throw new InternalErrorException("Failed to create vnet " + vnetId
@@ -178,20 +177,20 @@ public class BridgeVifDriver extends VifDriverBase {
             }
         }
     }
-    
-    private void deleteVnetBr(String brName){
+
+    private void deleteVnetBr(String brName) {
         synchronized (_vnetBridgeMonitor) {
             String cmdout = Script.runSimpleBashScript("ls /sys/class/net/" + brName + "/brif
| grep vnet");
             if (cmdout != null && cmdout.contains("vnet")) {
                 // Active VM remains on that bridge
                 return;
             }
-            
+
             Pattern oldStyleBrNameRegex = Pattern.compile("^cloudVirBr(\\d+)$");
             Pattern brNameRegex = Pattern.compile("^br(\\S+)-(\\d+)$");
             Matcher oldStyleBrNameMatcher = oldStyleBrNameRegex.matcher(brName);
             Matcher brNameMatcher = brNameRegex.matcher(brName);
-            
+
             String pName = null;
             String vNetId = null;
             if (oldStyleBrNameMatcher.find()) {
@@ -199,25 +198,25 @@ public class BridgeVifDriver extends VifDriverBase {
                 pName = "undefined";
                 vNetId = oldStyleBrNameMatcher.group(1);
             } else if (brNameMatcher.find()) {
-                if(brNameMatcher.group(1) != null || !brNameMatcher.group(1).isEmpty()) {
+                if (brNameMatcher.group(1) != null || !brNameMatcher.group(1).isEmpty())
{
                     pName = brNameMatcher.group(1);
                 } else {
                     pName = "undefined";
                 }
                 vNetId = brNameMatcher.group(2);
             }
-            
+
             if (vNetId == null || vNetId.isEmpty()) {
-                s_logger.debug("unable to get a vNet ID from name "+ brName);
+                s_logger.debug("unable to get a vNet ID from name " + brName);
                 return;
             }
-            
+
             final Script command = new Script(_modifyVlanPath, _timeout, s_logger);
             command.add("-o", "delete");
             command.add("-v", vNetId);
             command.add("-p", pName);
             command.add("-b", brName);
-            
+
             final String result = command.execute();
             if (result != null) {
                 s_logger.debug("Delete bridge " + brName + " failed: " + result);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2614b00c/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 203587a..74f02c0 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1720,15 +1720,15 @@ ServerResource {
     	return new Answer(cmd, true, result);
     }
 
-    private void VifHotPlug(Connect conn, String vmName, String vlanId,
+    private void VifHotPlug(Connect conn, String vmName, String broadcastUri,
             String macAddr) throws InternalErrorException, LibvirtException {
         NicTO nicTO = new NicTO();
         nicTO.setMac(macAddr);
         nicTO.setType(TrafficType.Public);
-        if (vlanId == null) {
+        if (broadcastUri == null) {
             nicTO.setBroadcastType(BroadcastDomainType.Native);
         } else {
-            URI uri = BroadcastDomainType.fromString(vlanId);
+            URI uri = BroadcastDomainType.fromString(broadcastUri);
             nicTO.setBroadcastType(BroadcastDomainType.getSchemeValue(uri));
             nicTO.setBroadcastUri(uri);
         }
@@ -1908,7 +1908,7 @@ ServerResource {
         try {
             conn = LibvirtConnection.getConnectionByVmName(routerName);
             Integer devNum = 0;
-            String pubVlan = pubIP.getVlanId();
+            String pubVlan = pubIP.getBroadcastUri();
             List<InterfaceDef> pluggedNics = getInterfaces(conn, routerName);
 
             for (InterfaceDef pluggedNic : pluggedNics) {
@@ -1972,7 +1972,7 @@ ServerResource {
             }
 
             for (IpAddressTO ip : ips) {
-                String nicName = "eth" + vlanToNicNum.get(ip.getVlanId());
+                String nicName = "eth" + vlanToNicNum.get(ip.getBroadcastUri());
                 String netmask = Long.toString(NetUtils.getCidrSize(ip.getVlanNetmask()));
                 String subnet = NetUtils.getSubNet(ip.getPublicIp(), ip.getVlanNetmask());
                 _virtRouterResource.assignVpcIpToRouter(routerIP, ip.isAdd(), ip.getPublicIp(),
@@ -2023,18 +2023,18 @@ ServerResource {
             int nicNum = 0;
             boolean newNic = false;
             for (IpAddressTO ip : ips) {
-                if (!vlanAllocatedToVM.containsKey(ip.getVlanId())) {
+                if (!vlanAllocatedToVM.containsKey(ip.getBroadcastUri())) {
                     /* plug a vif into router */
-                    VifHotPlug(conn, routerName, ip.getVlanId(),
+                    VifHotPlug(conn, routerName, ip.getBroadcastUri(),
                             ip.getVifMacAddress());
-                    vlanAllocatedToVM.put(ip.getVlanId(), nicPos++);
+                    vlanAllocatedToVM.put(ip.getBroadcastUri(), nicPos++);
                     newNic = true;
                 }
-                nicNum = vlanAllocatedToVM.get(ip.getVlanId());
+                nicNum = vlanAllocatedToVM.get(ip.getBroadcastUri());
                 networkUsage(routerIp, "addVif", "eth" + nicNum);
                 result = _virtRouterResource.assignPublicIpAddress(routerName,
                         routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(),
-                        ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(),
+                        ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(),
                         ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum, newNic);
 
                 if (result != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2614b00c/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
index 119f117..4ddec13 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
@@ -37,17 +37,17 @@ import com.cloud.utils.script.Script;
 public class OvsVifDriver extends VifDriverBase {
     private static final Logger s_logger = Logger.getLogger(OvsVifDriver.class);
     private int _timeout;
-    
+
     @Override
     public void configure(Map<String, Object> params) throws ConfigurationException
{
         super.configure(params);
 
-        String networkScriptsDir = (String) params.get("network.scripts.dir");
+        String networkScriptsDir = (String)params.get("network.scripts.dir");
         if (networkScriptsDir == null) {
             networkScriptsDir = "scripts/vm/network/vnet";
         }
 
-        String value = (String) params.get("scripts.timeout");
+        String value = (String)params.get("scripts.timeout");
         _timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
 
         createControlNetwork(_bridges.get("linklocal"));
@@ -60,7 +60,7 @@ public class OvsVifDriver extends VifDriverBase {
 
         LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
         intf.setVirtualPortType("openvswitch");
-        
+
         String vlanId = null;
         String logicalSwitchUuid = null;
         if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan) {
@@ -74,10 +74,10 @@ public class OvsVifDriver extends VifDriverBase {
         }
         String trafficLabel = nic.getName();
         if (nic.getType() == Networks.TrafficType.Guest) {
-            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1)? nic.getNetworkRateMbps().intValue() * 128: 0;
+            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if ((nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan || nic.getBroadcastType()
== Networks.BroadcastDomainType.Pvlan)
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null && !trafficLabel.isEmpty()) {
+                if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for guest traffic per
traffic label " + trafficLabel);
                     intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
@@ -99,10 +99,10 @@ public class OvsVifDriver extends VifDriverBase {
             createControlNetwork(_bridges.get("linklocal"));
             intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType));
         } else if (nic.getType() == Networks.TrafficType.Public) {
-            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1)? nic.getNetworkRateMbps().intValue() * 128: 0;
+            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null && !trafficLabel.isEmpty()){
+                if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for public traffic per
traffic label " + trafficLabel);
                     intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
@@ -128,18 +128,6 @@ public class OvsVifDriver extends VifDriverBase {
         // Libvirt apparently takes care of this, see BridgeVifDriver unplug
     }
 
-    private String setVnetBrName(String pifName, String vnetId) {
-        String brName = "br" + pifName + "-"+ vnetId;
-        String oldStyleBrName = "cloudVirBr" + vnetId;
-
-        if (isBridgeExists(oldStyleBrName)) {
-            s_logger.info("Using old style bridge name for vlan " + vnetId + " because existing
bridge " + oldStyleBrName + " was found");
-            brName = oldStyleBrName;
-        }
-
-        return brName;
-    }
-    
     private void deleteExitingLinkLocalRouteTable(String linkLocalBr) {
         Script command = new Script("/bin/bash", _timeout);
         command.add("-c");


Mime
View raw message