Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion hw/net/vhost_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ VHostNetState *get_vhost_net(NetClientState *nc)

switch (nc->info->type) {
case NET_CLIENT_DRIVER_TAP:
vhost_net = tap_get_vhost_net(nc);
if (!nc->vhost_net_disabled) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we had:

  1. vhost_net_start()/vhost_net_stop()
  2. A dedicated vhost_started variable in VirtIONet

Any reason for introducing another one at NetClientState structure?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My explanation is below.

vhost_net = tap_get_vhost_net(nc);
}
break;
#ifdef CONFIG_VHOST_NET_USER
case NET_CLIENT_DRIVER_VHOST_USER:
Expand Down
1 change: 1 addition & 0 deletions include/net/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct NetClientState {
int vring_enable;
int vnet_hdr_len;
bool is_netdev;
bool vhost_net_disabled;
QTAILQ_HEAD(, NetFilterState) filters;
};

Expand Down