From 405603258af5154387bea676be1f904b6713f6ae Mon Sep 17 00:00:00 2001
Message-Id: <405603258af5154387bea676be1f904b6713f6ae.1368111913.git.minovotn@redhat.com>
From: Amit Shah <amit.shah@redhat.com>
Date: Wed, 24 Apr 2013 08:17:35 +0200
Subject: [PATCH 01/65] Revert "usb-redir: Add flow control support"

RH-Author: Amit Shah <amit.shah@redhat.com>
Message-id: <dc5e54218b2b472a796a743342cd63fd1a36b6a3.1366724981.git.amit.shah@redhat.com>
Patchwork-id: 50778
O-Subject: [RHEL6.5 qemu-kvm PATCH 01/65] Revert "usb-redir: Add flow control support"
Bugzilla: 909059
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

This reverts commit 759dc4f5f8a37e22a2f6e6268b014893b41a237d.

Signed-off-by: Amit Shah <amit.shah@redhat.com>

Conflicts:
	usb-redir.c
---
 usb-redir.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 usb-redir.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/usb-redir.c b/usb-redir.c
index 72361ec..420d3a3 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -243,9 +243,8 @@ static int usbredir_read(void *priv, uint8_t *data, int count)
 static int usbredir_write(void *priv, uint8_t *data, int count)
 {
     USBRedirDevice *dev = priv;
-    int r;
 
-    if (!dev->cs->opened || dev->cs->write_blocked) {
+    if (!dev->cs->opened) {
         return 0;
     }
 
@@ -253,17 +252,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     if (!runstate_check(RUN_STATE_RUNNING)) {
         return 0;
     }
-
-    r = qemu_chr_write(dev->cs, data, count);
-
-    if (r < 0) {
-        if (dev->cs->write_blocked) {
-            return 0;
-        }
-        return -1;
-    }
-
-    return r;
+    return qemu_chr_write(dev->cs, data, count);
 }
 
 /*
@@ -1032,17 +1021,6 @@ static void usbredir_chardev_event(void *opaque, int event)
     }
 }
 
-static void usbredir_chardev_write_unblocked(void *opaque)
-{
-    USBRedirDevice *dev = opaque;
-
-    if (dev->parser == NULL) {
-        /* usbredir_open_close_bh hasn't handled the open event yet */
-        return;
-    }
-    usbredirparser_do_write(dev->parser);
-}
-
 /*
  * init + destroy
  */
@@ -1051,7 +1029,6 @@ static QemuChrHandlers usbredir_handlers = {
     .fd_can_read = usbredir_chardev_can_read,
     .fd_read = usbredir_chardev_read,
     .fd_event = usbredir_chardev_event,
-    .fd_write_unblocked = usbredir_chardev_write_unblocked,
 };
 
 static void usbredir_vm_state_change(void *priv, int running, RunState state)
-- 
1.7.11.7

