dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

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

393f81
From 3efd9345ea643cf6f15776425213a92a442dd217 Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Wed, 5 Sep 2012 15:56:57 +0200
393f81
Subject: [PATCH 365/365] usb-redir: Add chardev open / close debug logging
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
---
c8dfc6
 hw/usb/redirect.c | 6 ++++++
c8dfc6
 1 file changed, 6 insertions(+)
c8dfc6
c8dfc6
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
393f81
index 812096e..b03c412 100644
c8dfc6
--- a/hw/usb/redirect.c
c8dfc6
+++ b/hw/usb/redirect.c
c8dfc6
@@ -864,6 +864,7 @@ static void usbredir_chardev_close_bh(void *opaque)
c8dfc6
     usbredir_device_disconnect(dev);
c8dfc6
 
c8dfc6
     if (dev->parser) {
c8dfc6
+        DPRINTF("destroying usbredirparser\n");
c8dfc6
         usbredirparser_destroy(dev->parser);
c8dfc6
         dev->parser = NULL;
c8dfc6
     }
c8dfc6
@@ -879,6 +880,8 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
c8dfc6
     usbredir_chardev_close_bh(dev);
c8dfc6
     qemu_bh_cancel(dev->chardev_close_bh);
c8dfc6
 
c8dfc6
+    DPRINTF("creating usbredirparser\n");
c8dfc6
+
c8dfc6
     strcpy(version, "qemu usb-redir guest ");
c8dfc6
     pstrcat(version, sizeof(version), qemu_get_version());
c8dfc6
 
c8dfc6
@@ -990,9 +993,11 @@ static void usbredir_chardev_event(void *opaque, int event)
c8dfc6
 
c8dfc6
     switch (event) {
c8dfc6
     case CHR_EVENT_OPENED:
c8dfc6
+        DPRINTF("chardev open\n");
c8dfc6
         usbredir_chardev_open(dev);
c8dfc6
         break;
c8dfc6
     case CHR_EVENT_CLOSED:
c8dfc6
+        DPRINTF("chardev close\n");
c8dfc6
         qemu_bh_schedule(dev->chardev_close_bh);
c8dfc6
         break;
c8dfc6
     }
c8dfc6
@@ -1255,6 +1260,7 @@ static void usbredir_device_disconnect(void *priv)
c8dfc6
     qemu_del_timer(dev->attach_timer);
c8dfc6
 
c8dfc6
     if (dev->dev.attached) {
c8dfc6
+        DPRINTF("detaching device\n");
c8dfc6
         usb_device_detach(&dev->dev);
c8dfc6
         /*
c8dfc6
          * Delay next usb device attach to give the guest a chance to see
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6