Blame 0367-usb-redir-Revert-usb-redir-part-of-commit-93bfef4c.patch

93b7e3
From 786657ed32cb68ae5cd4d099e6ea3f36290bcbcb Mon Sep 17 00:00:00 2001
93b7e3
From: Hans de Goede <hdegoede@redhat.com>
93b7e3
Date: Mon, 10 Sep 2012 13:49:46 +0200
93b7e3
Subject: [PATCH 367/369] usb-redir: Revert usb-redir part of commit 93bfef4c
93b7e3
93b7e3
Commit 93bfef4c6e4b23caea9d51e1099d06433d8835a4 makes qemu-devices
93b7e3
which report the qemu version string to the guest in some way use a
93b7e3
qemu_get_version function which reports a machine-specific version string.
93b7e3
93b7e3
However usb-redir does not expose the qemu version to the guest, only to
93b7e3
the usbredir-host as part of the initial handshake. This can then be logged
93b7e3
on the usbredir-host side for debugging purposes and is otherwise completely
93b7e3
unused! For debugging purposes it is important to have the real qemu version
93b7e3
in there, rather then the machine-specific version.
93b7e3
93b7e3
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
93b7e3
---
93b7e3
 hw/usb/redirect.c | 8 +++-----
93b7e3
 1 file changed, 3 insertions(+), 5 deletions(-)
93b7e3
93b7e3
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
93b7e3
index 86c0398..78e93a7 100644
93b7e3
--- a/hw/usb/redirect.c
93b7e3
+++ b/hw/usb/redirect.c
93b7e3
@@ -142,6 +142,8 @@ static void usbredir_interrupt_packet(void *priv, uint64_t id,
93b7e3
 static int usbredir_handle_status(USBRedirDevice *dev,
93b7e3
                                        int status, int actual_len);
93b7e3
 
93b7e3
+#define VERSION "qemu usb-redir guest " QEMU_VERSION
93b7e3
+
93b7e3
 /*
93b7e3
  * Logging stuff
93b7e3
  */
93b7e3
@@ -873,7 +875,6 @@ static void usbredir_chardev_close_bh(void *opaque)
93b7e3
 static void usbredir_chardev_open(USBRedirDevice *dev)
93b7e3
 {
93b7e3
     uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, };
93b7e3
-    char version[32];
93b7e3
     int flags = 0;
93b7e3
 
93b7e3
     /* Make sure any pending closes are handled (no-op if none pending) */
93b7e3
@@ -882,9 +883,6 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
93b7e3
 
93b7e3
     DPRINTF("creating usbredirparser\n");
93b7e3
 
93b7e3
-    strcpy(version, "qemu usb-redir guest ");
93b7e3
-    pstrcat(version, sizeof(version), qemu_get_version());
93b7e3
-
93b7e3
     dev->parser = qemu_oom_check(usbredirparser_create());
93b7e3
     dev->parser->priv = dev;
93b7e3
     dev->parser->log_func = usbredir_log;
93b7e3
@@ -916,7 +914,7 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
93b7e3
     if (runstate_check(RUN_STATE_INMIGRATE)) {
93b7e3
         flags |= usbredirparser_fl_no_hello;
93b7e3
     }
93b7e3
-    usbredirparser_init(dev->parser, version, caps, USB_REDIR_CAPS_SIZE,
93b7e3
+    usbredirparser_init(dev->parser, VERSION, caps, USB_REDIR_CAPS_SIZE,
93b7e3
                         flags);
93b7e3
     usbredirparser_do_write(dev->parser);
93b7e3
 }
93b7e3
-- 
93b7e3
1.7.12
93b7e3