diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-04-23 10:11:33 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-04-23 10:11:33 +0100 |
commit | 5bacab31726fb8e4dbedeba2eb737541b13b0aab (patch) | |
tree | 6e725a3ae3ecb7e0a68007e5097c4f4e5ea7c141 | |
parent | b0514069f1261fee7ee9832ddd47d741ae938370 (diff) | |
download | xen-5bacab31726fb8e4dbedeba2eb737541b13b0aab.tar.gz xen-5bacab31726fb8e4dbedeba2eb737541b13b0aab.tar.bz2 xen-5bacab31726fb8e4dbedeba2eb737541b13b0aab.zip |
xm: Fix hot-unplug of statically-assigned devices
Prior to changset 19510:5c69f98c348e - 'xm, xend: Replace "vslt" with
"vslot"', both vslt and vslot were used in the xm code, often fairly
arbitrarily.
However, in the dictionary that describes a pci function both vslt and
vslot were present. vslt stored the slot assigned to the function. And
vslot stored the slot the user requested for the function, or
AUTO_PHP_SLOT if no slot was requested.
With the renaming these two values got merged into a single entry.
This patch un-merges them by renaming the what was vslot to
requested_vslot.
So an out of chronological order list of name changes is:
'vslot' -> 'requested_vslot'
'vslt' -> 'vslot'
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | tools/python/xen/xend/XendConfig.py | 4 | ||||
-rw-r--r-- | tools/python/xen/xend/server/pciif.py | 4 | ||||
-rw-r--r-- | tools/python/xen/xm/create.py | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 591a22ddea..02b7d91955 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1285,7 +1285,7 @@ class XendConfig(dict): dpci_record = { 'VM': self['uuid'], 'PPCI': ppci_uuid, - 'hotplug_slot': pci_dev.get('vslot', 0) + 'hotplug_slot': pci_dev.get('requested_vslot', 0) } dpci_opts = pci_dev.get('opts') @@ -1847,7 +1847,7 @@ class XendConfig(dict): dpci_record = { 'VM': self['uuid'], 'PPCI': ppci_uuid, - 'hotplug_slot': pci_dev.get('vslot', 0) + 'hotplug_slot': pci_dev.get('requested_vslot', 0) } dpci_opts = pci_dev.get('opts') diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py index 1579262459..1515c9f05d 100644 --- a/tools/python/xen/xend/server/pciif.py +++ b/tools/python/xen/xend/server/pciif.py @@ -79,7 +79,7 @@ class PciController(DevController): bus = parse_hex(pci_config.get('bus', 0)) slot = parse_hex(pci_config.get('slot', 0)) func = parse_hex(pci_config.get('func', 0)) - vslot = parse_hex(pci_config.get('vslot', 0)) + requested_vslot = parse_hex(pci_config.get('requested_vslot', 0)) opts = pci_config.get('opts', '') if len(opts) > 0: @@ -90,7 +90,7 @@ class PciController(DevController): back['dev-%i' % pcidevid] = "%04x:%02x:%02x.%01x" % \ (domain, bus, slot, func) back['uuid-%i' % pcidevid] = pci_config.get('uuid', '') - back['vslot-%i' % pcidevid] = "%02x" % vslot + back['vslot-%i' % pcidevid] = "%02x" % requested_vslot pcidevid += 1 if vslots != "": diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 61655ea61c..b663fafd31 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -710,7 +710,8 @@ def configure_pci(config_devs, vals): config_pci_opts.append([k, d[k]]) config_pci_bdf = ['dev', ['domain', domain], ['bus', bus], \ - ['slot', slot], ['func', func], ['vslot', vslot]] + ['slot', slot], ['func', func], + ['requested_vslot', vslot]] map(f, d.keys()) if len(config_pci_opts)>0: config_pci_bdf.append(['opts', config_pci_opts]) |