From patchwork Wed Dec 9 16:07:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 40732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 17DE7B6F2B for ; Thu, 10 Dec 2009 03:10:56 +1100 (EST) Received: from localhost ([127.0.0.1]:54565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIP7o-0004zk-P9 for incoming@patchwork.ozlabs.org; Wed, 09 Dec 2009 11:10:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIP5C-0003uD-LM for qemu-devel@nongnu.org; Wed, 09 Dec 2009 11:08:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIP57-0003rw-5a for qemu-devel@nongnu.org; Wed, 09 Dec 2009 11:08:05 -0500 Received: from [199.232.76.173] (port=45918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIP57-0003rt-0M for qemu-devel@nongnu.org; Wed, 09 Dec 2009 11:08:01 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:41581) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NIP56-0003O4-Fa for qemu-devel@nongnu.org; Wed, 09 Dec 2009 11:08:00 -0500 Received: from crossbow.pond.sub.org (pD9E38EAD.dip.t-dialin.net [217.227.142.173]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 336E5276D4F for ; Wed, 9 Dec 2009 17:07:59 +0100 (CET) Received: by crossbow.pond.sub.org (Postfix, from userid 500) id AD4D620BFA; Wed, 9 Dec 2009 17:07:53 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 9 Dec 2009 17:07:52 +0100 Message-Id: <1260374873-29783-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1260374873-29783-1-git-send-email-armbru@redhat.com> References: <1260374873-29783-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: kraxel@redhat.com Subject: [Qemu-devel] [FOR 0.12 PATCH v2 2/3] qdev: Separate USB product description from qdev name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Using the qdev name for the product description makes for inconvenient qdev names. Put the product description in new USBDeviceInfo member product_desc. Make usb_qdev_init() use it. No user or guest visible change, since the value is still the same. Signed-off-by: Markus Armbruster --- hw/usb-bt.c | 1 + hw/usb-bus.c | 2 +- hw/usb-hid.c | 3 +++ hw/usb-hub.c | 1 + hw/usb-msd.c | 1 + hw/usb-net.c | 1 + hw/usb-serial.c | 2 ++ hw/usb-wacom.c | 1 + hw/usb.h | 2 ++ usb-bsd.c | 1 + usb-linux.c | 1 + 11 files changed, 15 insertions(+), 1 deletions(-) diff --git a/hw/usb-bt.c b/hw/usb-bt.c index 18d7a98..07da133 100644 --- a/hw/usb-bt.c +++ b/hw/usb-bt.c @@ -645,6 +645,7 @@ USBDevice *usb_bt_init(HCIInfo *hci) } static struct USBDeviceInfo bt_info = { + .product_desc = "QEMU BT dongle", .qdev.name = "QEMU BT dongle", .qdev.size = sizeof(struct USBBtState), .init = usb_bt_initfn, diff --git a/hw/usb-bus.c b/hw/usb-bus.c index ba1b6e3..8bbc80d 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -43,7 +43,7 @@ static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base) USBDeviceInfo *info = DO_UPCAST(USBDeviceInfo, qdev, base); int rc; - pstrcpy(dev->product_desc, sizeof(dev->product_desc), qdev->info->name); + pstrcpy(dev->product_desc, sizeof(dev->product_desc), info->product_desc); dev->info = info; dev->auto_attach = 1; rc = dev->info->init(dev); diff --git a/hw/usb-hid.c b/hw/usb-hid.c index 6621f72..33de302 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -880,6 +880,7 @@ void usb_hid_datain_cb(USBDevice *dev, void *opaque, void (*datain)(void *)) static struct USBDeviceInfo hid_info[] = { { + .product_desc = "QEMU USB Tablet", .qdev.name = "QEMU USB Tablet", .qdev.alias = "usb-tablet", .usbdevice_name = "tablet", @@ -891,6 +892,7 @@ static struct USBDeviceInfo hid_info[] = { .handle_data = usb_hid_handle_data, .handle_destroy = usb_hid_handle_destroy, },{ + .product_desc = "QEMU USB Mouse", .qdev.name = "QEMU USB Mouse", .qdev.alias = "usb-mouse", .usbdevice_name = "mouse", @@ -902,6 +904,7 @@ static struct USBDeviceInfo hid_info[] = { .handle_data = usb_hid_handle_data, .handle_destroy = usb_hid_handle_destroy, },{ + .product_desc = "QEMU USB Keyboard", .qdev.name = "QEMU USB Keyboard", .qdev.alias = "usb-kbd", .usbdevice_name = "keyboard", diff --git a/hw/usb-hub.c b/hw/usb-hub.c index e5a0938..32f2ab8 100644 --- a/hw/usb-hub.c +++ b/hw/usb-hub.c @@ -544,6 +544,7 @@ static int usb_hub_initfn(USBDevice *dev) } static struct USBDeviceInfo hub_info = { + .product_desc = "QEMU USB Hub", .qdev.name = "QEMU USB Hub", .qdev.size = sizeof(USBHubState), .init = usb_hub_initfn, diff --git a/hw/usb-msd.c b/hw/usb-msd.c index bb39b62..b9f6588 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -600,6 +600,7 @@ static USBDevice *usb_msd_init(const char *filename) } static struct USBDeviceInfo msd_info = { + .product_desc = "QEMU USB MSD", .qdev.name = "QEMU USB MSD", .qdev.alias = "usb-storage", .qdev.size = sizeof(MSDState), diff --git a/hw/usb-net.c b/hw/usb-net.c index 2556e05..3dd05e3 100644 --- a/hw/usb-net.c +++ b/hw/usb-net.c @@ -1487,6 +1487,7 @@ USBDevice *usb_net_init(NICInfo *nd) } static struct USBDeviceInfo net_info = { + .product_desc = "QEMU USB Network Interface", .qdev.name = "QEMU USB Network Interface", .qdev.size = sizeof(USBNetState), .init = usb_net_initfn, diff --git a/hw/usb-serial.c b/hw/usb-serial.c index 223d4c3..14e410e 100644 --- a/hw/usb-serial.c +++ b/hw/usb-serial.c @@ -605,6 +605,7 @@ static USBDevice *usb_braille_init(const char *unused) } static struct USBDeviceInfo serial_info = { + .product_desc = "QEMU USB Serial", .qdev.name = "QEMU USB Serial", .qdev.alias = "usb-serial", .qdev.size = sizeof(USBSerialState), @@ -625,6 +626,7 @@ static struct USBDeviceInfo serial_info = { }; static struct USBDeviceInfo braille_info = { + .product_desc = "QEMU USB Braille", .qdev.name = "QEMU USB Braille", .qdev.alias = "usb-braille", .qdev.size = sizeof(USBSerialState), diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c index ef61376..b10864f 100644 --- a/hw/usb-wacom.c +++ b/hw/usb-wacom.c @@ -409,6 +409,7 @@ static int usb_wacom_initfn(USBDevice *dev) } static struct USBDeviceInfo wacom_info = { + .product_desc = "QEMU PenPartner Tablet", .qdev.name = "QEMU PenPartner Tablet", .qdev.alias = "wacom-tablet", .usbdevice_name = "wacom-tablet", diff --git a/hw/usb.h b/hw/usb.h index 39aba99..0684588 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -185,6 +185,8 @@ struct USBDeviceInfo { */ int (*handle_data)(USBDevice *dev, USBPacket *p); + const char *product_desc; + /* handle legacy -usbdevice command line options */ const char *usbdevice_name; USBDevice *(*usbdevice_init)(const char *params); diff --git a/usb-bsd.c b/usb-bsd.c index a9987d1..e72d123 100644 --- a/usb-bsd.c +++ b/usb-bsd.c @@ -393,6 +393,7 @@ fail: } static struct USBDeviceInfo usb_host_dev_info = { + .product_desc = "USB Host Device", .qdev.name = "USB Host Device", .qdev.size = sizeof(USBHostDevice), .init = usb_host_initfn, diff --git a/usb-linux.c b/usb-linux.c index 67735d3..0004e96 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -979,6 +979,7 @@ static int usb_host_initfn(USBDevice *dev) } static struct USBDeviceInfo usb_host_dev_info = { + .product_desc = "USB Host Device", .qdev.name = "USB Host Device", .qdev.alias = "usb-host", .qdev.size = sizeof(USBHostDevice),