ia64/xen-unstable

changeset 18864:1099be706d4e

xm: Fix xm block-list for inactive managed domains

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Dec 04 11:32:43 2008 +0000 (2008-12-04)
parents 63aa939c114c
children cb289056b523
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 04 11:31:37 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 04 11:32:43 2008 +0000
     1.3 @@ -1018,7 +1018,8 @@ class XendDomainInfo:
     1.4              sxprs = []
     1.5              dev_num = 0
     1.6              for dev_type, dev_info in self.info.all_devices_sxpr():
     1.7 -                if dev_type != deviceClass:
     1.8 +                if (deviceClass == 'vbd' and dev_type not in ['vbd', 'tap']) or \
     1.9 +                   (deviceClass != 'vbd' and dev_type != deviceClass):
    1.10                      continue
    1.11  
    1.12                  if deviceClass == 'vscsi':
    1.13 @@ -1028,6 +1029,16 @@ class XendDomainInfo:
    1.14                          vscsi_devs[1].append(vscsi_dev)
    1.15                          dev_num = int(sxp.child_value(vscsi_dev, 'devid'))
    1.16                      sxprs.append([dev_num, [vscsi_devs]])
    1.17 +                elif deviceClass == 'vbd':
    1.18 +                    dev = sxp.child_value(dev_info, 'dev')
    1.19 +                    if 'ioemu:' in dev:
    1.20 +                        (_, dev) = dev.split(':', 1)
    1.21 +                    try:
    1.22 +                        (dev_name, _) = dev.split(':', 1)  # Remove ":disk" or ":cdrom"
    1.23 +                    except ValueError:
    1.24 +                        dev_name = dev
    1.25 +                    dev_num = self.getDeviceController('vbd').convertToDeviceNumber(dev_name)
    1.26 +                    sxprs.append([dev_num, dev_info])
    1.27                  else:
    1.28                      sxprs.append([dev_num, dev_info])
    1.29                      dev_num += 1