Blame 0032-Revert-spice-vmc-split-vmc_write-to-max-sized-virtio.patch

Justin M. Forbes a81953
From f48f184b9d22bbd2e34fb4f3a7a760f0e98fae64 Mon Sep 17 00:00:00 2001
Justin M. Forbes a81953
From: Gerd Hoffmann <kraxel@redhat.com>
Justin M. Forbes a81953
Date: Wed, 8 Sep 2010 11:45:30 +0200
Justin M. Forbes a81953
Subject: [PATCH 32/39] Revert "spice-vmc: split vmc_write to max sized virtio_serial_write calls"
Justin M. Forbes a81953
Justin M. Forbes a81953
This reverts commit 380b75548db5116e538dc646e84bceb1c4b0e61b.
Justin M. Forbes a81953
---
Justin M. Forbes a81953
 hw/spice-vmc.c |   21 +++------------------
Justin M. Forbes a81953
 1 files changed, 3 insertions(+), 18 deletions(-)
Justin M. Forbes a81953
Justin M. Forbes a81953
diff --git a/hw/spice-vmc.c b/hw/spice-vmc.c
Justin M. Forbes a81953
index b9d64a2..041f243 100644
Justin M. Forbes a81953
--- a/hw/spice-vmc.c
Justin M. Forbes a81953
+++ b/hw/spice-vmc.c
Justin M. Forbes a81953
@@ -21,8 +21,6 @@
Justin M. Forbes a81953
 #define VMC_GUEST_DEVICE_NAME "com.redhat.spice.0"
Justin M. Forbes a81953
 #define VMC_DEVICE_NAME       "spicevmc"
Justin M. Forbes a81953
Justin M. Forbes a81953
-#define VMC_MAX_HOST_WRITE    2048
Justin M. Forbes a81953
-
Justin M. Forbes a81953
 #define dprintf(_svc, _level, _fmt, ...)                                \
Justin M. Forbes a81953
     do {                                                                \
Justin M. Forbes a81953
         static unsigned __dprintf_counter = 0;                          \
Justin M. Forbes a81953
@@ -45,23 +43,10 @@ typedef struct SpiceVirtualChannel {
Justin M. Forbes a81953
 static int vmc_write(SpiceVDIPortInstance *sin, const uint8_t *buf, int len)
Justin M. Forbes a81953
 {
Justin M. Forbes a81953
     SpiceVirtualChannel *svc = container_of(sin, SpiceVirtualChannel, sin);
Justin M. Forbes a81953
-    ssize_t out = 0;
Justin M. Forbes a81953
-    ssize_t last_out;
Justin M. Forbes a81953
-    uint8_t* p = (uint8_t*)buf;
Justin M. Forbes a81953
-
Justin M. Forbes a81953
-    while (len > 0) {
Justin M. Forbes a81953
-        last_out = virtio_serial_write(&svc->port, p,
Justin M. Forbes a81953
-                            MIN(len, VMC_MAX_HOST_WRITE));
Justin M. Forbes a81953
-        if (last_out > 0) {
Justin M. Forbes a81953
-            out += last_out;
Justin M. Forbes a81953
-            len -= last_out;
Justin M. Forbes a81953
-            p += last_out;
Justin M. Forbes a81953
-        } else {
Justin M. Forbes a81953
-            break;
Justin M. Forbes a81953
-        }
Justin M. Forbes a81953
-    }
Justin M. Forbes a81953
+    ssize_t out;
Justin M. Forbes a81953
Justin M. Forbes a81953
-    dprintf(svc, 3, "%s: %lu/%zd\n", __func__, out, len + out);
Justin M. Forbes a81953
+    out = virtio_serial_write(&svc->port, buf, len);
Justin M. Forbes a81953
+    dprintf(svc, 3, "%s: %lu/%d\n", __func__, out, len);
Justin M. Forbes a81953
     return out;
Justin M. Forbes a81953
 }
Justin M. Forbes a81953
Justin M. Forbes a81953
-- 
Justin M. Forbes a81953
1.7.2.3
Justin M. Forbes a81953