From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C277B1FAC34 for ; Mon, 11 Aug 2025 20:12:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754943153; cv=none; b=gMkqotE4R1RjOLefeFFzGq8mWUq6DnHC8qv9T53HYlOhDutx8DCUoNbas5kFurzO9oqleI2ECl8JT75gLsMbveYCsfhCcLPTSk6bvy5ffgu411Oyo/LhG39UzAqUjqIlrzXxHGfZWb2gyw5H/RnkGehiMqJSGIXRAWO8KbWjIDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754943153; c=relaxed/simple; bh=W3SP6Br9l1x8/706vMzZnE/JDP20AE/2PmHFwfvNrog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZC2QbeVQjW4x9fkkuXJcddrbtv6/IkLJZ9TYJDinaJGyQjJDHUjEdz0HgC/rxLJugoBjrw0a+htjP4n0Ddw7ZJqeNRIURQuK7rm6JducWHT9ieta4iCjHPDS4OSIrk9FXk/3ny2SvNgbwnYAtpaKFWDiOK70zSZ0QAShyALRK1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=RuQnEwKa; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RuQnEwKa" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=UrVRyGYJ/he9i8ZcmLNWnRf9IR3vFV5PCX2maOch7M4=; b=RuQnEwKatTFDFv8ry7Vl5EoMxD XadJ0NOelxwpqGyKNYpAln/TcBASB5PSiQE+F26Yqin5PCg9pV6IiVDm+G2+21V0MfqL22wnzwpld ieuGGxXGnrH3OSLUgxJzfqeAj8wwWjPm3euib4M34Jp9xGSRUx4y3imsrjvBllNeqvgH+K0PWHOSe ktSJPcpEqVSd00xZa5uRJ/5w34nCQaG67TNjnSmzJr9JDlK0aCME5sqNEG7Ki5E1D24MKO4RDc/qA D8PwaWmOEq48ceOZKwAf/52q+93fmzG5aK199zoWDotPPPHE0uIsG5i65lBBnPxLY89IGMl4d2S/s szeAVd2w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ulYsh-0000000903t-1deP; Mon, 11 Aug 2025 20:12:31 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 2/8] gen-dynamic-pci: fix PCI passthrough target guest default value Date: Mon, 11 Aug 2025 13:12:24 -0700 Message-ID: <20250811201230.2145164-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250811201230.2145164-1-mcgrof@kernel.org> References: <20250811201230.2145164-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain 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 Signed-off-by: Luis Chamberlain --- playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py | 4 ++-- playbooks/roles/gen_nodes/templates/guestfs_nodes.j2 | 2 +- playbooks/roles/gen_nodes/templates/hosts.j2 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py b/playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py index 107bb25..f86ce74 100755 --- a/playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py +++ b/playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py @@ -95,9 +95,9 @@ def add_pcie_kconfig_name(config_name, sdevice): def add_pcie_kconfig_target(config_name, sdevice): sys.stdout.write("config %s_TARGET_GUEST\n" % (config_name)) sys.stdout.write( - '\tstring "Taret guest to offload %s"\n' % (strip_kconfig_name(sdevice)) + '\tstring "Target guest to offload %s"\n' % (strip_kconfig_name(sdevice)) ) - sys.stdout.write('\tdefault ""\n') + sys.stdout.write('\tdefault KDEVOPS_HOSTS_PREFIX\n') sys.stdout.write("\tdepends on %s\n" % config_name) sys.stdout.write("\tdepends on KDEVOPS_LIBVIRT_PCIE_PASSTHROUGH_TYPE_EACH\n") sys.stdout.write("\thelp\n") diff --git a/playbooks/roles/gen_nodes/templates/guestfs_nodes.j2 b/playbooks/roles/gen_nodes/templates/guestfs_nodes.j2 index 5e87df3..a548f25 100644 --- a/playbooks/roles/gen_nodes/templates/guestfs_nodes.j2 +++ b/playbooks/roles/gen_nodes/templates/guestfs_nodes.j2 @@ -1,3 +1,3 @@ --- guestfs_nodes: -{% include './templates/hosts.j2' %} +{% include 'hosts.j2' -%} diff --git a/playbooks/roles/gen_nodes/templates/hosts.j2 b/playbooks/roles/gen_nodes/templates/hosts.j2 index ca4d2cb..a7f8b82 100644 --- a/playbooks/roles/gen_nodes/templates/hosts.j2 +++ b/playbooks/roles/gen_nodes/templates/hosts.j2 @@ -1,6 +1,6 @@ -{% from "gen_nodes_list.j2" import gen_nodes_list %} +{% from "gen_nodes_list.j2" import gen_nodes_list -%} {{ gen_nodes_list( nodes, kdevops_baseline_and_dev, 100, pcie_passthrough_enable, pcie_passthrough_target_type, pcie_passthrough_target, - pcie_passthrough_devices ) }} + pcie_passthrough_devices ) | replace("None", "") }} -- 2.47.2