Skip to content

Commit b8bfcea

Browse files
committed
gen-dynamic-pci: fix PCI passthrough target guest default value
Fix two issues preventing PCI passthrough configuration from appearing in generated nodes files: 1. Template generation was producing "None" in YAML files due to incorrect include path and missing None handling in the Jinja2 template. Fixed by correcting the include path and adding a replace filter to remove "None" values. 2. PCI passthrough target_guest field was defaulting to empty string, preventing devices from being assigned to guests. Fixed by setting the Kconfig default to reference KDEVOPS_HOSTS_PREFIX, which automatically assigns devices to the configured host prefix (e.g., "debian13"). With these fixes, PCI passthrough configuration now correctly appears in the generated guestfs/kdevops_nodes.yaml file when devices are enabled and target_guest is properly configured. Generated-by: Claude AI Reviewed-by: Chuck Lever <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent a1bedce commit b8bfcea

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def add_pcie_kconfig_name(config_name, sdevice):
9595
def add_pcie_kconfig_target(config_name, sdevice):
9696
sys.stdout.write("config %s_TARGET_GUEST\n" % (config_name))
9797
sys.stdout.write(
98-
'\tstring "Taret guest to offload %s"\n' % (strip_kconfig_name(sdevice))
98+
'\tstring "Target guest to offload %s"\n' % (strip_kconfig_name(sdevice))
9999
)
100-
sys.stdout.write('\tdefault ""\n')
100+
sys.stdout.write('\tdefault KDEVOPS_HOSTS_PREFIX\n')
101101
sys.stdout.write("\tdepends on %s\n" % config_name)
102102
sys.stdout.write("\tdepends on KDEVOPS_LIBVIRT_PCIE_PASSTHROUGH_TYPE_EACH\n")
103103
sys.stdout.write("\thelp\n")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
guestfs_nodes:
3-
{% include './templates/hosts.j2' %}
3+
{% include 'hosts.j2' -%}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{% from "gen_nodes_list.j2" import gen_nodes_list %}
1+
{% from "gen_nodes_list.j2" import gen_nodes_list -%}
22
{{ gen_nodes_list( nodes, kdevops_baseline_and_dev, 100,
33
pcie_passthrough_enable,
44
pcie_passthrough_target_type,
55
pcie_passthrough_target,
6-
pcie_passthrough_devices ) }}
6+
pcie_passthrough_devices ) | replace("None", "") }}

0 commit comments

Comments
 (0)