[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/11] scsi: Improve error reporting for invalid driv
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/11] scsi: Improve error reporting for invalid drive property |
Date: |
Tue, 10 Mar 2015 11:37:58 +0100 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/scsi-bus.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 61c595f..bd2c0e4 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -7,7 +7,6 @@
#include "sysemu/blockdev.h"
#include "trace.h"
#include "sysemu/dma.h"
-#include "qapi/qmp/qerror.h"
static char *scsibus_get_dev_path(DeviceState *dev);
static char *scsibus_get_fw_dev_path(DeviceState *dev);
@@ -245,9 +244,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus,
BlockBackend *blk,
}
qdev_prop_set_drive(dev, "drive", blk, &err);
if (err) {
- qerror_report_err(err);
- error_free(err);
- error_setg(errp, "Setting drive property failed");
+ error_propagate(errp, err);
object_unparent(OBJECT(dev));
return NULL;
}
--
2.3.0
- [Qemu-devel] [PULL 00/11] scsi, RCU, KVM, x86 changes for 2015-03-10, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 01/11] iscsi: Fix check for username, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 03/11] kvm_stat: add kvm_stat.1 man page, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 04/11] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 05/11] rcu: handle forks safely, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 08/11] hw: Propagate errors through qdev_prop_set_drive(), Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 06/11] cpus: initialize cpu->memory_dispatch, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 02/11] kvm_stat: add column headers to text UI, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 09/11] scsi: Improve error reporting for invalid drive property,
Paolo Bonzini <=
- [Qemu-devel] [PULL 07/11] scsi: Clean up duplicated error in legacy if=scsi code, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 11/11] x86: fix SS selector in SYSRET, Paolo Bonzini, 2015/03/10
- [Qemu-devel] [PULL 10/11] scsi: Convert remaining PCI HBAs to realize(), Paolo Bonzini, 2015/03/10
- Re: [Qemu-devel] [PULL 00/11] scsi, RCU, KVM, x86 changes for 2015-03-10, Peter Maydell, 2015/03/10