From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosuke Iwamatsu Subject: [PATCH] tools: More Accurate Parsing of PCI Config Date: Wed, 19 Mar 2008 15:24:31 +0900 Message-ID: <47E0B19F.5000507@ab.jp.nec.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010403060703050107000700" Return-path: 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 List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010403060703050107000700 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Hi, The attached patch is to fix pci device name parsing in xm/xend. This disallows illegal pci notations specified in domain config files, such as 0:2.0.0 which is supposed to be 0:2:0.0. (A similar problem on pci-attach/detach was pointed out in the following mail and already fixed. http://lists.xensource.com/archives/html/xen-devel/2008-03/msg00271.html) Regards, ------------------ Yosuke Iwamatsu NEC Corporation --------------010403060703050107000700 Content-Type: all/allfiles; name="pciconfig_parse.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pciconfig_parse.patch" # HG changeset patch # User y-iwamatsu@ab.jp.nec.com # Date 1205903225 -32400 # Node ID cdeafb36df14650ed327e0d7c6b444157787c770 # Parent f33328217eee1a66bf2a874ff1a42b62c21e42bc tools: More accurate parsing of pci config. Signed-off-by: Yosuke Iwamatsu diff -r f33328217eee -r cdeafb36df14 tools/python/xen/xend/server/pciif.py --- a/tools/python/xen/xend/server/pciif.py Mon Mar 10 22:51:57 2008 +0000 +++ b/tools/python/xen/xend/server/pciif.py Wed Mar 19 14:07:05 2008 +0900 @@ -125,7 +125,7 @@ class PciController(DevController): pci_match = re.match(r"((?P[0-9a-fA-F]{1,4})[:,])?" + r"(?P[0-9a-fA-F]{1,2})[:,]" + r"(?P[0-9a-fA-F]{1,2})[.,]" + - r"(?P[0-9a-fA-F]{1,2})", dev_config) + r"(?P[0-7]{1,2})$", dev_config) if pci_match!=None: pci_dev_info = pci_match.groupdict() diff -r f33328217eee -r cdeafb36df14 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Mon Mar 10 22:51:57 2008 +0000 +++ b/tools/python/xen/xm/create.py Wed Mar 19 14:07:05 2008 +0900 @@ -304,7 +304,7 @@ gopts.var('pci', val='BUS:DEV.FUNC', gopts.var('pci', val='BUS:DEV.FUNC', fn=append_value, default=[], use="""Add a PCI device to a domain, using given params (in hex). - For example 'pci=c0:02.1a'. + For example 'pci=c0:02.1'. The option may be repeated to add more than one pci device.""") gopts.var('ioports', val='FROM[-TO]', @@ -840,7 +840,7 @@ def preprocess_pci(vals): pci_match = re.match(r"((?P[0-9a-fA-F]{1,4})[:,])?" + \ r"(?P[0-9a-fA-F]{1,2})[:,]" + \ r"(?P[0-9a-fA-F]{1,2})[.,]" + \ - r"(?P[0-9a-fA-F])", pci_dev_str) + r"(?P[0-7])$", pci_dev_str) if pci_match!=None: pci_dev_info = pci_match.groupdict('0') try: --------------010403060703050107000700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010403060703050107000700--