WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.1-testing] xl/xm: make pci-list use same BDF form

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] xl/xm: make pci-list use same BDF format as all other commands
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Thu, 10 Mar 2011 12:50:10 +0000
Delivery-date: Thu, 10 Mar 2011 04:50:43 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1299690437 0
# Node ID b147b1cf57939cf63d6896c57216697fb286ff48
# Parent  7ce181dd252d9bfca98358057e903b5f34000a52
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 7ce181dd252d -r b147b1cf5793 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Mar 09 17:04:32 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Wed Mar 09 17:07:17 2011 +0000
@@ -2077,9 +2077,11 @@
 
     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 -r 7ce181dd252d -r b147b1cf5793 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Mar 09 17:04:32 2011 +0000
+++ b/tools/python/xen/xm/main.py       Wed Mar 09 17:07:17 2011 +0000
@@ -2483,18 +2483,16 @@
     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:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] xl/xm: make pci-list use same BDF format as all other commands, Xen patchbot-4 . 1-testing <=