ia64/xen-unstable

changeset 19335:b3b6aee082d6

xend: Skip tap pipe creation on Solaris

Signed-off-by: John Levon <john.levon@sun.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 11:08:45 2009 +0000 (2009-03-12)
parents 1ad8216abda5
children 1e9342bc6d6e
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Thu Mar 12 11:07:34 2009 +0000
     1.2 +++ b/tools/python/xen/xend/image.py	Thu Mar 12 11:08:45 2009 +0000
     1.3 @@ -28,6 +28,7 @@ import sys
     1.4  import errno
     1.5  import glob
     1.6  import traceback
     1.7 +import platform
     1.8  
     1.9  import xen.lowlevel.xc
    1.10  from xen.xend.XendConstants import *
    1.11 @@ -227,23 +228,19 @@ class ImageHandler:
    1.12          if self.device_model is None:
    1.13              return
    1.14  
    1.15 -        # If we use a device model, the pipes for communication between
    1.16 -        # blktapctrl and ioemu must be present before the devices are 
    1.17 -        # created (blktapctrl must access them for new block devices)
    1.18 +        if platform.system() != 'SunOS':
    1.19 +            # If we use a device model, the pipes for communication between
    1.20 +            # blktapctrl and ioemu must be present before the devices are 
    1.21 +            # created (blktapctrl must access them for new block devices)
    1.22 +            os.makedirs('/var/run/tap', 0755)
    1.23  
    1.24 -        # mkdir throws an exception if the path already exists
    1.25 -        try:
    1.26 -            os.mkdir('/var/run/tap', 0755)
    1.27 -        except:
    1.28 -            pass
    1.29 -
    1.30 -        try:
    1.31 -            os.mkfifo('/var/run/tap/qemu-read-%d' % domid, 0600)
    1.32 -            os.mkfifo('/var/run/tap/qemu-write-%d' % domid, 0600)
    1.33 -        except OSError, e:
    1.34 -            log.warn('Could not create blktap pipes for domain %d' % domid)
    1.35 -            log.exception(e)
    1.36 -            pass
    1.37 +            try:
    1.38 +                os.mkfifo('/var/run/tap/qemu-read-%d' % domid, 0600)
    1.39 +                os.mkfifo('/var/run/tap/qemu-write-%d' % domid, 0600)
    1.40 +            except OSError, e:
    1.41 +                log.warn('Could not create blktap pipes for domain %d' % domid)
    1.42 +                log.exception(e)
    1.43 +                pass
    1.44  
    1.45  
    1.46      # Return a list of cmd line args to the device models based on the