All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Raise DevError for device not found at blkif.py
@ 2006-10-20 12:38 Glauber de Oliveira Costa
  0 siblings, 0 replies; 3+ messages in thread
From: Glauber de Oliveira Costa @ 2006-10-20 12:38 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

Anthony,

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"

[-- Attachment #2: deverror.patch --]
[-- Type: text/plain, Size: 1273 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH] Raise DevError for device not found at blkif.py
@ 2006-10-20 16:02 Glauber de Oliveira Costa
  2006-10-20 15:54 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Glauber de Oliveira Costa @ 2006-10-20 16:02 UTC (permalink / raw)
  To: xen-devel, aliguori

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

Sorry if you get it twice. I have no idea why wasn't it delivered.
Follows:


Anthony,

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"

[-- Attachment #2: deverror.patch --]
[-- Type: text/plain, Size: 1273 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-20 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20 12:38 [PATCH] Raise DevError for device not found at blkif.py Glauber de Oliveira Costa
  -- strict thread matches above, loose matches on Subject: below --
2006-10-20 16:02 Glauber de Oliveira Costa
2006-10-20 15:54 ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.