2012-12-16 23:27:22 +00:00
|
|
|
From 74544d87b480a3953b1f0b2b7cddd80d3b3c1bcb Mon Sep 17 00:00:00 2001
|
2012-09-07 15:20:05 +00:00
|
|
|
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
Date: Wed, 5 Sep 2012 15:56:57 +0200
|
2012-10-28 18:05:07 +00:00
|
|
|
Subject: [PATCH] usb-redir: Add chardev open / close debug logging
|
2012-09-07 15:20:05 +00:00
|
|
|
|
|
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
---
|
|
|
|
hw/usb/redirect.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
|
2012-10-28 18:05:07 +00:00
|
|
|
index b7387b6..57e6289 100644
|
2012-09-07 15:20:05 +00:00
|
|
|
--- a/hw/usb/redirect.c
|
|
|
|
+++ b/hw/usb/redirect.c
|
2012-10-28 18:05:07 +00:00
|
|
|
@@ -866,6 +866,7 @@ static void usbredir_chardev_close_bh(void *opaque)
|
2012-09-07 15:20:05 +00:00
|
|
|
usbredir_device_disconnect(dev);
|
|
|
|
|
|
|
|
if (dev->parser) {
|
|
|
|
+ DPRINTF("destroying usbredirparser\n");
|
|
|
|
usbredirparser_destroy(dev->parser);
|
|
|
|
dev->parser = NULL;
|
|
|
|
}
|
2012-10-28 18:05:07 +00:00
|
|
|
@@ -881,6 +882,8 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
|
2012-09-07 15:20:05 +00:00
|
|
|
usbredir_chardev_close_bh(dev);
|
|
|
|
qemu_bh_cancel(dev->chardev_close_bh);
|
|
|
|
|
|
|
|
+ DPRINTF("creating usbredirparser\n");
|
|
|
|
+
|
2012-10-28 18:05:07 +00:00
|
|
|
dev->parser = qemu_oom_check(usbredirparser_create());
|
|
|
|
dev->parser->priv = dev;
|
|
|
|
dev->parser->log_func = usbredir_log;
|
|
|
|
@@ -989,9 +992,11 @@ static void usbredir_chardev_event(void *opaque, int event)
|
2012-09-07 15:20:05 +00:00
|
|
|
|
|
|
|
switch (event) {
|
|
|
|
case CHR_EVENT_OPENED:
|
|
|
|
+ DPRINTF("chardev open\n");
|
|
|
|
usbredir_chardev_open(dev);
|
|
|
|
break;
|
|
|
|
case CHR_EVENT_CLOSED:
|
|
|
|
+ DPRINTF("chardev close\n");
|
|
|
|
qemu_bh_schedule(dev->chardev_close_bh);
|
|
|
|
break;
|
|
|
|
}
|
2012-10-28 18:05:07 +00:00
|
|
|
@@ -1250,6 +1255,7 @@ static void usbredir_device_disconnect(void *priv)
|
2012-09-07 15:20:05 +00:00
|
|
|
qemu_del_timer(dev->attach_timer);
|
|
|
|
|
|
|
|
if (dev->dev.attached) {
|
|
|
|
+ DPRINTF("detaching device\n");
|
|
|
|
usb_device_detach(&dev->dev);
|
|
|
|
/*
|
|
|
|
* Delay next usb device attach to give the guest a chance to see
|
|
|
|
--
|
2012-12-16 23:27:22 +00:00
|
|
|
1.8.0.2
|
2012-09-07 15:20:05 +00:00
|
|
|
|