Skip to content
Snippets Groups Projects
Commit 0e994668 authored by Ani Sinha's avatar Ani Sinha Committed by Michael S. Tsirkin
Browse files

vhost_net: add an assertion for TAP client backends


An assertion was missing for tap vhost backends that enforces a non-null
reference from get_vhost_net(). Both vhost-net-user and vhost-net-vdpa
enforces this. Enforce the same for tap. Unit tests pass with this change.

Signed-off-by: default avatarAni Sinha <anisinha@redhat.com>
Message-Id: <20230619041501.111655-1-anisinha@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
parent ebe1504e
No related branches found
No related tags found
No related merge requests found
......@@ -507,6 +507,7 @@ VHostNetState *get_vhost_net(NetClientState *nc)
switch (nc->info->type) {
case NET_CLIENT_DRIVER_TAP:
vhost_net = tap_get_vhost_net(nc);
assert(vhost_net);
break;
#ifdef CONFIG_VHOST_NET_USER
case NET_CLIENT_DRIVER_VHOST_USER:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment