This USB patchset moves the VM state stuff from usb-hid.c to hid.c, so it can be reused by other devices.
There is one major drawback: i need to increase the vmstate version_id of the usb-hid device. I don't know if you agree with this change. Alternatively, we could add a load_old function which just skips old versions. Michael Walle (4): hid: register kbd hander in init() hid: introduce hid vmstate macros usb-hid: use hid vmstate macro milkymist-softusb: use hid code directly hw/hid.c | 63 ++++++++++++++++++++++++- hw/hw.h | 20 ++++++++ hw/milkymist-softusb.c | 122 +++++++++++++++--------------------------------- hw/usb-hid.c | 51 +++----------------- 4 files changed, 127 insertions(+), 129 deletions(-) -- 1.7.2.5