xentaur

diff xendomain.py @ 59:9d54d94a7dff

minifixes
author igor
date Sun Nov 11 19:46:27 2007 +0200 (2007-11-11)
parents 58381d1fe31b
children e7b9761c03e8
line diff
     1.1 --- a/xendomain.py	Sun Nov 11 19:22:52 2007 +0200
     1.2 +++ b/xendomain.py	Sun Nov 11 19:46:27 2007 +0200
     1.3 @@ -42,7 +42,7 @@
     1.4  ############################
     1.5  
     1.6  def process_domains_brief():
     1.7 -    global domains, domain_types, real_nodes, domain_notes
     1.8 +    global domains, domain_types, real_nodes, domain_notes, domain_subtypes
     1.9      node_brief_re=re.compile('([a-zA-Z_0-9-]*)(?::([a-zA-Z_0-9-]*))?(?::([a-zA-Z_0-9-]*))?(\*?)(?:#(.*))?')
    1.10      if len(domains)==0:
    1.11          domains=map(lambda x:node_brief_re.search(x).groups()[0] or '', domains_brief)
    1.12 @@ -68,7 +68,7 @@
    1.13  
    1.14  process_domains_brief()
    1.15  
    1.16 -N = str(domains.index(domain))
    1.17 +N = domains.index(domain)
    1.18  name=domain
    1.19  
    1.20  pae=1
    1.21 @@ -82,6 +82,9 @@
    1.22  #builder='linux'
    1.23  cpu_cap = 10
    1.24  
    1.25 +
    1.26 +
    1.27 +
    1.28  for br in bridges:
    1.29      if not br in vbridges_table.keys():
    1.30          vbridges_table[br]=[]
    1.31 @@ -95,16 +98,21 @@
    1.32  vif=[]
    1.33  x=1
    1.34  for i in vbridges:
    1.35 - vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
    1.36 + vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:])
    1.37   x+=1
    1.38  
    1.39 -disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+N+'.img,hda3,w' ]
    1.40 +disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+str(N)+'.img,hda3,w' ]
    1.41  root = "/dev/hda1 ro"
    1.42  
    1.43 +if domain_types[N] == 'quagga':
    1.44 +    memory = 64
    1.45 +else:
    1.46 +    memory = 400
    1.47 +
    1.48  if domain_subtypes[N] != '' and platform == '':
    1.49      platform=domain_subtypes[N]
    1.50  
    1.51 -if platform = '': 
    1.52 +if platform == '': 
    1.53      platform='7200'
    1.54  platform_option=""
    1.55  if platform != '7200':
    1.56 @@ -114,7 +122,7 @@
    1.57  if platform == '7200':
    1.58      npe_option=" -t "+npe_type
    1.59  
    1.60 -mac_option=' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
    1.61 +mac_option=' -m 00:16:3e:01:'+hex(N)[2:]+':01'
    1.62  if platform != '7200':
    1.63      mac_option =''
    1.64  
    1.65 @@ -140,7 +148,7 @@
    1.66  for i in range(len(vbridges)):
    1.67   xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
    1.68  
    1.69 -if domain_types[int(N)] == 'quagga':
    1.70 +if domain_types[N] == 'quagga':
    1.71      extra = "quagga"
    1.72  else:
    1.73      extra = "xenomips=\""+xenomips+"\""