diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-24 14:33:00 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-24 14:33:00 -0500 |
commit | 89f204d2c60fbf3e0c5af1ff1681e57c9f057178 (patch) | |
tree | e459490511249032a62d792357bfe7c09c4eef02 /hw/usb/dev-storage.c | |
parent | 21ca4a5bb3cde109e68059ee357b3114afbc51e4 (diff) | |
parent | 93c8e4dc386a243d7d417567d81dc1f1698478a4 (diff) |
Merge remote-tracking branch 'kraxel/usb.84' into staging
# By Andreas Färber (3) and others
# Via Gerd Hoffmann
* kraxel/usb.84:
usb: fix serial number for hid devices
usb: add serial bus property
usb-host-libusb: set USB_DEV_FLAG_IS_HOST
usb/host-libusb: Fix building with libusb git master code
usb/hcd-ehci: Add Faraday FUSBH200 support
usb/hcd-ehci: Replace PORTSC macros with variables
usb/hcd-ehci: Add Tegra2 SysBus EHCI device
usb/hcd-ehci: Split off instance_init from realize
usb/hcd-ehci-sysbus: Convert to QOM realize
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r-- | hw/usb/dev-storage.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 1073901af1..fe914ab005 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -58,7 +58,6 @@ typedef struct { USBPacket *packet; /* usb-storage only */ BlockConf conf; - char *serial; uint32_t removable; } MSDState; @@ -602,7 +601,7 @@ static int usb_msd_initfn_storage(USBDevice *dev) return -1; } - blkconf_serial(&s->conf, &s->serial); + blkconf_serial(&s->conf, &dev->serial); /* * Hack alert: this pretends to be a block device, but it's really @@ -616,16 +615,11 @@ static int usb_msd_initfn_storage(USBDevice *dev) bdrv_detach_dev(bs, &s->dev.qdev); s->conf.bs = NULL; - if (s->serial) { - usb_desc_set_string(dev, STR_SERIALNUMBER, s->serial); - } else { - usb_desc_create_serial(dev); - } - + usb_desc_create_serial(dev); usb_desc_init(dev); scsi_bus_new(&s->bus, &s->dev.qdev, &usb_msd_scsi_info_storage, NULL); scsi_dev = scsi_bus_legacy_add_drive(&s->bus, bs, 0, !!s->removable, - s->conf.bootindex, s->serial); + s->conf.bootindex, dev->serial); if (!scsi_dev) { return -1; } @@ -734,7 +728,6 @@ static const VMStateDescription vmstate_usb_msd = { static Property msd_properties[] = { DEFINE_BLOCK_PROPERTIES(MSDState, conf), - DEFINE_PROP_STRING("serial", MSDState, serial), DEFINE_PROP_BIT("removable", MSDState, removable, 0, false), DEFINE_PROP_END_OF_LIST(), }; |