summaryrefslogtreecommitdiff
path: root/hw/usb/desc.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-04-20 12:33:30 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-04-26 12:21:17 +0200
commit9d55d1adc848a3dc1d2431c4ec4e7e4ea37fa0ee (patch)
tree4552a8c6548d345bfca57364072329f073af3fc4 /hw/usb/desc.h
parentb15cf49b78edb74dc783a7cacbc8391cbc728edc (diff)
downloadqemu-9d55d1adc848a3dc1d2431c4ec4e7e4ea37fa0ee.tar.gz
usb: add serial number generator
This patch adds a function which creates unique serial numbers for usb devices and puts it into use. Windows guests tend to become unhappy if they find two identical usb devices in the system. Effects range from non-functional devices (with yellow exclamation mark in device manager) to BSODs. Handing out unique serial numbers to devices fixes this. With this patch applied almost all emulated devices get a generated, unique serial number. There are two exceptions: * usb-storage devices will prefer a user-specified serial number and will only get a generated number in case the serial property is unset. * usb-hid devices keep the fixed serial number "42" as it is used to signal "remote wakeup actually works". See commit 7b074a22dab4bdda9864b933f1bc811a3db42845 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/desc.h')
-rw-r--r--hw/usb/desc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb/desc.h b/hw/usb/desc.h
index d164e8f891..7cf5442945 100644
--- a/hw/usb/desc.h
+++ b/hw/usb/desc.h
@@ -171,6 +171,7 @@ int usb_desc_other(const USBDescOther *desc, uint8_t *dest, size_t len);
void usb_desc_init(USBDevice *dev);
void usb_desc_attach(USBDevice *dev);
void usb_desc_set_string(USBDevice *dev, uint8_t index, const char *str);
+void usb_desc_create_serial(USBDevice *dev);
const char *usb_desc_get_string(USBDevice *dev, uint8_t index);
int usb_desc_string(USBDevice *dev, int index, uint8_t *dest, size_t len);
int usb_desc_get_descriptor(USBDevice *dev, int value, uint8_t *dest, size_t len);