Skip to contentSkip to conversation

: Fix up python breakage for blkdev_name_to_number

PATCH New Chris Lalancette 1 participant 1 message Jun 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix up python breakage for blkdev_name_to_number

Stefan Berger pointed out that xm-test was having failures with the new blkdev_name_to_number code. I found that I had forgotten to update the code in xm-test for the new (xenbus_path, number) tuple that blkdev_name_to_number returns. While grepping through the tree, I also found two other places where I failed to fix up blkdev_name_to_number; all 3 of these fixes are in the attached patch.

tools/python/xen/util/blkif.py +1 -1
diff -r 0972fc23b504 tools/python/xen/util/blkif.py
@@ -63,7 +63,7 @@ def blkdev_segment(name):
         type:         'Disk' or identifying name for partition type
     """
     val = None
-    n = blkdev_name_to_number(name)
+    (name, n) = blkdev_name_to_number(name)
     if not n is None:
         val = { 'device'       : n,
                 'start_sector' : long(0),
tools/python/xen/xend/XendConfig.py +1 -1
diff -r 0972fc23b504 tools/python/xen/xend/XendConfig.py
@@ -1123,7 +1123,7 @@ class XendConfig(dict):
             try:
                 devid = int(dev2)
             except ValueError:
-                devid = blkdev_name_to_number(dev2)
+                (xenbus, devid) = blkdev_name_to_number(dev2)
                 if devid == None:
                     log.debug("The device %s is not device name", dev2)
                     return None
tools/xm-test/lib/XmTestLib/block_utils.py +1 -1
diff -r 0972fc23b504 tools/xm-test/lib/XmTestLib/block_utils.py
@@ -15,7 +15,7 @@ __all__ = [ "block_attach", "block_detac
 
 
 def get_state(domain, devname):
-    number = xen.util.blkif.blkdev_name_to_number(devname)
+    (path, number) = xen.util.blkif.blkdev_name_to_number(devname)
     s, o = traceCommand("xm block-list %s | awk '/^%d/ {print $4}'" %
                         (domain.getName(), number))
     if s != 0:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel