ia64/xen-unstable

changeset 17264:b8e3dbca1677

tools: More accurate parsing of pci config.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 19 10:21:01 2008 +0000 (2008-03-19)
parents 258c528c874f
children 70f9a2110421
files tools/python/xen/xend/server/pciif.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xend/server/pciif.py	Wed Mar 19 10:20:17 2008 +0000
     1.2 +++ b/tools/python/xen/xend/server/pciif.py	Wed Mar 19 10:21:01 2008 +0000
     1.3 @@ -177,7 +177,7 @@ class PciController(DevController):
     1.4              pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" +
     1.5                                   r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + 
     1.6                                   r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + 
     1.7 -                                 r"(?P<func>[0-9a-fA-F]{1,2})", dev_config)
     1.8 +                                 r"(?P<func>[0-7]{1,2})$", dev_config)
     1.9              
    1.10              if pci_match!=None:
    1.11                  pci_dev_info = pci_match.groupdict()
     2.1 --- a/tools/python/xen/xm/create.py	Wed Mar 19 10:20:17 2008 +0000
     2.2 +++ b/tools/python/xen/xm/create.py	Wed Mar 19 10:21:01 2008 +0000
     2.3 @@ -304,7 +304,7 @@ gopts.var('disk', val='phy:DEV,VDEV,MODE
     2.4  gopts.var('pci', val='BUS:DEV.FUNC',
     2.5            fn=append_value, default=[],
     2.6            use="""Add a PCI device to a domain, using given params (in hex).
     2.7 -         For example 'pci=c0:02.1a'.
     2.8 +         For example 'pci=c0:02.1'.
     2.9           The option may be repeated to add more than one pci device.""")
    2.10  
    2.11  gopts.var('ioports', val='FROM[-TO]',
    2.12 @@ -844,7 +844,7 @@ def preprocess_pci(vals):
    2.13          pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
    2.14                  r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
    2.15                  r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
    2.16 -                r"(?P<func>[0-9a-fA-F])", pci_dev_str)
    2.17 +                r"(?P<func>[0-7])$", pci_dev_str)
    2.18          if pci_match!=None:
    2.19              pci_dev_info = pci_match.groupdict('0')
    2.20              try: