diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 14:53:10 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | 62aed76583fe8bf8e6ba5955b2ecfa3619ea3540 (patch) | |
tree | a536e59eab00a94fccfbb8b3ad8b32e902e77ea2 /hw/usb-bt.c | |
parent | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (diff) |
usb: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-bt.c')
-rw-r--r-- | hw/usb-bt.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/hw/usb-bt.c b/hw/usb-bt.c index 0c1270be79..bf8c47076a 100644 --- a/hw/usb-bt.c +++ b/hw/usb-bt.c @@ -527,22 +527,29 @@ static const VMStateDescription vmstate_usb_bt = { .unmigratable = 1, }; -static struct USBDeviceInfo bt_info = { - .product_desc = "QEMU BT dongle", - .qdev.name = "usb-bt-dongle", - .qdev.size = sizeof(struct USBBtState), - .qdev.vmsd = &vmstate_usb_bt, - .usb_desc = &desc_bluetooth, - .init = usb_bt_initfn, - .handle_packet = usb_generic_handle_packet, - .handle_reset = usb_bt_handle_reset, - .handle_control = usb_bt_handle_control, - .handle_data = usb_bt_handle_data, - .handle_destroy = usb_bt_handle_destroy, +static void usb_bt_class_initfn(ObjectClass *klass, void *data) +{ + USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + + uc->init = usb_bt_initfn; + uc->product_desc = "QEMU BT dongle"; + uc->usb_desc = &desc_bluetooth; + uc->handle_packet = usb_generic_handle_packet; + uc->handle_reset = usb_bt_handle_reset; + uc->handle_control = usb_bt_handle_control; + uc->handle_data = usb_bt_handle_data; + uc->handle_destroy = usb_bt_handle_destroy; +} + +static struct DeviceInfo bt_info = { + .name = "usb-bt-dongle", + .size = sizeof(struct USBBtState), + .vmsd = &vmstate_usb_bt, + .class_init= usb_bt_class_initfn, }; static void usb_bt_register_devices(void) { - usb_qdev_register(&bt_info); + usb_qdev_register(&bt_info, NULL, NULL); } device_init(usb_bt_register_devices) |