diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-08 14:56:53 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-03 10:41:03 -0600 |
commit | ba02430f1a681173cff5336c626d6edc5ea268db (patch) | |
tree | 74913357d1d97791c10e8f94d95ec36986a97168 /hw/usb-bus.c | |
parent | 7f595609b49615b07c50b7182c4ef125c39cb5da (diff) | |
download | qemu-ba02430f1a681173cff5336c626d6edc5ea268db.zip qemu-ba02430f1a681173cff5336c626d6edc5ea268db.tar.gz qemu-ba02430f1a681173cff5336c626d6edc5ea268db.tar.bz2 |
usb: separate out legacy usb registration from type registration
Type registeration is going to get turned into a QOM call so decouple the
legacy support.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-bus.c')
-rw-r--r-- | hw/usb-bus.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/hw/usb-bus.c b/hw/usb-bus.c index aeef908..6b0adfd 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -208,25 +208,27 @@ typedef struct LegacyUSBFactory static GSList *legacy_usb_factory; -void usb_qdev_register(DeviceInfo *info, - const char *usbdevice_name, - USBDevice *(*usbdevice_init)(const char *params)) +void usb_legacy_register(const char *typename, const char *usbdevice_name, + USBDevice *(*usbdevice_init)(const char *params)) { - info->bus_info = &usb_bus_info; - info->init = usb_qdev_init; - info->unplug = qdev_simple_unplug_cb; - info->exit = usb_qdev_exit; - qdev_register_subclass(info, TYPE_USB_DEVICE); - if (usbdevice_name) { LegacyUSBFactory *f = g_malloc0(sizeof(*f)); - f->name = info->name; + f->name = typename; f->usbdevice_name = usbdevice_name; f->usbdevice_init = usbdevice_init; legacy_usb_factory = g_slist_append(legacy_usb_factory, f); } } +void usb_qdev_register(DeviceInfo *info) +{ + info->bus_info = &usb_bus_info; + info->init = usb_qdev_init; + info->unplug = qdev_simple_unplug_cb; + info->exit = usb_qdev_exit; + qdev_register_subclass(info, TYPE_USB_DEVICE); +} + USBDevice *usb_create(USBBus *bus, const char *name) { DeviceState *dev; |