peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0629-usb-redir-Add-chardev-open-close-debug-logging.patch

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