# HG changeset patch # User igor # Date 1203622880 -7200 # Node ID e838c1223b89f21307f486298f2207fc0a8e270e # Parent 6471afbee150e608b9c87e1fa13680ef9a39bfc8 Делаются какие-то попытки интегрировать в Xentaur управление разнообразными доменами. diff -r 6471afbee150 -r e838c1223b89 xendomain.py --- a/xendomain.py Mon Dec 03 08:36:13 2007 +0200 +++ b/xendomain.py Thu Feb 21 21:41:20 2008 +0200 @@ -91,7 +91,22 @@ #builder='linux' cpu_cap = 10 +hvm = 0 +if domain_types[N] in ['freebsd','windows']: + hvm = 1 +if hvm: + kernel = "hvmloader" + builder='hvm' + shadow_memory = 8 + device_model = 'qemu-dm' + boot="c" + sdl=0 + vnc=1 + vncpasswd='' + stdvga=0 + serial='pty' + usb=1 for br in bridges: @@ -107,16 +122,32 @@ vif=[] x=1 for i in vbridges: - vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) + if hvm: + vif.append('bridge='+i+',type=ioemu,mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) + else: + vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) x+=1 -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' ] +if domain_types[N] in ['xenomips','quagga','dynamips','pixemu']: + 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' ] +else: + if hvm: + if domain_types[N] == 'linux': + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda,w' ] + else: + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda,w', 'file:/xen/xentaur-images/'+network+'/'+name+'-disk2.img,hdb,w' ] + + else: + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda1,w' ] + root = "/dev/hda1 ro" if domain_types[N] == 'quagga': memory = 64 +elif domain_types[N] == 'linux': + memory = 550 else: - memory = 400 + memory = 300 if len(domain_subtypes) >0 and domain_subtypes[N] != '' and platform == '': platform=domain_subtypes[N] @@ -162,7 +193,8 @@ xenomips="./pemu -net nic,vlan=1,macaddr=00:aa:00:00:02:01 -net pcap,vlan=1,ifname=eth0 -net nic,vlan=2,macaddr=00:aa:00:00:02:02 -net pcap,vlan=2,ifname=eth1 -serial stdio -m 128 FLASH"+' /xenomips/ios/'+ios_name extra = "xenomips=\""+xenomips+"\"" else: - raise "Unknown domain type %s of domain %s " % (domain_types[N], domains[N]) + if not domain_types[N] in ['freebsd','windows','linux'] : + raise "Unknown domain type %s of domain %s " % (domain_types[N], domains[N]) on_poweroff = 'destroy' on_reboot = 'restart' diff -r 6471afbee150 -r e838c1223b89 xentaur.py --- a/xentaur.py Mon Dec 03 08:36:13 2007 +0200 +++ b/xentaur.py Thu Feb 21 21:41:20 2008 +0200 @@ -13,8 +13,9 @@ link_object={} bridge_object={} -network='mini' -domain='dyn1' +network='ids2007dec' +domain='fbsd1' + #network='snrs' #domain='dyn1' from xendomain import * @@ -365,7 +366,7 @@ return self.name+" [color=white,shape=plaintext,label=\" "+self.name+"\",shapefile=\"shapes/all/"+\ domain_types[domains.index(self.name)]+".png\",fontcolor=black,fontsize=16,target=\"http://google.com\"]" def console_string(self): - if self.type == 'quagga' or self.type == 'xenomips': + if self.type in [ 'quagga', 'xenomips', 'freebsd', 'linux' ]: return "sudo xm console "+self.name elif self.name in real_bridges or self.name in real_nodes: return "echo Press enter to connect; read line; "+connection_table[self.name]