From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber de Oliveira Costa Subject: [PATCH] Error message for device not found at blkif.py Date: Wed, 18 Oct 2006 17:08:45 -0300 Message-ID: <20061018200845.GB16266@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yNb1oOkm5a9FJOVX" Return-path: Content-Disposition: inline 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 --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, if blkdev_name_to_number() fails to assign a number to the specified device, it returns None, causing a far-away-from-self-explanatory message to be delivered. Better test for this condition and say exactly what happened. -- Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="errormsg.patch" --- xen-3.0.3-testing-11633/./tools/python/build/lib.linux-x86_64-2.4/xen/xend/server/blkif.py.orig 2006-09-28 18:52:39.000000000 -0400 +++ xen-3.0.3-testing-11633/./tools/python/build/lib.linux-x86_64-2.4/xen/xend/server/blkif.py 2006-10-18 15:58:28.000000000 -0400 @@ -81,6 +81,9 @@ class BlkifController(DevController): 'acm_policy' : policy}) devid = blkif.blkdev_name_to_number(dev) + if not devid: + raise VmError('Unable to find number for device (%s)'%(dev)) + front = { 'virtual-device' : "%i" % devid, 'device-type' : dev_type } --yNb1oOkm5a9FJOVX 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 --yNb1oOkm5a9FJOVX--