Patchwork qdev: Report errors collected during device realization

login
register
mail settings
Submitter Jan Kiszka
Date April 29, 2013, 12:35 p.m.
Message ID <517E68FC.6030400@siemens.com>
Download mbox | patch
Permalink /patch/240362/
State New
Headers show

Comments

Jan Kiszka - April 29, 2013, 12:35 p.m.
Better than just releasing the error object silently.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/core/qdev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Andreas Färber - April 29, 2013, 2:31 p.m.
Am 29.04.2013 14:35, schrieb Jan Kiszka:
> Better than just releasing the error object silently.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reviewed-by: Andreas Färber <afaerber@suse.de>

but CC'ing monitor guys to verify this is the right print function.

Andreas

> ---
>  hw/core/qdev.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 4eb0134..ab1d8f5 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -162,6 +162,7 @@ int qdev_init(DeviceState *dev)
>  
>      object_property_set_bool(OBJECT(dev), true, "realized", &local_err);
>      if (local_err != NULL) {
> +        qerror_report_err(local_err);
>          error_free(local_err);
>          qdev_free(dev);
>          return -1;
>
Anthony Liguori - April 30, 2013, 6:58 p.m.
Applied.  Thanks.

Regards,

Anthony Liguori

Patch

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 4eb0134..ab1d8f5 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -162,6 +162,7 @@  int qdev_init(DeviceState *dev)
 
     object_property_set_bool(OBJECT(dev), true, "realized", &local_err);
     if (local_err != NULL) {
+        qerror_report_err(local_err);
         error_free(local_err);
         qdev_free(dev);
         return -1;