ia64/xen-unstable
changeset 12753:c4225c95dbcd
[XEND] Fix outputting device SXPs when domain is halted.
Signed-off-by: Alastair Tse <atse@xensource.com>
Signed-off-by: Alastair Tse <atse@xensource.com>
author | Alastair Tse <atse@xensource.com> |
---|---|
date | Fri Dec 01 16:31:36 2006 +0000 (2006-12-01) |
parents | 5c82a274733e |
children | 69efe6730fb1 dc9a47212ac4 |
files | tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py |
line diff
1.1 --- a/tools/python/xen/xend/XendConfig.py Fri Dec 01 15:45:59 2006 +0000 1.2 +++ b/tools/python/xen/xend/XendConfig.py Fri Dec 01 16:31:36 2006 +0000 1.3 @@ -964,7 +964,7 @@ class XendConfig(dict): 1.4 sxprs = [] 1.5 pci_devs = [] 1.6 1.7 - if 'devices' in self: 1.8 + if 'devices' not in self: 1.9 return sxprs 1.10 1.11 for dev_type, dev_info in self['devices'].values():
2.1 --- a/tools/python/xen/xend/XendDomainInfo.py Fri Dec 01 15:45:59 2006 +0000 2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py Fri Dec 01 16:31:36 2006 +0000 2.3 @@ -580,8 +580,18 @@ class XendDomainInfo: 2.4 return self.getDeviceController(deviceClass).destroyDevice(devid) 2.5 2.6 2.7 + 2.8 def getDeviceSxprs(self, deviceClass): 2.9 - return self.getDeviceController(deviceClass).sxprs() 2.10 + if self.state == DOM_STATE_RUNNING: 2.11 + return self.getDeviceController(deviceClass).sxprs() 2.12 + else: 2.13 + sxprs = [] 2.14 + dev_num = 0 2.15 + for dev_type, dev_info in self.info.all_devices_sxpr(): 2.16 + if dev_type == deviceClass: 2.17 + sxprs.append([dev_num, dev_info]) 2.18 + dev_num += 1 2.19 + return sxprs 2.20 2.21 2.22 def setMemoryTarget(self, target):