Since we handle close async in a bh, do_write and thus write can get
called after receiving a close event. This patch adds a check to
the usb-redir write callback to not call qemu_chr_fe_write on a closed
backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
{
USBRedirDevice *dev = priv;
+ if (!dev->cs->opened) {
+ return 0;
+ }
+
return qemu_chr_fe_write(dev->cs, data, count);
}