From e0b283e7c5b020c3e54629d8b82117db0af21cca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 24 Jan 2017 23:02:58 +0400 Subject: [PATCH] vhost-user: delete chardev on cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove the chardev implicitly when cleaning up the netdev. This prevents from reusing the chardev since it would be in an incorrect state with the slave. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1256618 Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Eric Blake --- net/vhost-user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/vhost-user.c b/net/vhost-user.c index b0f0ab6cc8..77b8110f8c 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -151,7 +151,10 @@ static void vhost_user_cleanup(NetClientState *nc) s->vhost_net = NULL; } if (nc->queue_index == 0) { + Chardev *chr = qemu_chr_fe_get_driver(&s->chr); + qemu_chr_fe_deinit(&s->chr); + qemu_chr_delete(chr); } qemu_purge_queued_packets(nc); -- 2.39.5