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-devel

[Xen-devel] Re: [PATCH] Error message for device not found at blkif.py

To: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Error message for device not found at blkif.py
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 18 Oct 2006 15:59:30 -0500
Delivery-date: Wed, 18 Oct 2006 14:00:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061018200845.GB16266@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061018200845.GB16266@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (X11/20060918)
Instead of throwing a VmError, could you subclass VmError with a more specific error and throw that?

That will pass higher level info about the error to xm which means we can do a better job in there (this is especially important when we eventually localize xm).

Thanks,

Anthony Liguori


Glauber de Oliveira Costa wrote:
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.




------------------------------------------------------------------------

--- 
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
                 }


------------------------------------------------------------------------

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


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