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-unstable] xm: pass-through: sort the output of xm p

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm: pass-through: sort the output of xm pci-list
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Jun 2009 10:25:43 -0700
Delivery-date: Thu, 04 Jun 2009 10:28:39 -0700
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244108624 -3600
# Node ID 6c24ffb01d6b6cda926032eacb55471b7eb449dd
# Parent  691087b8d4ac15f4e6d2a4e3dfce6feea596bdd9
xm: pass-through: sort the output of xm pci-list

Other than being arguably more human readable,
this patch reconciles the output differences between
using Xen API and xmlrpc to manipulate domains.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/util/pci.py |    4 ++++
 tools/python/xen/xm/main.py  |    3 +++
 2 files changed, 7 insertions(+)

diff -r 691087b8d4ac -r 6c24ffb01d6b tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Thu Jun 04 10:43:20 2009 +0100
+++ b/tools/python/xen/util/pci.py      Thu Jun 04 10:43:44 2009 +0100
@@ -113,6 +113,10 @@ PAGE_MASK=~(PAGE_SIZE - 1)
 # Definitions from Linux: include/linux/pci.h
 def PCI_DEVFN(slot, func):
     return ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+
+def PCI_BDF(domain, bus, slot, func):
+    return (((domain & 0xffff) << 16) | ((bus & 0xff) << 8) |
+            PCI_DEVFN(slot, func))
 
 def serialise_pci_opts(opts):
     return reduce(lambda x, y: x+','+y, map(lambda (x, y): x+'='+y, opts))
diff -r 691087b8d4ac -r 6c24ffb01d6b tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Thu Jun 04 10:43:20 2009 +0100
+++ b/tools/python/xen/xm/main.py       Thu Jun 04 10:43:44 2009 +0100
@@ -2204,6 +2204,9 @@ def xm_pci_list(args):
 
     if len(devs) == 0:
         return
+
+    devs.sort(None, lambda x: x['vslot'] << 32 | PCI_BDF(x['domain'], x['bus'],
+                                                         x['slot'], x['func']))
 
     has_vslot = False
     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-unstable] xm: pass-through: sort the output of xm pci-list, Xen patchbot-unstable <=