Skip to contentSkip to conversation

Make xm reboot/shutdown work again (undo 8697)

PATCH New Leendert van Doorn 1 participant 1 message Mar 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make xm reboot/shutdown work again (undo 8697)

This patch undoes 8697 and makes xm reboot/shutdown work again. This code does expose a bug in xenstored when it is killed & restarted, but that is not caused by this code.

My sincere appology to Ke Yu for the long wait and assuming his code was broken. His code was perfectly fine. Its just that my test scripts did something for a historical reason that I should have removed a long time ago.

Leendert

tools/python/xen/xend/server/blkif.py +7 -5
diff -r b50d3fca138e tools/python/xen/xend/server/blkif.py
@@ -42,10 +42,6 @@
         """@see DevController.getDeviceDetails"""
 
         dev = sxp.child_value(config, 'dev')
-        if 'ioemu:' in dev:
-            return (None,{},{})
-
-        devid = blkif.blkdev_name_to_number(dev)
 
         (typ, params) = string.split(sxp.child_value(config, 'uname'), ':', 1)
         back = { 'dev'    : dev,
@@ -54,7 +50,13 @@
                  'mode'   : sxp.child_value(config, 'mode', 'r')
                  }
 
-        front = { 'virtual-device' : "%i" % devid }
+        if 'ioemu:' in dev:
+            (dummy, dev1) = string.split(dev, ':', 1)
+            devid = blkif.blkdev_name_to_number(dev1)
+            front = {}
+        else:
+            devid = blkif.blkdev_name_to_number(dev)
+            front = { 'virtual-device' : "%i" % devid }
 
         return (devid, back, front)