From 1ce2610c106d925387669b3133fc18ea986f0476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 27 Jan 2017 00:49:13 +0400 Subject: char: make chr_fe_deinit() optionaly delete backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This simplifies removing a backend for a frontend user (no need to retrieve the associated driver and separate delete call etc). NB: many frontends have questionable handling of ending a chardev. They should probably delete the backend to prevent broken reusage. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- net/vhost-user.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'net/vhost-user.c') diff --git a/net/vhost-user.c b/net/vhost-user.c index 526290d8c1..a042ec6a34 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -151,10 +151,7 @@ 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); - object_unparent(OBJECT(chr)); + qemu_chr_fe_deinit(&s->chr, true); } qemu_purge_queued_packets(nc); -- cgit v1.2.1