aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-03-09 17:07:17 +0000
committerIan Campbell <ian.campbell@citrix.com>2011-03-09 17:07:17 +0000
commit1dfa060e7d2b1ae801db70c5f549be775472ce50 (patch)
treebec16ae37115bb10674995e92ba2631d13a255bc
parentfa1e347188686d72b3bf48600aca4110de29384d (diff)
downloadxen-1dfa060e7d2b1ae801db70c5f549be775472ce50.tar.gz
xen-1dfa060e7d2b1ae801db70c5f549be775472ce50.tar.bz2
xen-1dfa060e7d2b1ae801db70c5f549be775472ce50.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. (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>
-rw-r--r--tools/libxl/xl_cmdimpl.c6
-rw-r--r--tools/python/xen/xm/main.py14
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index de7230dd53..121a58615f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2077,9 +2077,11 @@ static void pcilist(const char *dom)
if (libxl_device_pci_list_assigned(&ctx, &pcidevs, domid, &num))
return;
- printf("VFn domain bus slot func\n");
+ printf("Vdev Device\n");
for (i = 0; i < num; i++) {
- printf("0x%02x 0x%04x 0x%02x 0x%02x 0x%01x\n", pcidevs[i].vdevfn, pcidevs[i].domain, pcidevs[i].bus, pcidevs[i].dev, pcidevs[i].func);
+ printf("%02x.%01x %04x:%02x:%02x.%01x\n",
+ (pcidevs[i].vdevfn >> 3) & 0x1f, pcidevs[i].vdevfn & 0x7,
+ pcidevs[i].domain, pcidevs[i].bus, pcidevs[i].dev, pcidevs[i].func);
libxl_device_pci_destroy(&pcidevs[i]);
}
free(pcidevs);
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: