aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-03-09 17:05:43 +0000
committerIan Campbell <ian.campbell@citrix.com>2011-03-09 17:05:43 +0000
commit4c8c24a08871077b0250cbb6a3916af7a1f6b66c (patch)
treec6bd4c5b72c13290ad45df18947837e350bbff7b /tools/python
parent8f53c184ea06bb1f060ce9ad30bc24893ff9c950 (diff)
downloadxen-4c8c24a08871077b0250cbb6a3916af7a1f6b66c.tar.gz
xen-4c8c24a08871077b0250cbb6a3916af7a1f6b66c.tar.bz2
xen-4c8c24a08871077b0250cbb6a3916af7a1f6b66c.zip
xl/xm: make pci-list use same BDF format as all other commands
In particular using the same syntax as pci-{attach,detach} uses is very helpful. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/xen/xm/main.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 66e95ea92c..df861b13b4 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -2483,18 +2483,16 @@ def xm_pci_list(args):
has_vdevfn = False
for x in devs:
if x['vdevfn'] & AUTO_PHP_SLOT:
- x['show_vslot'] = '-'
- x['show_vfunc'] = '-'
+ x['show_vdevfn'] = '-'
else:
- x['show_vslot'] = "0x%02x" % PCI_SLOT(x['vdevfn'])
- x['show_vfunc'] = "0x%x" % PCI_FUNC(x['vdevfn'])
+ x['show_vdevfn'] = "%02x.%01x" % (PCI_SLOT(x['vdevfn']), PCI_FUNC(x['vdevfn']))
has_vdevfn = True
- hdr_str = 'domain bus slot func'
- fmt_str = '0x%(domain)04x 0x%(bus)02x 0x%(slot)02x 0x%(func)x'
+ hdr_str = 'Device'
+ fmt_str = '%(domain)04x:%(bus)02x:%(slot)02x.%(func)x'
if has_vdevfn:
- hdr_str = 'VSlt VFn ' + hdr_str
- fmt_str = '%(show_vslot)-4s %(show_vfunc)-3s ' + fmt_str
+ hdr_str = 'Vdev ' + hdr_str
+ fmt_str = '%(show_vdevfn)-4s ' + fmt_str
print hdr_str
for x in devs: