From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: [PATCH] Blkif regular expression fix Date: Thu, 05 Mar 2009 15:14:36 +0100 Message-ID: <49AFDE4C.5020109@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050905050000020308020906" 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 This is a multi-part message in MIME format. --------------050905050000020308020906 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello everybody, I have created a patch for blkif.py to support only hd[a-t] devices from 1 to 63. There was missing $ sign at the end of the regular expression and therefore even hda100 was able to be attached but not working correctly. Anyway hda989898 was able to be mounted but it crashed guest kernel. This patch solves this issue... Michal Signed-off-by: Michal Novotny --------------050905050000020308020906 Content-Type: text/plain; name="xen-util-blkif-regex.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-util-blkif-regex.patch" diff -up xen-3.1.0-src/tools/python/xen/util/blkif.py.bz475433 xen-3.1.0-src/tools/python/xen/util/blkif.py --- xen-3.1.0-src/tools/python/xen/util/blkif.py.bz475433 2009-03-05 14:51:35.000000000 +0100 +++ xen-3.1.0-src/tools/python/xen/util/blkif.py 2009-03-05 14:51:50.000000000 +0100 @@ -29,7 +29,7 @@ def blkdev_name_to_number(name): if re.match( '/dev/sd[a-p]([1-9]|1[0-5])?$', n): devnum = 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:] or 0) - elif re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n): + elif 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) --------------050905050000020308020906 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 --------------050905050000020308020906--