Allow to provide mdev addresses as list

With new Ampere GPUs you need to explicitly define explicit lists of PCI
devices which length depends on picked type as placement can't pick them
automatically due to nvidia driver brokeness.

In order to have readable representation of the variable it's worth
to make it iterable but keep a simple string for
backwards compatability.

Change-Id: I2a1e85efc8ad4f6a2596e6d53b1d793b2f934758
This commit is contained in:
Dmitriy Rabotyagov
2021-11-12 13:02:06 +02:00
parent d62950ac51
commit ab3bbd50d5
2 changed files with 5 additions and 3 deletions

View File

@@ -300,7 +300,7 @@ enabled_mdev_types = {{ nova_enabled_mdev_types | map(attribute='type') | list |
{% for record in nova_enabled_mdev_types | selectattr('address', 'defined') | list %}
[mdev_{{ record.type }}]
device_addresses = {{ record.address }}
device_addresses = {{ (record.address is string) | ternary(record.address, record.address | join(',')) }}
{% endfor %}
{% endif %}