Changeset 65 for trunk/packages


Ignore:
Timestamp:
Aug 7, 2007, 11:08:38 PM (17 years ago)
Author:
nelhage
svk:copy_cache_prev:
62
Message:

Filling in the gaps in conf.py. This is completely untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/conf.py

    r24 r65  
    44
    55machine = models.Machine.get_by(name=name)
    6 
     6machine_type = models.Type.get_by(type_id=machine.type_id)
    77
    88memory = machine.memory
     
    1313vcpus = machine.cpus
    1414
    15 # XXX TODO deal with vifs
     15diskioemu = ""
     16viftype = ""
     17
     18if machine_type.hvm:
     19    ioemu = "ioemu:"
     20    viftype = "type=ioemu"
     21
     22    kernel = 'hvmloader'
     23    builder = 'hvm'
     24    vnc = 1
     25    device_model = 'qemu-dm'
     26else:
     27    kernel  = '/boot/vmlinuz-2.6.18-4-xen-amd64'
     28    ramdisk = '/boot/initrd.img-2.6.18-4-xen-amd64'
     29    builder = 'linux'
     30
     31pae = machine_type.pae
     32acpi = machine_type.acpi
     33apic = machine_type.apic
     34
     35vif = []
     36
     37for n in machine.nics:
     38    d = '%s, mac=%s, ip=%s, bridge=xenbr0' % (viftype, n.mac_addr, n.ip)
     39    vif.append(disk)
    1640
    1741disk = []
    1842
    1943for d in machine.disks:
    20     dspec = 'phy:xenvg/%s,%s,w' % (???, d.guest_device_name)
     44    device = 'xenvg/' + machine.name + '_' + d.guest_device_name
     45    dspec = 'phy:%s,%s%s,w' % (device, diskioemu, d.guest_device_name)
    2146    disk.append(dspec)
    2247
Note: See TracChangeset for help on using the changeset viewer.