ia64/xen-unstable

changeset 6526:9413e453e83b

Distinguish ioemu handled devices and para virtualized devices

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author adsharma@los-vmm.sc.intel.com
date Fri Aug 12 09:25:49 2005 -0800 (2005-08-12)
parents 2ea4790cbeaa
children 40b887fa79d0
files tools/examples/xmexample.vmx tools/python/xen/xend/image.py tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/examples/xmexample.vmx	Fri Aug 12 09:24:05 2005 -0800
     1.2 +++ b/tools/examples/xmexample.vmx	Fri Aug 12 09:25:49 2005 -0800
     1.3 @@ -34,7 +34,7 @@ name = "ExampleVMXDomain"
     1.4  # and MODE is r for read-only, w for read-write.
     1.5  
     1.6  #disk = [ 'phy:hda1,hda1,r' ]
     1.7 -disk = [ 'file:/var/images/min-el3-i386.img,hda,w' ]
     1.8 +disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
     1.9  
    1.10  #----------------------------------------------------------------------------
    1.11  # Set according to whether you want the domain restarted when it exits.
     2.1 --- a/tools/python/xen/xend/image.py	Fri Aug 12 09:24:05 2005 -0800
     2.2 +++ b/tools/python/xen/xend/image.py	Fri Aug 12 09:25:49 2005 -0800
     2.3 @@ -16,6 +16,7 @@
     2.4  #============================================================================
     2.5  
     2.6  import os, string
     2.7 +import re
     2.8  
     2.9  import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
    2.10  from xen.xend import sxp
    2.11 @@ -329,8 +330,15 @@ class VmxImageHandler(ImageHandler):
    2.12              if name == 'vbd':
    2.13                 vbdinfo = sxp.child(device, 'vbd')
    2.14                 uname = sxp.child_value(vbdinfo, 'uname')
    2.15 -               vbddev = sxp.child_value(vbdinfo, 'dev')
    2.16 +               typedev = sxp.child_value(vbdinfo, 'dev')
    2.17                 (vbdtype, vbdparam) = string.split(uname, ':', 1)
    2.18 +               if re.match('^ioemu:', typedev):
    2.19 +                  (emtype, vbddev) = string.split(typedev, ':', 1)
    2.20 +               else:
    2.21 +                  emtype = 'vbd'
    2.22 +                  vbddev = typedev
    2.23 +               if emtype != 'ioemu':
    2.24 +                  continue;
    2.25                 vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
    2.26                 if vbddev not in vbddev_list:
    2.27                    raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd")
     3.1 --- a/tools/python/xen/xend/server/blkif.py	Fri Aug 12 09:24:05 2005 -0800
     3.2 +++ b/tools/python/xen/xend/server/blkif.py	Fri Aug 12 09:25:49 2005 -0800
     3.3 @@ -18,6 +18,7 @@
     3.4  """Support for virtual block devices.
     3.5  """
     3.6  import string
     3.7 +import re
     3.8  
     3.9  from xen.util import blkif
    3.10  from xen.xend.XendError import XendError, VmError
    3.11 @@ -199,6 +200,7 @@ class BlkDev(Dev):
    3.12          self.vdev = None
    3.13          self.mode = None
    3.14          self.type = None
    3.15 +        self.emtype = None
    3.16          self.params = None
    3.17          self.node = None
    3.18          self.device = None
    3.19 @@ -237,7 +239,12 @@ class BlkDev(Dev):
    3.20          # Split into type and type-specific params (which are passed to the
    3.21          # type-specific control script).
    3.22          (self.type, self.params) = string.split(self.uname, ':', 1)
    3.23 -        self.dev = sxp.child_value(config, 'dev')
    3.24 +        typedev = sxp.child_value(config, 'dev')
    3.25 +        if re.match( '^ioemu:', typedev):
    3.26 +            (self.emtype, self.dev) = string.split(typedev, ':', 1)
    3.27 +        else:
    3.28 +            self.emtype = 'vbd'
    3.29 +            self.dev = typedev
    3.30          if not self.dev:
    3.31              raise VmError('vbd: Missing dev')
    3.32          self.mode = sxp.child_value(config, 'mode', 'r')
    3.33 @@ -258,6 +265,8 @@ class BlkDev(Dev):
    3.34          if recreate:
    3.35              pass
    3.36          else:
    3.37 +            if self.emtype == 'ioemu':
    3.38 +                return
    3.39              node = Blkctl.block('bind', self.type, self.params)
    3.40              self.setNode(node)
    3.41              self.attachBackend()