diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-11-19 10:22:45 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-11-28 16:20:51 -0600 |
commit | 65f9d98673cb04436257628958177516416456fa (patch) | |
tree | 2b1e41b6d1cc22fa9af3253f436d640bb937c03b | |
parent | f76e4c7f16c7ab966a792310b6630d3e240688b3 (diff) |
usb-redir: Call qemu_chr_fe_open/close
To let the chardev now we're ready start receiving data. This is necessary
with the spicevmc chardev to get it registered with the spice-server.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | usb-redir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usb-redir.c b/usb-redir.c index c74b1560bf..9e13410828 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -814,6 +814,8 @@ static int usbredir_initfn(USBDevice *udev) /* We'll do the attach once we receive the speed from the usb-host */ udev->auto_attach = 0; + /* Let the backend know we are ready */ + qemu_chr_fe_open(dev->cs); qemu_chr_add_handlers(dev->cs, usbredir_chardev_can_read, usbredir_chardev_read, usbredir_chardev_event, dev); @@ -837,6 +839,7 @@ static void usbredir_handle_destroy(USBDevice *udev) { USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev); + qemu_chr_fe_close(dev->cs); qemu_chr_delete(dev->cs); /* Note must be done after qemu_chr_close, as that causes a close event */ qemu_bh_delete(dev->open_close_bh); |