Received: from eggs.gnu.org ([140.186.70.92]:48919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtSjb-0002Xc-Nq for qemu-devel@nongnu.org; Fri, 03 Feb 2012 18:40:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtSjY-0000zH-VH for qemu-devel@nongnu.org; Fri, 03 Feb 2012 18:40:03 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:45631 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtSjY-0000z9-Oc for qemu-devel@nongnu.org; Fri, 03 Feb 2012 18:40:00 -0500 From: Anthony Liguori Date: Fri, 3 Feb 2012 17:39:57 -0600 Message-Id: <1328312397-23633-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH] usb-redir: convert to QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Gerd Hoffman This was missed due to the fact that it's in the top level and it uses 'struct DeviceInfo' instead of 'DeviceInfo' for some strange reason. I'm not able to test this as I don't have libusbredir installed. Signed-off-by: Anthony Liguori --- usb-redir.c | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index 8f4a29a..303292a 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -1315,9 +1315,16 @@ static void usbredir_interrupt_packet(void *priv, uint32_t id, } } +static Property usbredir_properties[] = { + DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), + DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, 0), + DEFINE_PROP_END_OF_LIST(), +}; + static void usbredir_class_initfn(ObjectClass *klass, void *data) { USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); uc->init = usbredir_initfn; uc->product_desc = "USB Redirection Device"; @@ -1327,21 +1334,18 @@ static void usbredir_class_initfn(ObjectClass *klass, void *data) uc->handle_reset = usbredir_handle_reset; uc->handle_data = usbredir_handle_data; uc->handle_control = usbredir_handle_control; + dc->props = usbredir_properties; } -static struct DeviceInfo usbredir_dev_info = { - .name = "usb-redir", - .size = sizeof(USBRedirDevice), - .class_init= usbredir_class_initfn, - .props = (Property[]) { - DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), - DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, 0), - DEFINE_PROP_END_OF_LIST(), - }, +static TypeInfo usbredir_dev_info = { + .name = "usb-redir", + .parent = TYPE_USB_DEVICE, + .instance_size = sizeof(USBRedirDevice), + .class_init = usbredir_class_initfn, }; static void usbredir_register_devices(void) { - usb_qdev_register(&usbredir_dev_info, NULL, NULL); + type_register_static(&usbredir_dev_info); } device_init(usbredir_register_devices); -- 1.7.4.1