[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEND] Compare result of blkdev_name_to_number() explicitly against None.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 70687bcb82dd0b2d5813e6125c95ff908e25c94d
# Parent  9a4274724794681f31ab1191700203c879bd9387
[XEND] Compare result of blkdev_name_to_number() explicitly against None.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/python/xen/util/blkif.py        |    2 +-
 tools/python/xen/xend/server/blkif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -r 9a4274724794 -r 70687bcb82dd tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py    Wed Nov 01 19:44:34 2006 +0000
+++ b/tools/python/xen/util/blkif.py    Thu Nov 02 07:46:06 2006 +0000
@@ -52,7 +52,7 @@ def blkdev_segment(name):
     """
     val = None
     n = blkdev_name_to_number(name)
-    if n:
+    if not n is None:
         val = { 'device'       : n,
                 'start_sector' : long(0),
                 'nr_sectors'   : long(1L<<63),
diff -r 9a4274724794 -r 70687bcb82dd tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     Wed Nov 01 19:44:34 2006 +0000
+++ b/tools/python/xen/xend/server/blkif.py     Thu Nov 02 07:46:06 2006 +0000
@@ -80,7 +80,7 @@ class BlkifController(DevController):
                          'acm_policy' : policy})
 
         devid = blkif.blkdev_name_to_number(dev)
-        if not devid:
+        if devid is None:
             raise VmError('Unable to find number for device (%s)' % (dev))
 
         front = { 'virtual-device' : "%i" % devid,

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.