scsi: Improve error reporting for invalid drive property
commit390e90a90736f98ca47f2e767d7f2a15d68d6bc4
authorMarkus Armbruster <armbru@redhat.com>
Mon, 9 Mar 2015 18:17:27 +0000 (9 19:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Mar 2015 10:18:23 +0000 (10 11:18 +0100)
treeb02c359cdfe5b304c8fe105864006661cadb3452
parent9b3d111ad90886546614b2579eedcb4675b35d14
scsi: Improve error reporting for invalid drive property

When setting "realized" fails, scsi_bus_legacy_add_drive() passes the
error to qerror_report_err(), then returns an unspecific "Setting
drive property failed" error, which is reported further up the call
chain.

Example:

    $ qemu-system-x86_64 -nodefaults -S -display none \
    > -drive if=scsi,id=foo,file=tmp.qcow2 -global isa-fdc.driveA=foo
    qemu-system-x86_64: -drive if=scsi,id=foo,file=tmp.qcow2: Property 'scsi-disk.drive' can't take value 'foo', it's in use
    qemu-system-x86_64: Setting drive property failed
    qemu-system-x86_64: Initialization of device lsi53c895a failed: Device initialization failed

Clean up the obvious way: simply return the original error to the
caller.  Gets rid of the second message in the above error cascade.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-Id: <1425925048-15482-4-git-send-email-armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-bus.c