direct-io.hg

changeset 14799:2aa05978f2ca

Merge
author Tim Deegan <Tim.Deegan@xensource.com>
date Wed Apr 11 14:45:43 2007 +0100 (2007-04-11)
parents 90a6af455bbd bfe2136c163a
children 83e4261378e7
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Wed Apr 11 14:45:14 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Wed Apr 11 14:45:43 2007 +0100
     1.3 @@ -56,20 +56,6 @@
     1.4  #include <asm/atomic.h>
     1.5  #include <asm/uaccess.h>
     1.6  
     1.7 -#if 1
     1.8 -#define IPRINTK(fmt, args...)				\
     1.9 -	printk(KERN_INFO "xen_blk: " fmt, ##args)
    1.10 -#else
    1.11 -#define IPRINTK(fmt, args...) ((void)0)
    1.12 -#endif
    1.13 -
    1.14 -#if 1
    1.15 -#define WPRINTK(fmt, args...)				\
    1.16 -	printk(KERN_WARNING "xen_blk: " fmt, ##args)
    1.17 -#else
    1.18 -#define WPRINTK(fmt, args...) ((void)0)
    1.19 -#endif
    1.20 -
    1.21  #define DPRINTK(_f, _a...) pr_debug(_f, ## _a)
    1.22  
    1.23  #if 0
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Apr 11 14:45:14 2007 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Apr 11 14:45:43 2007 +0100
     2.3 @@ -128,14 +128,12 @@ xlbd_alloc_major_info(int major, int min
     2.4  		break;
     2.5  	}
     2.6  
     2.7 -	printk("Registering block device major %i\n", ptr->major);
     2.8  	if (register_blkdev(ptr->major, ptr->type->devname)) {
     2.9 -		WPRINTK("can't get major %d with name %s\n",
    2.10 -			ptr->major, ptr->type->devname);
    2.11  		kfree(ptr);
    2.12  		return NULL;
    2.13  	}
    2.14  
    2.15 +	printk("xen-vbd: registered block device major %i\n", ptr->major);
    2.16  	major_info[index] = ptr;
    2.17  	return ptr;
    2.18  }
     3.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Wed Apr 11 14:45:14 2007 +0100
     3.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Wed Apr 11 14:45:43 2007 +0100
     3.3 @@ -75,13 +75,6 @@ def save(fd, dominfo, network, live, dst
     3.4  
     3.5          image_cfg = dominfo.info.get('image', {})
     3.6          hvm = dominfo.info.is_hvm()
     3.7 -        stdvga = 0
     3.8 -
     3.9 -        if hvm:
    3.10 -            log.info("save hvm domain")
    3.11 -            if dominfo.info['platform'].has_key('stdvga'):
    3.12 -                if dominfo.info['platform']['stdvga'] == 1:
    3.13 -                    stdvga = 1
    3.14  
    3.15          # xc_save takes three customization parameters: maxit, max_f, and
    3.16          # flags the last controls whether or not save is 'live', while the
     4.1 --- a/tools/python/xen/xend/server/DevController.py	Wed Apr 11 14:45:14 2007 +0100
     4.2 +++ b/tools/python/xen/xend/server/DevController.py	Wed Apr 11 14:45:43 2007 +0100
     4.3 @@ -223,6 +223,7 @@ class DevController:
     4.4                  xstransact.Remove(backpath)
     4.5              xstransact.Remove(frontpath)
     4.6  
     4.7 +        self.vm._removeVm("device/%s/%d" % (self.deviceClass, devid))
     4.8  
     4.9      def configurations(self):
    4.10          return map(self.configuration, self.deviceIDs())
     5.1 --- a/tools/python/xen/xend/server/netif.py	Wed Apr 11 14:45:14 2007 +0100
     5.2 +++ b/tools/python/xen/xend/server/netif.py	Wed Apr 11 14:45:43 2007 +0100
     5.3 @@ -88,46 +88,6 @@ def parseRate(ratestr):
     5.4      return "%lu,%lu" % (bytes_per_interval, interval_usecs)
     5.5  
     5.6  
     5.7 -write_rate_G_re = re.compile('^([0-9]+)000000000(B/s@[0-9]+us)$')
     5.8 -write_rate_M_re = re.compile('^([0-9]+)000000(B/s@[0-9]+us)$')
     5.9 -write_rate_K_re = re.compile('^([0-9]+)000(B/s@[0-9]+us)$')
    5.10 -write_rate_s_re = re.compile('^([0-9]+[GMK]?B/s@[0-9]+)000000us$')
    5.11 -write_rate_m_re = re.compile('^([0-9]+[GMK]?B/s@[0-9]+)000us$')
    5.12 -
    5.13 -def formatRate(rate):
    5.14 -    (bytes_per_interval, interval_usecs) = map(long, rate.split(','))
    5.15 -
    5.16 -    if interval_usecs != 0:
    5.17 -        bytes_per_second = (bytes_per_interval * 1000 * 1000) / interval_usecs
    5.18 -    else:
    5.19 -        bytes_per_second = 0xffffffffL
    5.20 -
    5.21 -    ratestr = "%uB/s@%uus" % (bytes_per_second, interval_usecs)
    5.22 -
    5.23 -    # look for '000's
    5.24 -    m = write_rate_G_re.match(ratestr)
    5.25 -    if m:
    5.26 -        ratestr = m.group(1) + "G" + m.group(2)
    5.27 -    else:
    5.28 -        m = write_rate_M_re.match(ratestr)
    5.29 -        if m:
    5.30 -            ratestr = m.group(1) + "M" + m.group(2)
    5.31 -        else:
    5.32 -            m = write_rate_K_re.match(ratestr)
    5.33 -            if m:
    5.34 -                ratestr = m.group(1) + "K" + m.group(2)
    5.35 -
    5.36 -    m = write_rate_s_re.match(ratestr)
    5.37 -    if m:
    5.38 -        ratestr = m.group(1) + "s"
    5.39 -    else:
    5.40 -        m = write_rate_m_re.match(ratestr)
    5.41 -        if m:
    5.42 -            ratestr = m.group(1) + "ms"
    5.43 -
    5.44 -    return ratestr
    5.45 -
    5.46 -
    5.47  class NetifController(DevController):
    5.48      """Network interface controller. Handles all network devices for a domain.
    5.49      """
    5.50 @@ -138,8 +98,7 @@ class NetifController(DevController):
    5.51      def getDeviceDetails(self, config):
    5.52          """@see DevController.getDeviceDetails"""
    5.53  
    5.54 -        script = os.path.join(xoptions.network_script_dir,
    5.55 -                              config.get('script', xoptions.get_vif_script()))
    5.56 +        script  = config.get('script', xoptions.get_vif_script())
    5.57          typ     = config.get('type')
    5.58          bridge  = config.get('bridge')
    5.59          mac     = config.get('mac')
    5.60 @@ -149,24 +108,17 @@ class NetifController(DevController):
    5.61          ipaddr  = config.get('ip')
    5.62          model   = config.get('model')
    5.63  
    5.64 -        devid = self.allocateDeviceID()
    5.65 -
    5.66          if not typ:
    5.67              typ = xoptions.netback_type
    5.68 -            
    5.69 +
    5.70          if not mac:
    5.71              mac = randomMAC()
    5.72  
    5.73 +        devid = self.allocateDeviceID()
    5.74 +
    5.75          back = { 'script' : script,
    5.76                   'mac'    : mac,
    5.77 -                 'handle' : "%i" % devid,
    5.78                   'type'   : typ }
    5.79 -
    5.80 -        if typ == 'ioemu':
    5.81 -            front = {}
    5.82 -        else:
    5.83 -            front = { 'handle' : "%i" % devid,
    5.84 -                      'mac'    : mac }
    5.85          if ipaddr:
    5.86              back['ip'] = ipaddr
    5.87          if bridge:
    5.88 @@ -174,12 +126,26 @@ class NetifController(DevController):
    5.89          if vifname:
    5.90              back['vifname'] = vifname
    5.91          if rate:
    5.92 -            back['rate'] = parseRate(rate)
    5.93 +            back['rate'] = rate
    5.94          if uuid:
    5.95              back['uuid'] = uuid
    5.96          if model:
    5.97              back['model'] = model
    5.98  
    5.99 +        config_path = "device/%s/%d/" % (self.deviceClass, devid)
   5.100 +        for x in back:
   5.101 +            self.vm._writeVm(config_path + x, back[x])
   5.102 +
   5.103 +        back['handle'] = "%i" % devid
   5.104 +        back['script'] = os.path.join(xoptions.network_script_dir, script)
   5.105 +        if rate:
   5.106 +            back['rate'] = parseRate(rate)
   5.107 +
   5.108 +        front = {}
   5.109 +        if typ != 'ioemu':
   5.110 +            front = { 'handle' : "%i" % devid,
   5.111 +                      'mac'    : mac }
   5.112 +
   5.113          return (devid, back, front)
   5.114  
   5.115  
   5.116 @@ -187,14 +153,17 @@ class NetifController(DevController):
   5.117          """@see DevController.configuration"""
   5.118  
   5.119          result = DevController.getDeviceConfiguration(self, devid)
   5.120 -        devinfo =  self.readBackend(devid, 'script', 'ip', 'bridge',
   5.121 -                                    'mac', 'type', 'vifname', 'rate',
   5.122 -                                    'uuid', 'model')
   5.123 +
   5.124 +        config_path = "device/%s/%d/" % (self.deviceClass, devid)
   5.125 +        devinfo = ()
   5.126 +        for x in ( 'script', 'ip', 'bridge', 'mac',
   5.127 +                   'type', 'vifname', 'rate', 'uuid', 'model' ):
   5.128 +            y = self.vm._readVm(config_path + x)
   5.129 +            devinfo += (y,)
   5.130          (script, ip, bridge, mac, typ, vifname, rate, uuid, model) = devinfo
   5.131  
   5.132          if script:
   5.133 -            network_script_dir = xoptions.network_script_dir + os.sep
   5.134 -            result['script'] = script.replace(network_script_dir, "")
   5.135 +            result['script'] = script
   5.136          if ip:
   5.137              result['ip'] = ip
   5.138          if bridge:
   5.139 @@ -206,11 +175,10 @@ class NetifController(DevController):
   5.140          if vifname:
   5.141              result['vifname'] = vifname
   5.142          if rate:
   5.143 -            result['rate'] = formatRate(rate)
   5.144 +            result['rate'] = rate
   5.145          if uuid:
   5.146              result['uuid'] = uuid
   5.147          if model:
   5.148              result['model'] = model
   5.149              
   5.150          return result
   5.151 -