@samitouri / QOSamiQemu / commits / 504f2bad93

net: only advertise passt in netdev help when CONFIG_PASST

show_netdevs() lists each conditionally-compiled netdev backend behind its CONFIG_* guard (CONFIG_SLIRP for "user", CONFIG_L2TPV3 for "l2tpv3", CONFIG_NET_BRIDGE for "bridge", ...). The "passt" entry was added unconditionally, so "-netdev help" advertises passt even in builds configured with --disable-passt. Trying to use it then fails with "Parameter 'type' does not accept value 'passt'", since the QAPI NetClientDriver enum member "passt" is gated by 'if': 'CONFIG_PASST'. Guard the help entry with CONFIG_PASST so the advertised backends match those actually compiled into the binary. Signed-off-by: Rohitashv Kumar <roohiit@amazon.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Puranjay Mohan <puranjay@kernel.org> Message-ID: <20260713194511.1058450-1-rohit.kuma1313@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Rohitashv Kumar committed Jul 13, 2026 at 19:45 UTC 504f2bad932c4f1b067d3b759597ed38e57576a1
1 file changed +2
net/net.c
+2
@@ -1385,7 +1385,9 @@ void show_netdevs(void)
1385 "dgram",
1386 "hubport",
1387 "tap",
1388 +#ifdef CONFIG_PASST
1389 "passt",
1390 +#endif
1391 #ifdef CONFIG_SLIRP
1392 "user",
1393 #endif