@@ -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,
@@ -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);
@@ -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",
@@ -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,
@@ -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),
@@ -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,
@@ -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),
@@ -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",
@@ -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);
@@ -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,
@@ -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),
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 <armbru@redhat.com> --- 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(-)