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
2015-03-10 10:49:25 +01:00
2015-03-04 13:00:36 -05:00
2015-02-06 16:11:38 +00:00
2015-03-09 15:00:08 +01:00
2015-03-09 09:14:28 +00:00
2015-02-19 09:33:03 +01:00
2015-02-19 09:33:03 +01:00
2015-03-10 10:49:25 +01:00
2015-03-09 09:14:28 +00:00
2015-02-13 11:44:50 +00:00
2015-02-12 21:21:38 -08:00
2015-03-09 09:14:28 +00:00
2015-03-10 10:49:25 +01:00
2015-02-23 10:56:09 -05:00
2015-03-08 06:43:32 +00:00
2015-02-16 17:30:19 +01:00
2015-01-07 16:16:26 +01:00
2015-03-10 10:49:25 +01:00
2015-03-04 14:47:52 +01:00
2015-02-06 14:35:52 +00:00
2015-03-10 10:49:25 +01:00
2015-02-05 17:16:14 +01:00
2015-03-02 12:13:45 +00:00
2015-02-16 14:36:03 +00:00
2015-03-02 12:13:45 +00:00
2015-01-22 17:41:59 +00:00
2015-02-16 15:07:19 +00:00
2015-01-14 10:38:57 +01:00
2015-02-12 21:21:38 -08:00
2014-12-09 21:48:34 +00:00
2015-03-09 09:14:28 +00:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%