WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Accept decimal block device IDs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Accept decimal block device IDs
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 May 2008 08:50:07 -0700
Delivery-date: Thu, 01 May 2008 09:03:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1209656128 -3600
# Node ID 84a066b9e57ae6c8885dc563141cd0a843ef571e
# Parent  eb3437db158ba73d5df1ae93074916709e1dc481
Accept decimal block device IDs

Solaris uses a simple indexing scheme for block devices. Parts of xend
translate them as hexadecimal (such as block-attach), and decimal, or
unconverted, elsewhere (such as block-detach). Harmonise these
interfaces by allowing decimal specifications.

Also allow Solaris-style block device names.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/python/xen/util/blkif.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -r eb3437db158b -r 84a066b9e57a tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py    Thu May 01 16:08:36 2008 +0100
+++ b/tools/python/xen/util/blkif.py    Thu May 01 16:35:28 2008 +0100
@@ -42,10 +42,12 @@ def blkdev_name_to_number(name):
     if re.match( '/dev/xvd[a-p]([1-9]|1[0-5])?', n):
         return 202 * 256 + 16 * (ord(n[8:9]) - ord('a')) + int(n[9:] or 0)
 
-    # see if this is a hex device number
-    if re.match( '^(0x)?[0-9a-fA-F]+$', name ):
+    if re.match( '^(0x)[0-9a-fA-F]+$', name ):
         return string.atoi(name,16)
-        
+
+    if re.match('^[0-9]+$', name):
+        return string.atoi(name, 10)
+
     return None
 
 def blkdev_segment(name):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Accept decimal block device IDs, Xen patchbot-unstable <=