diff options
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/vhost_net.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 6db23ca..6b958d6 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -507,7 +507,12 @@ 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); + /* + * tap_get_vhost_net() can return NULL if a tap net-device backend is + * created with 'vhost=off' option, 'vhostforce=off' or no vhost or + * vhostforce or vhostfd options at all. Please see net_init_tap_one(). + * Hence, we omit the assertion here. + */ break; #ifdef CONFIG_VHOST_NET_USER case NET_CLIENT_DRIVER_VHOST_USER: |