ia64/xen-unstable

changeset 10733:6d8f2d78d7c8

Update xend to support network configuration for qemu 0.8.1 based ioemu.
Remove the ne2000 option, the network device type can now be selected
on a per-device basis by adding a model= property to the device's entry
in the vif list.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Wed Jul 12 19:16:12 2006 +0100 (2006-07-12)
parents b450f21472a0
children a70c4f9657cc
files tools/examples/xmexample.hvm tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/examples/xmexample.hvm	Wed Jul 12 19:16:10 2006 +0100
     1.2 +++ b/tools/examples/xmexample.hvm	Wed Jul 12 19:16:12 2006 +0100
     1.3 @@ -54,7 +54,7 @@ name = "ExampleHVMDomain"
     1.4  
     1.5  # Optionally define mac and/or bridge for the network interfaces.
     1.6  # Random MACs are assigned if not given.
     1.7 -#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0' ]
     1.8 +#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
     1.9  # type=ioemu specify the NIC is an ioemu device not netfront
    1.10  vif = [ 'type=ioemu, bridge=xenbr0' ]
    1.11  
    1.12 @@ -146,10 +146,6 @@ stdvga=0
    1.13  #   then xm console or minicom can connect
    1.14  serial='pty'
    1.15  
    1.16 -#----------------------------------------------------------------------------
    1.17 -# enable ne2000, default = 0(use pcnet)
    1.18 -ne2000=0
    1.19 -
    1.20  
    1.21  #-----------------------------------------------------------------------------
    1.22  #   enable audio support
     2.1 --- a/tools/python/xen/xend/image.py	Wed Jul 12 19:16:10 2006 +0100
     2.2 +++ b/tools/python/xen/xend/image.py	Wed Jul 12 19:16:12 2006 +0100
     2.3 @@ -248,7 +248,7 @@ class HVMImageHandler(ImageHandler):
     2.4      # Return a list of cmd line args to the device models based on the
     2.5      # xm config file
     2.6      def parseDeviceModelArgs(self, imageConfig, deviceConfig):
     2.7 -        dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 'audio',
     2.8 +        dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'audio',
     2.9                     'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
    2.10  		   'usb', 'usbdevice']
    2.11          ret = []
    2.12 @@ -257,11 +257,10 @@ class HVMImageHandler(ImageHandler):
    2.13  
    2.14              # python doesn't allow '-' in variable names
    2.15              if a == 'stdvga': a = 'std-vga'
    2.16 -            if a == 'ne2000': a = 'nic-ne2000'
    2.17              if a == 'audio': a = 'enable-audio'
    2.18  
    2.19              # Handle booleans gracefully
    2.20 -            if a in ['localtime', 'std-vga', 'isa', 'nic-ne2000', 'enable-audio', 'usb']:
    2.21 +            if a in ['localtime', 'std-vga', 'isa', 'enable-audio', 'usb']:
    2.22                  if v != None: v = int(v)
    2.23                  if v: ret.append("-%s" % a)
    2.24              else:
    2.25 @@ -300,24 +299,20 @@ class HVMImageHandler(ImageHandler):
    2.26                  if type != 'ioemu':
    2.27                      continue
    2.28                  nics += 1
    2.29 -                if mac != None:
    2.30 -                    continue
    2.31                  mac = sxp.child_value(info, 'mac')
    2.32 -                bridge = sxp.child_value(info, 'bridge')
    2.33                  if mac == None:
    2.34                      mac = randomMAC()
    2.35 -                if bridge == None:
    2.36 -                    bridge = 'xenbr0'
    2.37 -                ret.append("-macaddr")
    2.38 -                ret.append("%s" % mac)
    2.39 -                ret.append("-bridge")
    2.40 -                ret.append("%s" % bridge)
    2.41 +                bridge = sxp.child_value(info, 'bridge', 'xenbr0')
    2.42 +                model = sxp.child_value(info, 'model', 'rtl8139')
    2.43 +                ret.append("-net")
    2.44 +                ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
    2.45 +                           (nics, mac, model))
    2.46 +                ret.append("-net")
    2.47 +                ret.append("tap,vlan=%d,bridge=%s" % (nics, bridge))
    2.48              if name == 'vtpm':
    2.49                  instance = sxp.child_value(info, 'pref_instance')
    2.50                  ret.append("-instance")
    2.51                  ret.append("%s" % instance)
    2.52 -        ret.append("-nics")
    2.53 -        ret.append("%d" % nics)
    2.54          return ret
    2.55  
    2.56      def configVNC(self, config):
     3.1 --- a/tools/python/xen/xm/create.py	Wed Jul 12 19:16:10 2006 +0100
     3.2 +++ b/tools/python/xen/xm/create.py	Wed Jul 12 19:16:12 2006 +0100
     3.3 @@ -398,10 +398,6 @@ gopts.var('nographic', val='no|yes',
     3.4            fn=set_bool, default=0,
     3.5            use="Should device models use graphics?")
     3.6  
     3.7 -gopts.var('ne2000', val='no|yes',
     3.8 -          fn=set_bool, default=0,
     3.9 -          use="Should device models use ne2000?")
    3.10 -
    3.11  gopts.var('audio', val='no|yes',
    3.12            fn=set_bool, default=0,
    3.13            use="Should device models enable audio?")
    3.14 @@ -605,7 +601,7 @@ def configure_vifs(config_devs, vals):
    3.15  
    3.16          def f(k):
    3.17              if k not in ['backend', 'bridge', 'ip', 'mac', 'script', 'type',
    3.18 -                         'vifname', 'rate']:
    3.19 +                         'vifname', 'rate', 'model']:
    3.20                  err('Invalid vif option: ' + k)
    3.21  
    3.22              config_vif.append([k, d[k]])
    3.23 @@ -619,7 +615,7 @@ def configure_hvm(config_image, vals):
    3.24      """
    3.25      args = [ 'device_model', 'pae', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
    3.26               'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
    3.27 -             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'acpi', 'apic',
    3.28 +             'vnc', 'vncviewer', 'sdl', 'display', 'acpi', 'apic',
    3.29               'xauthority', 'usb', 'usbdevice' ]
    3.30      for a in args:
    3.31          if (vals.__dict__[a]):