# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228390363 0
# Node ID 1099be706d4e1ed971e1316ab4303fae274af26d
# Parent 63aa939c114cf88d400514a04d69165cff64759d
xm: Fix xm block-list for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
tools/python/xen/xend/XendDomainInfo.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletion(-)
diff -r 63aa939c114c -r 1099be706d4e tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Thu Dec 04 11:31:37 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py Thu Dec 04 11:32:43 2008 +0000
@@ -1018,7 +1018,8 @@ class XendDomainInfo:
sxprs = []
dev_num = 0
for dev_type, dev_info in self.info.all_devices_sxpr():
- if dev_type != deviceClass:
+ if (deviceClass == 'vbd' and dev_type not in ['vbd', 'tap'])
or \
+ (deviceClass != 'vbd' and dev_type != deviceClass):
continue
if deviceClass == 'vscsi':
@@ -1028,6 +1029,16 @@ class XendDomainInfo:
vscsi_devs[1].append(vscsi_dev)
dev_num = int(sxp.child_value(vscsi_dev, 'devid'))
sxprs.append([dev_num, [vscsi_devs]])
+ elif deviceClass == 'vbd':
+ dev = sxp.child_value(dev_info, 'dev')
+ if 'ioemu:' in dev:
+ (_, dev) = dev.split(':', 1)
+ try:
+ (dev_name, _) = dev.split(':', 1) # Remove ":disk" or
":cdrom"
+ except ValueError:
+ dev_name = dev
+ dev_num =
self.getDeviceController('vbd').convertToDeviceNumber(dev_name)
+ sxprs.append([dev_num, dev_info])
else:
sxprs.append([dev_num, dev_info])
dev_num += 1
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|