From d086389366ca9f76750c60c33db1d948a8bc69ff Mon Sep 17 00:00:00 2001 From: fpxie Date: Thu, 16 Aug 2018 10:05:23 +0800 Subject: [PATCH] Add an example to add more pci devices in nova.conf The help for the [pci]aliases config option was confusing in that it wasn't clear how to specify multiple aliases. The default value being [] made it seem like you ought to be able to specify a list as: alias = [{...}, {...}, ...] This won't actually work; you instead have to say: alias = {...} alias = {...} ... So this patch adds a multi-alias example to the help string and explicitly calls out the fact that you can't use list values. See the referenced bug for more details. Change-Id: I71d4c440340db31d22a73a8b3e3abc51771aa7bc Closes-Bug: #1786870 --- nova/conf/pci.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/nova/conf/pci.py b/nova/conf/pci.py index 8ca69e14a845..c93294b436d9 100644 --- a/nova/conf/pci.py +++ b/nova/conf/pci.py @@ -33,7 +33,7 @@ needing to repeat all the PCI property requirements. Possible Values: -* A list of JSON values which describe the aliases. For example:: +* A dictionary of JSON values which describe the aliases. For example:: alias = { "name": "QuickAssist", @@ -62,6 +62,24 @@ Possible Values: ``numa_policy`` Required NUMA affinity of device. Valid values are: ``legacy``, ``preferred`` and ``required``. + +* Supports multiple aliases by repeating the option (not by specifying + a list value):: + + alias = { + "name": "QuickAssist-1", + "product_id": "0443", + "vendor_id": "8086", + "device_type": "type-PCI", + "numa_policy": "required" + } + alias = { + "name": "QuickAssist-2", + "product_id": "0444", + "vendor_id": "8086", + "device_type": "type-PCI", + "numa_policy": "required" + } """), cfg.MultiStrOpt('passthrough_whitelist', default=[],