aboutsummaryrefslogtreecommitdiff
path: root/net/tap.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-07-27 01:15:12 +0400
committerMichael S. Tsirkin <mst@redhat.com>2016-07-29 00:33:48 +0300
commite6bcb1b61782cefacecc8b9ee7a5f782373dab2d (patch)
tree268e8208c3f706f806b10936ed3e90b6f548b309 /net/tap.c
parentc4843a45e3d4f3698b214275ab5e78cdb6a3d212 (diff)
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>
Diffstat (limited to 'net/tap.c')
-rw-r--r--net/tap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index 40a8c741fc..6abb962efd 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -312,6 +312,7 @@ static void tap_cleanup(NetClientState *nc)
if (s->vhost_net) {
vhost_net_cleanup(s->vhost_net);
+ g_free(s->vhost_net);
s->vhost_net = NULL;
}