ia64/xen-unstable

changeset 14491:07d1bd92ade8

Fix xm block-list through the Xen-API for managed domains.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Mar 20 17:33:35 2007 +0000 (2007-03-20)
parents ee06d8b5712f
children 92f14ace389c
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Mar 20 17:30:52 2007 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Mar 20 17:33:35 2007 +0000
     1.3 @@ -37,6 +37,7 @@ import time
     1.4  import datetime
     1.5  from select import select
     1.6  import xml.dom.minidom
     1.7 +from xen.util.blkif import blkdev_name_to_number
     1.8  
     1.9  import warnings
    1.10  warnings.filterwarnings('ignore', category=FutureWarning)
    1.11 @@ -1724,7 +1725,12 @@ def xm_block_list(args):
    1.12          vbd_refs = server.xenapi.VM.get_VBDs(get_single_vm(dom))
    1.13          vbd_properties = \
    1.14              map(server.xenapi.VBD.get_runtime_properties, vbd_refs)
    1.15 -        devs = map(lambda x: [x.get('virtual-device'), map2sxp(x)], vbd_properties)
    1.16 +        vbd_devs = \
    1.17 +            map(server.xenapi.VBD.get_device, vbd_refs)
    1.18 +        vbd_devids = \
    1.19 +            map(blkdev_name_to_number, vbd_devs)
    1.20 +        devs = map(lambda (devid, prop): [devid, map2sxp(prop)],
    1.21 +                   zip(vbd_devids, vbd_properties))
    1.22      else:
    1.23          devs = server.xend.domain.getDeviceSxprs(dom, 'vbd')
    1.24