From: Jeremy Katz Subject: [PATCH] Support for official xvd major (resend) Date: Mon, 01 Aug 2005 17:27:05 -0400 Message-ID: <1122931625.18910.30.camel@bree.local.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-uwAnF1ctwYv2ZRHTOr9S" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --=-uwAnF1ctwYv2ZRHTOr9S Content-Type: text/plain Content-Transfer-Encoding: 7bit The actual patch got lost in the discussion about whether or not it makes sense to pass the major/minor from dom0. Since we're still doing so, this patch is still needed to use the official LANANA major/minor for xvd devices. It also fixes the regex for scsi disks. Signed-off-by: Jeremy Katz Jeremy --=-uwAnF1ctwYv2ZRHTOr9S Content-Disposition: attachment; filename=xen-xvd-blkmajor.patch Content-Type: text/x-patch; name=xen-xvd-blkmajor.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User katzj@bree.local.net # Node ID 974ff5b2329a6e544202b1d6806455abbd8243b8 # Parent b5bf769f2c228a9a00b88b8e62719f58eb58726e * support proper scsi disk name * xvd now has an official lanana assigned major, use it diff -r b5bf769f2c22 -r 974ff5b2329a tools/python/xen/util/blkif.py --- a/tools/python/xen/util/blkif.py Thu Jul 14 21:08:02 2005 +++ b/tools/python/xen/util/blkif.py Thu Jul 14 21:08:57 2005 @@ -24,14 +24,17 @@ log.debug("exception looking up device number for %s: %s", name, ex) pass - if re.match( '/dev/sd[a-p]([0-9]|1[0-5])', n): - return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:]) + if re.match( '/dev/sd[a-p]([1-9]|1[0-5])?', n): + return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:] or 0) if re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n): ide_majors = [ 3, 22, 33, 34, 56, 57, 88, 89, 90, 91 ] major = ide_majors[(ord(n[7:8]) - ord('a')) / 2] minor = ((ord(n[7:8]) - ord('a')) % 2) * 64 + int(n[8:] or 0) return major * 256 + minor + + 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 ): --=-uwAnF1ctwYv2ZRHTOr9S Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-uwAnF1ctwYv2ZRHTOr9S--