diff options
author | Markus Armbruster <armbru@redhat.com> | 2009-12-09 17:07:52 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-12 07:59:38 -0600 |
commit | 063846984ce7eb1c1ddce6dda39b662c64a80dc0 (patch) | |
tree | 3af77f3d27bf7a7400ba8919a8a03af157ca25ff | |
parent | 0fe6d12e0bc752c29a93ac83a274e3650d457069 (diff) |
qdev: Separate USB product description from qdev name
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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/usb-bt.c | 1 | ||||
-rw-r--r-- | hw/usb-bus.c | 2 | ||||
-rw-r--r-- | hw/usb-hid.c | 3 | ||||
-rw-r--r-- | hw/usb-hub.c | 1 | ||||
-rw-r--r-- | hw/usb-msd.c | 1 | ||||
-rw-r--r-- | hw/usb-net.c | 1 | ||||
-rw-r--r-- | hw/usb-serial.c | 2 | ||||
-rw-r--r-- | hw/usb-wacom.c | 1 | ||||
-rw-r--r-- | hw/usb.h | 2 | ||||
-rw-r--r-- | usb-bsd.c | 1 | ||||
-rw-r--r-- | usb-linux.c | 1 |
11 files changed, 15 insertions, 1 deletions
diff --git a/hw/usb-bt.c b/hw/usb-bt.c index 18d7a98b43..07da1337ed 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 ba1b6e30e9..8bbc80d6b1 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 6621f7227e..33de302d66 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 e5a0938776..32f2ab8c73 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 bb39b625ad..b9f6588a7a 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 2556e05dd5..3dd05e370a 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 223d4c3859..14e410ed9c 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 ef61376372..b10864fe96 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", @@ -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, diff --git a/usb-linux.c b/usb-linux.c index 67735d338c..0004e969b6 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), |