From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Horman Subject: [patch v2] xend: pass-through: Use generic code in pci_opts_list_to_sxp() Date: Mon, 15 Jun 2009 21:59:03 +1000 Message-ID: <20090615115902.GC3552@verge.net.au> References: <20090615015515.927085604@vergenet.net> <20090615015913.106513111@vergenet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20090615015913.106513111@vergenet.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Masaki Kanno , Dexuan Cui List-Id: xen-devel@lists.xenproject.org Use dev_dict_to_sxp() inside pci_opts_list_to_sxp() now that it is available. Cc: Dexuan Cui Cc: Masaki Kanno Signed-off-by: Simon Horman --- Mon, 15 Jun 2009 11:55:27 +1000 * Initial posting Mon, 15 Jun 2009 20:38:21 +1000 * dev_dict_to_sxp() is now in XendSXPDev.py Index: xen-unstable.hg/tools/python/xen/util/pci.py =================================================================== --- xen-unstable.hg.orig/tools/python/xen/util/pci.py 2009-06-15 20:13:52.000000000 +1000 +++ xen-unstable.hg/tools/python/xen/util/pci.py 2009-06-15 20:35:32.000000000 +1000 @@ -136,7 +136,7 @@ def split_pci_opts(opts): filter(lambda x: x != '', opts.split(','))) def pci_opts_list_to_sxp(list): - return ['dev'] + map(lambda x: ['opts', x], list) + return dev_dict_to_sxp({'opts': list}) def pci_opts_list_from_sxp(dev): return map(lambda x: sxp.children(x)[0], sxp.children(dev, 'opts')) Index: xen-unstable.hg/tools/python/xen/xend/XendSXPDev.py =================================================================== --- xen-unstable.hg.orig/tools/python/xen/xend/XendSXPDev.py 2009-06-15 20:35:56.000000000 +1000 +++ xen-unstable.hg/tools/python/xen/xend/XendSXPDev.py 2009-06-15 20:36:06.000000000 +1000 @@ -4,7 +4,6 @@ import types -# This includes a generic equivalent of pci_opts_list_to_sxp() def dev_dict_to_sxp(dev): def f((key, val)): if isinstance(val, types.ListType):