ia64/xen-unstable

changeset 19598:07fbc48553e8

passthrough: Fix PCI hot-plug option parsing

When a PCI function is passed-through extra options may be passed
through.
In the case of boot-time PCI pass-through the documented format is:
[dom:]bus:dev.slot[@vslot][[,opt]...]
e.g.
00:01.00.1@7,msitranslate=3D1

In the case of PCI hot-plug the xm pci-attach command take the
following arguments:
[-o opt[,opt]...] [dom:]bus:dev.slot [vslot]
e.g.
-o msitranslate=3D1 00:01.00.1 7

These xm ends up passing these to xem-qemu as:
[dom:]bus:dev.slot[[,opt]...][@vslot]
e.g.
00:01.00.1,msitranslate=3D1@7

Note that the option and the vslot have are transposed when
compared to the format used by boot-time PCI pass-through.

The parser inside qemu-xen can only handle the format used by
boot-time PCI pass-through and because of this ignores
any options passed by hot-plug.

This patch alters format used by hot-plug to match the parser.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Wed May 13 10:28:35 2009 +0100 (2009-05-13)
parents 2522cc95efd2
children 7d552e56d105
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Mon May 11 13:52:04 2009 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed May 13 10:28:35 2009 +0100
     1.3 @@ -706,12 +706,12 @@ class XendDomainInfo:
     1.4                  config_opts = map(lambda (x, y): x+'='+y, config_opts)
     1.5                  opts = ',' + reduce(lambda x, y: x+','+y, config_opts)
     1.6  
     1.7 -            bdf_str = "%s:%s:%s.%s%s@%s" % (new_dev['domain'],
     1.8 +            bdf_str = "%s:%s:%s.%s@%s%s" % (new_dev['domain'],
     1.9                  new_dev['bus'],
    1.10                  new_dev['slot'],
    1.11                  new_dev['func'],
    1.12 -                opts,
    1.13 -                new_dev['vslot'])
    1.14 +                new_dev['vslot'],
    1.15 +                opts)
    1.16              self.image.signalDeviceModel('pci-ins', 'pci-inserted', bdf_str)
    1.17  
    1.18              vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter"