incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1294401 - /incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py
Date Mon, 27 Feb 2012 23:52:52 GMT
Author: stroucki
Date: Mon Feb 27 23:52:51 2012
New Revision: 1294401

URL: http://svn.apache.org/viewvc?rev=1294401&view=rev
Log:
prevent more than one interface being assigned to a vlan

Modified:
    incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1294401&r1=1294400&r2=1294401&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/branches/stroucki-tashi11/src/tashi/nodemanager/vmcontrol/qemu.py Mon
Feb 27 23:52:51 2012
@@ -501,7 +501,13 @@ class Qemu(VmControlInterface):
 		nicModel = self.__stripSpace(nicModel)
 
 		nicString = ""
+		nicNetworks = {}
 		for i in range(0, len(instance.nics)):
+			# Don't allow more than one interface per vlan
+			if nicNetworks.has_key(nic.network):
+				continue
+			nicNetworks[nic.network] = True
+
 			nic = instance.nics[i]
 			nicString = nicString + "-net nic,macaddr=%s,model=%s,vlan=%d -net tap,ifname=%s%d.%d,vlan=%d,script=/etc/qemu-ifup.%d
" % (nic.mac, nicModel, nic.network, self.ifPrefix, instance.id, i, nic.network, nic.network)
 



Mime
View raw message