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 on xenapi: Enable 'xm pci-list' via Xe

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm on xenapi: Enable 'xm pci-list' via Xen-API
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Aug 2008 15:10:14 -0700
Delivery-date: Mon, 04 Aug 2008 15:10:27 -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 1217844662 -3600
# Node ID 206db026800c23349102645f5bc0a053362cf70e
# Parent  9113b3bacfac5458e2ef85a242c6da0e8e5ae28f
xm on xenapi: Enable 'xm pci-list' via Xen-API

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/main.py |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletion(-)

diff -r 9113b3bacfac -r 206db026800c tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Aug 04 11:10:27 2008 +0100
+++ b/tools/python/xen/xm/main.py       Mon Aug 04 11:11:02 2008 +0100
@@ -2158,7 +2158,23 @@ def xm_pci_list(args):
 
     dom = params[0]
 
-    devs = server.xend.domain.getDeviceSxprs(dom, 'pci')
+    devs = []
+    if serverType == SERVER_XEN_API:
+        for dpci_ref in server.xenapi.VM.get_DPCIs(get_single_vm(dom)):
+            ppci_ref = server.xenapi.DPCI.get_PPCI(dpci_ref)
+            ppci_record = server.xenapi.PPCI.get_record(ppci_ref)
+            dev = {
+                "domain":   "0x%04x" % int(ppci_record["domain"]),
+                "bus":      "0x%02x" % int(ppci_record["bus"]),
+                "slot":     "0x%02x" % int(ppci_record["slot"]),
+                "func":     "0x%01x" % int(ppci_record["func"]),
+                "vslt":     "0x%02x" % \
+                            int(server.xenapi.DPCI.get_hotplug_slot(dpci_ref))
+            }
+            devs.append(dev)
+
+    else:
+        devs = server.xend.domain.getDeviceSxprs(dom, 'pci')
 
     if len(devs) == 0:
         return

_______________________________________________
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 on xenapi: Enable 'xm pci-list' via Xen-API, Xen patchbot-unstable <=