vhost-user: keep vhost_net after a disconnection
commite6bcb1b61782cefacecc8b9ee7a5f782373dab2d
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 26 Jul 2016 21:15:12 +0000 (27 01:15 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Jul 2016 21:33:48 +0000 (29 00:33 +0300)
tree268e8208c3f706f806b10936ed3e90b6f548b309
parentc4843a45e3d4f3698b214275ab5e78cdb6a3d212
vhost-user: keep vhost_net after a disconnection

Many code paths assume get_vhost_net() returns non-null.

Keep VhostUserState.vhost_net after a successful vhost_net_init(),
instead of freeing it in vhost_net_cleanup().

VhostUserState.vhost_net is thus freed before after being recreated or
on final vhost_user_cleanup() and there is no need to save the acked
features.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/vhost_net.c
net/tap.c
net/vhost-user.c