qemu/0021-usb-redir-Fix-printing-of-device-version.patch
Cole Robinson 1ffd2723e8 Fix -vga vmware crashes (bz #836260)
Fix vhost crash (bz #918272)
Fix kvm module permissions after first install (bz #907215)
2013-04-02 12:35:23 -04:00

31 lines
1.3 KiB
Diff

From 0bfba65fd1a9495f159d0a1824517d7b05999ca8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 18 Feb 2012 09:12:14 +0100
Subject: [PATCH] usb-redir: Fix printing of device version
The device version is in bcd format, which requires some special handling to
print.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index b5f8081..d64182b 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1075,8 +1075,10 @@ static void usbredir_device_connect(void *priv,
usb_redir_cap_connect_device_version)) {
INFO("attaching %s device %04x:%04x version %d.%d class %02x\n",
speed, device_connect->vendor_id, device_connect->product_id,
- device_connect->device_version_bcd >> 8,
- device_connect->device_version_bcd & 0xff,
+ ((device_connect->device_version_bcd & 0xf000) >> 12) * 10 +
+ ((device_connect->device_version_bcd & 0x0f00) >> 8),
+ ((device_connect->device_version_bcd & 0x00f0) >> 4) * 10 +
+ ((device_connect->device_version_bcd & 0x000f) >> 0),
device_connect->device_class);
} else {
INFO("attaching %s device %04x:%04x class %02x\n", speed,