[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Merge



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1176299143 -3600
# Node ID 2aa05978f2caf8c5461aaba052d385c5b8986a15
# Parent  90a6af455bbd335f1c4f9809e568d1b0af8c074c
# Parent  bfe2136c163ac44e0f10d1de404b224ce67b5d78
Merge
---
 linux-2.6-xen-sparse/drivers/xen/blkfront/block.h |   14 ---
 linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   |    4 -
 tools/python/xen/xend/XendCheckpoint.py           |    7 -
 tools/python/xen/xend/server/DevController.py     |    1 
 tools/python/xen/xend/server/netif.py             |   88 +++++++---------------
 5 files changed, 30 insertions(+), 84 deletions(-)

diff -r 90a6af455bbd -r 2aa05978f2ca 
linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h Wed Apr 11 14:45:14 
2007 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h Wed Apr 11 14:45:43 
2007 +0100
@@ -55,20 +55,6 @@
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
-
-#if 1
-#define IPRINTK(fmt, args...)                          \
-       printk(KERN_INFO "xen_blk: " fmt, ##args)
-#else
-#define IPRINTK(fmt, args...) ((void)0)
-#endif
-
-#if 1
-#define WPRINTK(fmt, args...)                          \
-       printk(KERN_WARNING "xen_blk: " fmt, ##args)
-#else
-#define WPRINTK(fmt, args...) ((void)0)
-#endif
 
 #define DPRINTK(_f, _a...) pr_debug(_f, ## _a)
 
diff -r 90a6af455bbd -r 2aa05978f2ca 
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Wed Apr 11 14:45:14 
2007 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Wed Apr 11 14:45:43 
2007 +0100
@@ -128,14 +128,12 @@ xlbd_alloc_major_info(int major, int min
                break;
        }
 
-       printk("Registering block device major %i\n", ptr->major);
        if (register_blkdev(ptr->major, ptr->type->devname)) {
-               WPRINTK("can't get major %d with name %s\n",
-                       ptr->major, ptr->type->devname);
                kfree(ptr);
                return NULL;
        }
 
+       printk("xen-vbd: registered block device major %i\n", ptr->major);
        major_info[index] = ptr;
        return ptr;
 }
diff -r 90a6af455bbd -r 2aa05978f2ca tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Wed Apr 11 14:45:14 2007 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Apr 11 14:45:43 2007 +0100
@@ -75,13 +75,6 @@ def save(fd, dominfo, network, live, dst
 
         image_cfg = dominfo.info.get('image', {})
         hvm = dominfo.info.is_hvm()
-        stdvga = 0
-
-        if hvm:
-            log.info("save hvm domain")
-            if dominfo.info['platform'].has_key('stdvga'):
-                if dominfo.info['platform']['stdvga'] == 1:
-                    stdvga = 1
 
         # xc_save takes three customization parameters: maxit, max_f, and
         # flags the last controls whether or not save is 'live', while the
diff -r 90a6af455bbd -r 2aa05978f2ca 
tools/python/xen/xend/server/DevController.py
--- a/tools/python/xen/xend/server/DevController.py     Wed Apr 11 14:45:14 
2007 +0100
+++ b/tools/python/xen/xend/server/DevController.py     Wed Apr 11 14:45:43 
2007 +0100
@@ -223,6 +223,7 @@ class DevController:
                 xstransact.Remove(backpath)
             xstransact.Remove(frontpath)
 
+        self.vm._removeVm("device/%s/%d" % (self.deviceClass, devid))
 
     def configurations(self):
         return map(self.configuration, self.deviceIDs())
diff -r 90a6af455bbd -r 2aa05978f2ca tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py     Wed Apr 11 14:45:14 2007 +0100
+++ b/tools/python/xen/xend/server/netif.py     Wed Apr 11 14:45:43 2007 +0100
@@ -88,46 +88,6 @@ def parseRate(ratestr):
     return "%lu,%lu" % (bytes_per_interval, interval_usecs)
 
 
-write_rate_G_re = re.compile('^([0-9]+)000000000(B/s@[0-9]+us)$')
-write_rate_M_re = re.compile('^([0-9]+)000000(B/s@[0-9]+us)$')
-write_rate_K_re = re.compile('^([0-9]+)000(B/s@[0-9]+us)$')
-write_rate_s_re = re.compile('^([0-9]+[GMK]?B/s@[0-9]+)000000us$')
-write_rate_m_re = re.compile('^([0-9]+[GMK]?B/s@[0-9]+)000us$')
-
-def formatRate(rate):
-    (bytes_per_interval, interval_usecs) = map(long, rate.split(','))
-
-    if interval_usecs != 0:
-        bytes_per_second = (bytes_per_interval * 1000 * 1000) / interval_usecs
-    else:
-        bytes_per_second = 0xffffffffL
-
-    ratestr = "%uB/s@%uus" % (bytes_per_second, interval_usecs)
-
-    # look for '000's
-    m = write_rate_G_re.match(ratestr)
-    if m:
-        ratestr = m.group(1) + "G" + m.group(2)
-    else:
-        m = write_rate_M_re.match(ratestr)
-        if m:
-            ratestr = m.group(1) + "M" + m.group(2)
-        else:
-            m = write_rate_K_re.match(ratestr)
-            if m:
-                ratestr = m.group(1) + "K" + m.group(2)
-
-    m = write_rate_s_re.match(ratestr)
-    if m:
-        ratestr = m.group(1) + "s"
-    else:
-        m = write_rate_m_re.match(ratestr)
-        if m:
-            ratestr = m.group(1) + "ms"
-
-    return ratestr
-
-
 class NetifController(DevController):
     """Network interface controller. Handles all network devices for a domain.
     """
@@ -138,8 +98,7 @@ class NetifController(DevController):
     def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""
 
-        script = os.path.join(xoptions.network_script_dir,
-                              config.get('script', xoptions.get_vif_script()))
+        script  = config.get('script', xoptions.get_vif_script())
         typ     = config.get('type')
         bridge  = config.get('bridge')
         mac     = config.get('mac')
@@ -149,24 +108,17 @@ class NetifController(DevController):
         ipaddr  = config.get('ip')
         model   = config.get('model')
 
-        devid = self.allocateDeviceID()
-
         if not typ:
             typ = xoptions.netback_type
-            
+
         if not mac:
             mac = randomMAC()
 
+        devid = self.allocateDeviceID()
+
         back = { 'script' : script,
                  'mac'    : mac,
-                 'handle' : "%i" % devid,
                  'type'   : typ }
-
-        if typ == 'ioemu':
-            front = {}
-        else:
-            front = { 'handle' : "%i" % devid,
-                      'mac'    : mac }
         if ipaddr:
             back['ip'] = ipaddr
         if bridge:
@@ -174,12 +126,26 @@ class NetifController(DevController):
         if vifname:
             back['vifname'] = vifname
         if rate:
-            back['rate'] = parseRate(rate)
+            back['rate'] = rate
         if uuid:
             back['uuid'] = uuid
         if model:
             back['model'] = model
 
+        config_path = "device/%s/%d/" % (self.deviceClass, devid)
+        for x in back:
+            self.vm._writeVm(config_path + x, back[x])
+
+        back['handle'] = "%i" % devid
+        back['script'] = os.path.join(xoptions.network_script_dir, script)
+        if rate:
+            back['rate'] = parseRate(rate)
+
+        front = {}
+        if typ != 'ioemu':
+            front = { 'handle' : "%i" % devid,
+                      'mac'    : mac }
+
         return (devid, back, front)
 
 
@@ -187,14 +153,17 @@ class NetifController(DevController):
         """@see DevController.configuration"""
 
         result = DevController.getDeviceConfiguration(self, devid)
-        devinfo =  self.readBackend(devid, 'script', 'ip', 'bridge',
-                                    'mac', 'type', 'vifname', 'rate',
-                                    'uuid', 'model')
+
+        config_path = "device/%s/%d/" % (self.deviceClass, devid)
+        devinfo = ()
+        for x in ( 'script', 'ip', 'bridge', 'mac',
+                   'type', 'vifname', 'rate', 'uuid', 'model' ):
+            y = self.vm._readVm(config_path + x)
+            devinfo += (y,)
         (script, ip, bridge, mac, typ, vifname, rate, uuid, model) = devinfo
 
         if script:
-            network_script_dir = xoptions.network_script_dir + os.sep
-            result['script'] = script.replace(network_script_dir, "")
+            result['script'] = script
         if ip:
             result['ip'] = ip
         if bridge:
@@ -206,11 +175,10 @@ class NetifController(DevController):
         if vifname:
             result['vifname'] = vifname
         if rate:
-            result['rate'] = formatRate(rate)
+            result['rate'] = rate
         if uuid:
             result['uuid'] = uuid
         if model:
             result['model'] = model
             
         return result
-

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.