mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06: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:
parent
a9b1ca38c2
commit
1ce2610c10
16 changed files with 34 additions and 58 deletions
|
@ -1419,10 +1419,8 @@ static void usbredir_cleanup_device_queues(USBRedirDevice *dev)
|
|||
static void usbredir_unrealize(USBDevice *udev, Error **errp)
|
||||
{
|
||||
USBRedirDevice *dev = USB_REDIRECT(udev);
|
||||
Chardev *chr = qemu_chr_fe_get_driver(&dev->cs);
|
||||
|
||||
qemu_chr_fe_deinit(&dev->cs);
|
||||
object_unparent(OBJECT(chr));
|
||||
qemu_chr_fe_deinit(&dev->cs, true);
|
||||
|
||||
/* Note must be done after qemu_chr_close, as that causes a close event */
|
||||
qemu_bh_delete(dev->chardev_close_bh);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue