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] [PATCH][RESEND] Raise DevError for device not found at blkif

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][RESEND] Raise DevError for device not found at blkif.py
From: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
Date: Mon, 23 Oct 2006 16:33:29 -0300
Delivery-date: Mon, 23 Oct 2006 12:23:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
Resending:

Hope this is a better error raising for the device not found
construction in blkif.py. I imagine this Error can be used for
generic device-related errors during Vm Construction.

-- 
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
--- xen-3.0.3-testing-11633/tools/python/xen/xend/XendError.py.orig     
2006-10-20 08:09:50.000000000 -0400
+++ xen-3.0.3-testing-11633/tools/python/xen/xend/XendError.py  2006-10-20 
08:11:36.000000000 -0400
@@ -36,4 +36,7 @@ class VmError(XendError):
     """Vm construction error."""
 
     pass
+class DevError(VmError):
+    """Device probing/constructing"""
 
+    pass
--- xen-3.0.3-testing-11633/tools/python/xen/xend/server/blkif.py.orig  
2006-09-28 18:52:39.000000000 -0400
+++ xen-3.0.3-testing-11633/tools/python/xen/xend/server/blkif.py       
2006-10-20 08:23:53.000000000 -0400
@@ -23,7 +23,7 @@ import string
 from xen.util import blkif
 from xen.util import security
 from xen.xend import sxp
-from xen.xend.XendError import VmError
+from xen.xend.XendError import VmError,DevError
 
 from xen.xend.server.DevController import DevController
 
@@ -81,6 +81,9 @@ class BlkifController(DevController):
                          'acm_policy' : policy})
 
         devid = blkif.blkdev_name_to_number(dev)
+        if not devid:
+            raise DevError('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
<Prev in Thread] Current Thread [Next in Thread>