aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-12-10 14:20:46 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-01-24 17:21:34 +0100
commitc1ecb40a6124b80f1e346e38a1975e82da6507ca (patch)
tree78c5bab3c9793daaeb67809c976224b4485a2826 /hw/usb.h
parent9892088b52da05c3944e84982922fa984e048044 (diff)
downloadqemu-c1ecb40a6124b80f1e346e38a1975e82da6507ca.zip
qemu-c1ecb40a6124b80f1e346e38a1975e82da6507ca.tar.gz
qemu-c1ecb40a6124b80f1e346e38a1975e82da6507ca.tar.bz2
usb core: add migration support
Yes, seriously. There is no migration support at all for usb devices. They loose state, especially the device address, and stop responding because of that. Oops. Luckily there is so much broken usb hardware out there that the guest usually just kicks the device hard (via port reset and reinitialization), then continues without a hitch. So we got away with that in a surprising high number of cases. The arrival of remote wakeup (which enables autosuspend support) changes that picture though. The usb devices also forget that it they are supposed to wakeup, so they don't do that. The host also doesn't notice the device stopped working in case it suspended the device and thus expects it waking up instead of polling it. Result is that your mouse is dead. Lets start fixing that. Add a vmstate struct for USBDevice. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 5c1da3e..d3d755d 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -165,13 +165,13 @@ struct USBDevice {
int auto_attach;
int attached;
- int state;
+ int32_t state;
uint8_t setup_buf[8];
uint8_t data_buf[1024];
- int remote_wakeup;
- int setup_state;
- int setup_len;
- int setup_index;
+ int32_t remote_wakeup;
+ int32_t setup_state;
+ int32_t setup_len;
+ int32_t setup_index;
QLIST_HEAD(, USBDescString) strings;
const USBDescDevice *device;