From: Markus Armbruster <armbru@redhat.com>
To: Rohitashv Kumar <rohit.kuma1313@gmail.com>
Cc: Jason Wang <jasowangio@gmail.com>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
Eric Blake <eblake@redhat.com>,
Rohitashv Kumar <roohiit@amazon.de>
Subject: Re: [PATCH] qapi/net: gate user/vde/netmap netdev backends behind their CONFIG symbols
Date: Thu, 20 Aug 2026 12:47:00 +0200 [thread overview]
Message-ID: <87mruh3w7v.fsf@pond.sub.org> (raw)
In-Reply-To: <20260728144303.223207-1-rohit.kuma1313@gmail.com> (Rohitashv Kumar's message of "Tue, 28 Jul 2026 14:43:03 +0000")
Rohitashv Kumar <rohit.kuma1313@gmail.com> writes:
> From: Rohitashv Kumar <roohiit@amazon.de>
>
> Their NetClientDriver enum members and Netdev union branches were
> unconditional, so query-qmp-schema advertised them even when built without
> CONFIG_SLIRP/CONFIG_VDE/CONFIG_NETMAP. Gate them, and guard the matching
> NET_CLIENT_DRIVER_USER/_VDE case labels in net/hub.c.
>
> Signed-off-by: Rohitashv Kumar <roohiit@amazon.de>
> ---
> net/hub.c | 4 ++++
> qapi/net.json | 19 +++++++++++++------
> 2 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/net/hub.c b/net/hub.c
> index ee5881f6d5..2a7c2bc6d7 100644
> --- a/net/hub.c
> +++ b/net/hub.c
> @@ -294,12 +294,16 @@ void net_hub_check_clients(void)
> #ifdef CONFIG_PASST
> case NET_CLIENT_DRIVER_PASST:
> #endif
> +#ifdef CONFIG_SLIRP
> case NET_CLIENT_DRIVER_USER:
> +#endif
> case NET_CLIENT_DRIVER_TAP:
> case NET_CLIENT_DRIVER_SOCKET:
> case NET_CLIENT_DRIVER_STREAM:
> case NET_CLIENT_DRIVER_DGRAM:
> +#ifdef CONFIG_VDE
> case NET_CLIENT_DRIVER_VDE:
> +#endif
> case NET_CLIENT_DRIVER_VHOST_USER:
> has_host_dev = 1;
> break;
> diff --git a/qapi/net.json b/qapi/net.json
> index 1a6382825c..e9f1300629 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -922,9 +922,13 @@
> # Since: 2.7
> ##
> { 'enum': 'NetClientDriver',
> - 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
> - 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
> - 'vhost-vdpa',
> + 'data': [ 'none', 'nic',
> + { 'name': 'user', 'if': 'CONFIG_SLIRP' },
> + 'tap', 'l2tpv3', 'socket', 'stream', 'dgram',
> + { 'name': 'vde', 'if': 'CONFIG_VDE' },
> + 'bridge', 'hubport',
> + { 'name': 'netmap', 'if': 'CONFIG_NETMAP' },
> + 'vhost-user', 'vhost-vdpa',
> { 'name': 'passt', 'if': 'CONFIG_PASST' },
> { 'name': 'af-xdp', 'if': 'CONFIG_AF_XDP' },
> { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
> @@ -949,16 +953,19 @@
> 'nic': 'NetLegacyNicOptions',
> 'passt': { 'type': 'NetdevPasstOptions',
> 'if': 'CONFIG_PASST' },
> - 'user': 'NetdevUserOptions',
> + 'user': { 'type': 'NetdevUserOptions',
> + 'if': 'CONFIG_SLIRP' },
> 'tap': 'NetdevTapOptions',
> 'l2tpv3': 'NetdevL2TPv3Options',
> 'socket': 'NetdevSocketOptions',
> 'stream': 'NetdevStreamOptions',
> 'dgram': 'NetdevDgramOptions',
> - 'vde': 'NetdevVdeOptions',
> + 'vde': { 'type': 'NetdevVdeOptions',
> + 'if': 'CONFIG_VDE' },
> 'bridge': 'NetdevBridgeOptions',
> 'hubport': 'NetdevHubPortOptions',
> - 'netmap': 'NetdevNetmapOptions',
> + 'netmap': { 'type': 'NetdevNetmapOptions',
> + 'if': 'CONFIG_NETMAP' },
> 'af-xdp': { 'type': 'NetdevAFXDPOptions',
> 'if': 'CONFIG_AF_XDP' },
> 'vhost-user': 'NetdevVhostUserOptions',
Any occurence of NET_CLIENT_DRIVER_USER, NET_CLIENT_DRIVER_VDE,
NET_CLIENT_DRIVER_NETMAP must now be properly guarded the same way.
The patch fixes up the ones in net/hub.c.
Checking the other ones:
* all three in net/net.c: already guarded by the same #ifdef
* _USER in net/slirp.c: net/meson.build compiles it only when: slirp
* _VDE in net/vde.c: net/meson.build compiles it only when: vde
* _NETMAP in net/netmap.c: net/meson.build compiles it only
if have_netmap
Good.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
prev parent reply other threads:[~2026-08-20 10:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 14:43 [PATCH] qapi/net: gate user/vde/netmap netdev backends behind their CONFIG symbols Rohitashv Kumar
2026-08-20 10:47 ` Markus Armbruster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mruh3w7v.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jasowangio@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rohit.kuma1313@gmail.com \
--cc=roohiit@amazon.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.