[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v1 22/25] usb: bus: Update error API usages
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [RFC PATCH v1 22/25] usb: bus: Update error API usages |
Date: |
Thu, 10 Sep 2015 22:33:32 -0700 |
Use error_prefix() and error_report_err() as appropriate. Use the
prefix + propagate combo rather than manual prefix + freeing.
Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/usb/bus.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 5f39e1e..44264ee 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -329,9 +329,8 @@ static USBDevice *usb_try_create_simple(USBBus *bus, const
char *name,
}
object_property_set_bool(OBJECT(dev), true, "realized", &err);
if (err) {
- error_setg(errp, "Failed to initialize USB device '%s': %s",
- name, error_get_pretty(err));
- error_free(err);
+ error_prefix(err, "Failed to initialize USB device '%s': ", name);
+ error_propagate(errp, err);
object_unparent(OBJECT(dev));
return NULL;
}
@@ -722,9 +721,8 @@ USBDevice *usbdevice_create(const char *cmdline)
}
object_property_set_bool(OBJECT(dev), true, "realized", &err);
if (err) {
- error_report("Failed to initialize USB device '%s': %s",
- f->name, error_get_pretty(err));
- error_free(err);
+ error_prefix(err, "Failed to initialize USB device '%s': ", f->name);
+ error_report_err(err);
object_unparent(OBJECT(dev));
return NULL;
}
--
1.9.1
- [Qemu-devel] [RFC PATCH v1 11/25] arm: fsl-imx*: Update error API usages, (continued)
- [Qemu-devel] [RFC PATCH v1 11/25] arm: fsl-imx*: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 13/25] arm: allwinner: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 14/25] arm: digic: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 15/25] cpu: arm: Remove un-needed error checking, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 16/25] ppc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 17/25] i386: pc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 18/25] monitor: update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 19/25] qdev: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 20/25] block: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 21/25] tests: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 22/25] usb: bus: Update error API usages,
Peter Crosthwaite <=
- [Qemu-devel] [RFC PATCH v1 23/25] scsi: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 24/25] migration: savevm: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 25/25] core: Update error API usages, Peter Crosthwaite, 2015/09/11
- Re: [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing, Markus Armbruster, 2015/09/11
- Re: [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing, Eric Blake, 2015/09/11