Skip to contentSkip to conversation

net: only advertise passt in netdev help when CONFIG_PASST

PATCH In review Rohitashv Kumar 4 participants 4 messages Jul 13 – Jul 18 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: only advertise passt in netdev help when CONFIG_PASST

From: Rohitashv Kumar <[email protected]>

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.

---
 net/net.c | 2 ++
 1 file changed, 2 insertions(+)
net/net.c +2 -0
index 2892f17..5c39f8e 100644
@@ -1385,7 +1385,9 @@ void show_netdevs(void)
         "dgram",
         "hubport",
         "tap",
+#ifdef CONFIG_PASST
         "passt",
+#endif
 #ifdef CONFIG_SLIRP
         "user",
 #endif
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rohitashv Kumar

From: Rohitashv Kumar <[email protected]>

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'.

Quoted 7 lines

Guard the help entry with CONFIG_PASST so the advertised backends match those actually compiled into the binary.

---
  net/net.c | 2 ++
  1 file changed, 2 insertions(+)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rohitashv Kumar
Quoted 10 lines · Rohitashv Kumar

From: Rohitashv Kumar <[email protected]>

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'.

Quoted 4 lines

Guard the help entry with CONFIG_PASST so the advertised backends match those actually compiled into the binary.

Thanks,
Puranjay

#3 lore raw
In reply to Rohitashv Kumar
Quoted 10 lines · Rohitashv Kumar

From: Rohitashv Kumar <[email protected]>

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'.

Quoted 4 lines

Guard the help entry with CONFIG_PASST so the advertised backends match those actually compiled into the binary.

I'm picking this trival fix up for qemu-stable - let's stop confusing people :)

Thanks,

/mjt