qemu-patch-raspberry4/hw
Markus Armbruster fa61718183 scsi: Clean up duplicated error in legacy if=scsi code
Commit a818a4b changed scsi_bus_legacy_handle_cmdline() to report
errors from scsi_bus_legacy_add_drive() with error_report() in
addition to returning them.  That's inappropriate.

Two kinds of callers:

1. realize methods (devices "esp", "virtio-scsi-device" and
   "spapr-vscsi")

   The error object gets passed up the call chain until it gets
   reported again and freed.

   Example:

   $ qemu-system-arm -M virt -S -display none \
   > -drive if=scsi,id=foo,bus=1,file=tmp.qcow2 \
   > -device nec-usb-xhci -device usb-storage,drive=foo \
   > -device virtio-scsi-pci
   qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Property 'scsi-disk.drive' can't take value 'foo', it's in use
   qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Setting drive property failed
   qemu-system-arm: -device virtio-scsi-pci: Setting drive property failed
   qemu-system-arm: -device virtio-scsi-pci: Device initialization failed
   qemu-system-arm: -device virtio-scsi-pci: Device 'virtio-scsi-pci' could not be initialized

   The second message in this error cascade comes from
   scsi_bus_legacy_handle_cmdline().  The error object then gets
   passed up to the qdev_init() called from
   virtio_scsi_pci_init_pci(), which reports it again.

2. init methods (devices "am53c974", "dc390", "lsi53c895a",
   "lsi53c810", "megasas", "megasas-gen2")

   init methods need to report their errors with qerror_report().
   These don't.  The inappropriate error_report() papers over the bug.

   error_report() isn't the same as qerror_report() in QMP context,
   but this can't actually happen: QMP can still only hot-plug, and
   callers call scsi_bus_legacy_handle_cmdline() only on cold-plug.
   Except for sysbus_esp_realize(), but that can't be hot-plugged at
   all, as far as I can tell.

Fix the init methods and drop the inappropriate error_report() in
scsi_bus_legacy_handle_cmdline().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-Id: <1425925048-15482-2-git-send-email-armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-10 11:18:23 +01:00
..
9pfs virtio: feature bit manipulation helpers 2015-02-26 13:04:07 +01:00
acpi aml-build: fix build for glib < 2.22 2015-03-03 17:42:18 +01:00
alpha QOM infrastructure fixes and device conversions 2015-03-02 13:20:43 +00:00
arm error: Use error_report_err() where appropriate 2015-02-18 10:51:09 +01:00
audio pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
block virtio: add feature checking helpers 2015-02-26 13:04:07 +01:00
bt l2cap: fix access to freed memory 2014-08-15 19:12:48 +04:00
char spapr_vio: Convert to realize() 2015-03-09 15:00:07 +01:00
core pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
cpu icc_bus: fix typo ICC_BRIGDE -> ICC_BRIDGE 2014-11-03 19:51:56 +03:00
cris hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
display vga: Expose framebuffer byteorder as a QOM property 2015-03-09 15:00:02 +01:00
dma vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR* 2015-01-26 12:22:44 +01:00
gpio PPC: Add MPC8XXX gpio controller 2014-11-04 23:26:12 +01:00
i2c pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
i386 pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
ide pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
input adb.c: include ADBDevice parent state in KBDState and MouseState 2015-03-09 15:00:04 +01:00
intc openpic: convert to vmstate 2015-03-09 15:00:07 +01:00
ipack pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
isa acpi, ich9: Add unplug cb for ich9. 2015-02-26 12:42:18 +01:00
lm32 acpi-build: make ROMs RAM blocks resizeable 2015-01-08 13:17:55 +02:00
m68k hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
mem pc-dimm: add a function to calculate VM's current RAM size 2015-03-04 13:00:04 -05:00
microblaze hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
mips QOM infrastructure fixes and device conversions 2015-03-02 13:20:43 +00:00
misc cuda.c: include adb_poll_timer in VMStateDescription 2015-03-09 15:00:05 +01:00
moxie memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
net spapr_vio: Convert to realize() 2015-03-09 15:00:07 +01:00
nvram spapr_vio: Convert to realize() 2015-03-09 15:00:07 +01:00
openrisc hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
pci pci-hotplug-old: Has been dead for five major releases, bury 2015-03-01 12:37:54 +01:00
pci-bridge pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
pci-host pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
pcmcia hmp: Remove "info pcmcia" 2014-10-24 12:19:11 +01:00
ppc sPAPR: Implement sPAPRPHBClass EEH callbacks 2015-03-09 15:00:08 +01:00
s390x balloon: call qdev_alias_all_properties for proxy dev in balloon class init 2015-03-01 12:32:59 +01:00
scsi scsi: Clean up duplicated error in legacy if=scsi code 2015-03-10 11:18:23 +01:00
sd pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
sh4 r2d: Don't use legacy -usbdevice support for setting up board 2015-02-18 10:53:10 +01:00
sparc hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() 2015-02-18 11:58:50 +01:00
sparc64 QOM infrastructure fixes and device conversions 2015-03-02 13:20:43 +00:00
ssi ssi: xilinx_spi: Initialise CS GPIOs as NULL 2014-08-15 18:54:40 +04:00
timer Generalize QOM publishing of date and time from mc146818rtc.c 2015-03-09 14:59:55 +01:00
tpm tpm: Support for capability flags of TIS 1.3 2015-03-01 12:33:21 +01:00
tricore target-tricore: check return value before using it 2014-11-02 10:04:34 +03:00
unicore32 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
usb pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
vfio sPAPR: Implement sPAPRPHBClass EEH callbacks 2015-03-09 15:00:08 +01:00
virtio pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
watchdog pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
xen xen-pt: Fix PCI devices re-attach failed 2015-01-13 11:49:46 +00:00
xenpv hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
xtensa target-xtensa: xtfpga: fix ml605 flash size 2015-03-07 15:27:55 +03:00
Makefile.objs vfio: move hw/misc/vfio.c to hw/vfio/pci.c Move vfio.h into include/hw/vfio 2014-12-19 15:24:06 -07:00