|
|
5544c1 |
From 9ebfb490e04e1fe5466a4d31df17c5e6283236cb Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
ca70dc |
From: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
ca70dc |
Date: Thu, 27 Sep 2012 16:59:50 +0200
|
|
|
5544c1 |
Subject: [PATCH] usb-redir: Change usbredir_open_chardev into
|
|
Hans de Goede |
ca70dc |
usbredir_create_parser
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
As we need to create the parser at more places.
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Hans de Goede |
ca70dc |
---
|
|
Hans de Goede |
ca70dc |
hw/usb/redirect.c | 11 +++++------
|
|
Hans de Goede |
ca70dc |
1 file changed, 5 insertions(+), 6 deletions(-)
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
|
|
Hans de Goede |
ca70dc |
index 78e93a7..5d16aff 100644
|
|
Hans de Goede |
ca70dc |
--- a/hw/usb/redirect.c
|
|
Hans de Goede |
ca70dc |
+++ b/hw/usb/redirect.c
|
|
Hans de Goede |
ca70dc |
@@ -872,15 +872,11 @@ static void usbredir_chardev_close_bh(void *opaque)
|
|
Hans de Goede |
ca70dc |
}
|
|
Hans de Goede |
ca70dc |
}
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
-static void usbredir_chardev_open(USBRedirDevice *dev)
|
|
Hans de Goede |
ca70dc |
+static void usbredir_create_parser(USBRedirDevice *dev)
|
|
Hans de Goede |
ca70dc |
{
|
|
Hans de Goede |
ca70dc |
uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, };
|
|
Hans de Goede |
ca70dc |
int flags = 0;
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
- /* Make sure any pending closes are handled (no-op if none pending) */
|
|
Hans de Goede |
ca70dc |
- usbredir_chardev_close_bh(dev);
|
|
Hans de Goede |
ca70dc |
- qemu_bh_cancel(dev->chardev_close_bh);
|
|
Hans de Goede |
ca70dc |
-
|
|
Hans de Goede |
ca70dc |
DPRINTF("creating usbredirparser\n");
|
|
Hans de Goede |
ca70dc |
|
|
Hans de Goede |
ca70dc |
dev->parser = qemu_oom_check(usbredirparser_create());
|
|
Hans de Goede |
ca70dc |
@@ -992,7 +988,10 @@ static void usbredir_chardev_event(void *opaque, int event)
|
|
Hans de Goede |
ca70dc |
switch (event) {
|
|
Hans de Goede |
ca70dc |
case CHR_EVENT_OPENED:
|
|
Hans de Goede |
ca70dc |
DPRINTF("chardev open\n");
|
|
Hans de Goede |
ca70dc |
- usbredir_chardev_open(dev);
|
|
Hans de Goede |
ca70dc |
+ /* Make sure any pending closes are handled (no-op if none pending) */
|
|
Hans de Goede |
ca70dc |
+ usbredir_chardev_close_bh(dev);
|
|
Hans de Goede |
ca70dc |
+ qemu_bh_cancel(dev->chardev_close_bh);
|
|
Hans de Goede |
ca70dc |
+ usbredir_create_parser(dev);
|
|
Hans de Goede |
ca70dc |
break;
|
|
Hans de Goede |
ca70dc |
case CHR_EVENT_CLOSED:
|
|
Hans de Goede |
ca70dc |
DPRINTF("chardev close\n");
|
|
Hans de Goede |
ca70dc |
--
|
|
|
5544c1 |
1.7.12.1
|
|
Hans de Goede |
ca70dc |
|