direct-io.hg

changeset 8336:d01b3b50ea64

change the NIC configuration accordingly after remove "nics=n"
otherwise, nics=-1 will be passed to device model and cause device
model exiting.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author Xiaofeng Ling <xiaofeng.ling@intel.com>
date Tue Dec 13 10:57:04 2005 +0000 (2005-12-13)
parents c8378d3c3af8
children ef2fff896422
files tools/examples/xmexample.vmx tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/examples/xmexample.vmx	Mon Dec 12 15:11:13 2005 +0000
     1.2 +++ b/tools/examples/xmexample.vmx	Tue Dec 13 10:57:04 2005 +0000
     1.3 @@ -42,6 +42,8 @@ vcpus=1
     1.4  nics=1 
     1.5  # type=ioemu specify the NIC is an ioemu device not netfront
     1.6  vif = [ 'type=ioemu, bridge=xenbr0' ]
     1.7 +# for multiple NICs in device model, 3 in this example
     1.8 +#vif = [ 'type=ioemu, bridge=xenbr0', 'type=ioemu', 'type=ioemu']
     1.9  
    1.10  #----------------------------------------------------------------------------
    1.11  # Define the disk devices you want the domain to have access to, and
     2.1 --- a/tools/python/xen/xend/image.py	Mon Dec 12 15:11:13 2005 +0000
     2.2 +++ b/tools/python/xen/xend/image.py	Tue Dec 13 10:57:04 2005 +0000
     2.3 @@ -238,9 +238,7 @@ class VmxImageHandler(ImageHandler):
     2.4      # xm config file
     2.5      def parseDeviceModelArgs(self, imageConfig, deviceConfig):
     2.6          dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 
     2.7 -                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
     2.8 -                   'nics'
     2.9 -                   ]
    2.10 +                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus']
    2.11          ret = []
    2.12          for a in dmargs:
    2.13              v = sxp.child_value(imageConfig, a)
    2.14 @@ -262,6 +260,7 @@ class VmxImageHandler(ImageHandler):
    2.15          # Handle disk/network related options
    2.16          mac = None
    2.17          ret = ret + ["-domain-name", "%s" % self.vm.info['name']]
    2.18 +        nics = 0
    2.19          for (name, info) in deviceConfig:
    2.20              if name == 'vbd':
    2.21                 uname = sxp.child_value(info, 'uname')
    2.22 @@ -283,6 +282,7 @@ class VmxImageHandler(ImageHandler):
    2.23                 type = sxp.child_value(info, 'type')
    2.24                 if type != 'ioemu':
    2.25                     continue
    2.26 +               nics += 1
    2.27                 if mac != None:
    2.28                     continue
    2.29                 mac = sxp.child_value(info, 'mac')
    2.30 @@ -299,6 +299,8 @@ class VmxImageHandler(ImageHandler):
    2.31                 instance = sxp.child_value(info, 'pref_instance')
    2.32                 ret.append("-instance")
    2.33                 ret.append("%s" % instance)
    2.34 +        ret.append("-nics")
    2.35 +        ret.append("%d" % nics) 
    2.36          return ret
    2.37  
    2.38      def configVNC(self, config):
     3.1 --- a/tools/python/xen/xm/create.py	Mon Dec 12 15:11:13 2005 +0000
     3.2 +++ b/tools/python/xen/xm/create.py	Tue Dec 13 10:57:04 2005 +0000
     3.3 @@ -545,8 +545,7 @@ def configure_vmx(config_image, vals):
     3.4      """
     3.5      args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
     3.6               'localtime', 'serial', 'stdvga', 'isa', 'nographic',
     3.7 -             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
     3.8 -             'nics']
     3.9 +             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic']
    3.10      for a in args:
    3.11          if (vals.__dict__[a]):
    3.12              config_image.append([a, vals.__dict__[a]])