[XEND] Compare result of blkdev_name_to_number() explicitly against None.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 2 Nov 2006 07:46:06 +0000 (07:46 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 2 Nov 2006 07:46:06 +0000 (07:46 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/util/blkif.py
tools/python/xen/xend/server/blkif.py

index 06d5e166a1c8e480d510f7eb8ff577e161251d96..859361970c0badf4990ee0a5046ce8d814b3c20f 100644 (file)
@@ -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),
index dd788da10ddfdc71384a6c449de281bf00ba0c76..6bd49acfc95ad657fcf02511d734d5690da7f4bd 100644 (file)
@@ -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,