diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-09-27 17:25:44 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-10-11 09:32:10 +0200 |
commit | dbbf01958e777b6f03fc4ab425879f84800b9cda (patch) | |
tree | 8b0f5826a6454390961ca4866fc507f0c865309d /hw/usb/redirect.c | |
parent | b4ae3cfa57b8c1bdbbd7b7d420971e9171203ade (diff) | |
download | qemu-dbbf01958e777b6f03fc4ab425879f84800b9cda.zip qemu-dbbf01958e777b6f03fc4ab425879f84800b9cda.tar.gz qemu-dbbf01958e777b6f03fc4ab425879f84800b9cda.tar.bz2 |
usb-redir: Change usbredir_open_chardev into usbredir_create_parser
As we need to create the parser at more places.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/redirect.c')
-rw-r--r-- | hw/usb/redirect.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index b10241a..5e0f98d 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -862,15 +862,11 @@ static void usbredir_chardev_close_bh(void *opaque) } } -static void usbredir_chardev_open(USBRedirDevice *dev) +static void usbredir_create_parser(USBRedirDevice *dev) { uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, }; int flags = 0; - /* Make sure any pending closes are handled (no-op if none pending) */ - usbredir_chardev_close_bh(dev); - qemu_bh_cancel(dev->chardev_close_bh); - DPRINTF("creating usbredirparser\n"); dev->parser = qemu_oom_check(usbredirparser_create()); @@ -982,7 +978,10 @@ static void usbredir_chardev_event(void *opaque, int event) switch (event) { case CHR_EVENT_OPENED: DPRINTF("chardev open\n"); - usbredir_chardev_open(dev); + /* Make sure any pending closes are handled (no-op if none pending) */ + usbredir_chardev_close_bh(dev); + qemu_bh_cancel(dev->chardev_close_bh); + usbredir_create_parser(dev); break; case CHR_EVENT_CLOSED: DPRINTF("chardev close\n"); |