From e6bcb1b61782cefacecc8b9ee7a5f782373dab2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 27 Jul 2016 01:15:12 +0400 Subject: vhost-user: keep vhost_net after a disconnection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/vhost_net.c | 1 - 1 file changed, 1 deletion(-) (limited to 'hw/net') diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index c11f69c..7b76591 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -378,7 +378,6 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, void vhost_net_cleanup(struct vhost_net *net) { vhost_dev_cleanup(&net->dev); - g_free(net); } int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr) -- cgit v1.1