diff options
author | Markus Armbruster | 2014-09-12 21:24:34 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2014-09-22 09:55:55 +0200 |
commit | 31376776d045c7ee0a1570c139ef30b6cb8f5b01 (patch) | |
tree | a71068ddd503ff53f16ad1ff8b779d0d1b76d18a /hw/usb/hcd-ohci.c | |
parent | exec.c: fix setting 1-byte-long watchpoints (diff) | |
download | qemu-31376776d045c7ee0a1570c139ef30b6cb8f5b01.tar.gz qemu-31376776d045c7ee0a1570c139ef30b6cb8f5b01.tar.xz qemu-31376776d045c7ee0a1570c139ef30b6cb8f5b01.zip |
usb-storage: Fix how legacy init handles option ID clash
usb_msd_init() calls qemu_opts_create() with a made-up ID and false
fail_if_exists. If the ID already exists, it happily messes up those
options, then fails drive_new(), because the BlockDriverState with
that ID already exists, too.
Reproducer: -drive if=none,id=usb0,format=raw -usbdevice disk:tmp.qcow2
Pass true fail_if_exists to qemu_opts_create(), and if it fails, try
the next made-up ID.
The reproducer now succeeds, and creates an usb-storage device with ID
usb1.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ohci.c')
0 files changed, 0 insertions, 0 deletions