xm on xenapi: Enable 'xm pci-list' via Xen-API

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
This commit is contained in:
Keir Fraser committed 2008-08-04 11:11:02 +01:00
1 parent ad67b382bb
commit f6a15c6354
1 file changed
+17 -1
+17 -1
View File
@@ -2158,7 +2158,23 @@ def xm_pci_list(args):
dom = params[0]
devs = server.xend.domain.getDeviceSxprs(dom, 'pci')
devs = []
if serverType == SERVER_XEN_API:
for dpci_ref in server.xenapi.VM.get_DPCIs(get_single_vm(dom)):
ppci_ref = server.xenapi.DPCI.get_PPCI(dpci_ref)
ppci_record = server.xenapi.PPCI.get_record(ppci_ref)
dev = {
"domain": "0x%04x" % int(ppci_record["domain"]),
"bus": "0x%02x" % int(ppci_record["bus"]),
"slot": "0x%02x" % int(ppci_record["slot"]),
"func": "0x%01x" % int(ppci_record["func"]),
"vslt": "0x%02x" % \
int(server.xenapi.DPCI.get_hotplug_slot(dpci_ref))
}
devs.append(dev)
else:
devs = server.xend.domain.getDeviceSxprs(dom, 'pci')
if len(devs) == 0:
return
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.