summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorMarc-André Lureau2016-07-26 23:15:12 +0200
committerMichael S. Tsirkin2016-07-28 23:33:48 +0200
commite6bcb1b61782cefacecc8b9ee7a5f782373dab2d (patch)
tree268e8208c3f706f806b10936ed3e90b6f548b309 /hw
parentvhost-user: check vhost_user_{read,write}() return value (diff)
downloadqemu-e6bcb1b61782cefacecc8b9ee7a5f782373dab2d.tar.gz
qemu-e6bcb1b61782cefacecc8b9ee7a5f782373dab2d.tar.xz
qemu-e6bcb1b61782cefacecc8b9ee7a5f782373dab2d.zip
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 'hw')
-rw-r--r--hw/net/vhost_net.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index c11f69cdc2..7b76591409 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)