mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
char: make chr_fe_deinit() optionaly delete backend
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 <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user