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] xend: pass-through: Add pci_tuple_to_dict

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pass-through: Add pci_tuple_to_dict()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:56:13 -0700
Delivery-date: Fri, 19 Jun 2009 01:05:30 -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 1245220683 -3600
# Node ID d8b2b1712ea65191abb5b84b071ad90bd21c37bb
# Parent  bc7715954087610d71e3da26dfd9721d00c25c30
xend: pass-through: Add pci_tuple_to_dict()

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/xm/create.py |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff -r bc7715954087 -r d8b2b1712ea6 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Jun 17 07:37:26 2009 +0100
+++ b/tools/python/xen/xm/create.py     Wed Jun 17 07:38:03 2009 +0100
@@ -38,7 +38,7 @@ import xen.util.xsm.xsm as security
 import xen.util.xsm.xsm as security
 from xen.xm.main import serverType, SERVER_XEN_API, get_single_vm
 from xen.util import utils, auxbin
-from xen.util.pci import pci_opts_list_to_sxp, \
+from xen.util.pci import dev_dict_to_sxp, \
                          parse_pci_name_extended, PciDeviceParseError
 
 from xen.xm.opts import *
@@ -707,12 +707,9 @@ def configure_pci(config_devs, vals):
     """Create the config for pci devices.
     """
     config_pci = []
-    for (domain, bus, slot, func, vslot, opts) in vals.pci:
-        config_pci_bdf = ['dev', ['domain', domain], ['bus', bus], \
-                          ['slot', slot], ['func', func],
-                          ['vslot', vslot]]
-        config_opts = pci_opts_list_to_sxp(opts)
-        config_pci.append(sxp.merge(config_pci_bdf, config_opts))
+    for pci_tuple in vals.pci:
+        pci_dev = pci_tuple_to_dict(pci_tuple)
+        config_pci.append(dev_dict_to_sxp(pci_dev))
 
     if len(config_pci)>0:
         config_pci.insert(0, 'pci')
@@ -1049,6 +1046,16 @@ def pci_dict_to_tuple(dev):
 def pci_dict_to_tuple(dev):
     return (dev['domain'], dev['bus'], dev['slot'], dev['func'],
             dev['vslot'], dev.get('opts', []))
+
+def pci_tuple_to_dict((domain, bus, slot, func, vslot, opts)):
+    pci_dev = { 'domain': domain,
+                'bus':    bus,
+                'slot':   slot,
+                'func':   func,
+                'vslot':  vslot}
+    if len(opts) > 0:
+        pci_dev['opts'] = opts
+    return pci_dev
 
 def preprocess_pci(vals):
     if not vals.pci:

_______________________________________________
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] xend: pass-through: Add pci_tuple_to_dict(), Xen patchbot-unstable <=