mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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.
(Backport from xen-unstable as 23015:1df8f9732d1d.)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
fa1e347188
commit
1dfa060e7d
2 files changed
+10
-10
No files matched your search
@@ -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:
|
||||
|
||||