ia64/xen-unstable

changeset 12217:70687bcb82dd

[XEND] Compare result of blkdev_name_to_number() explicitly against None.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Nov 02 07:46:06 2006 +0000 (2006-11-02)
parents 9a4274724794
children e6fdb32b786c 41ad2c673fdb
files tools/python/xen/util/blkif.py tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/util/blkif.py	Wed Nov 01 19:44:34 2006 +0000
     1.2 +++ b/tools/python/xen/util/blkif.py	Thu Nov 02 07:46:06 2006 +0000
     1.3 @@ -52,7 +52,7 @@ def blkdev_segment(name):
     1.4      """
     1.5      val = None
     1.6      n = blkdev_name_to_number(name)
     1.7 -    if n:
     1.8 +    if not n is None:
     1.9          val = { 'device'       : n,
    1.10                  'start_sector' : long(0),
    1.11                  'nr_sectors'   : long(1L<<63),
     2.1 --- a/tools/python/xen/xend/server/blkif.py	Wed Nov 01 19:44:34 2006 +0000
     2.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Nov 02 07:46:06 2006 +0000
     2.3 @@ -80,7 +80,7 @@ class BlkifController(DevController):
     2.4                           'acm_policy' : policy})
     2.5  
     2.6          devid = blkif.blkdev_name_to_number(dev)
     2.7 -        if not devid:
     2.8 +        if devid is None:
     2.9              raise VmError('Unable to find number for device (%s)' % (dev))
    2.10  
    2.11          front = { 'virtual-device' : "%i" % devid,