qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qdev: Don't abort() in case globals can't be se


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH] qdev: Don't abort() in case globals can't be set
Date: Mon, 9 Jun 2014 15:00:53 +0200

On Fri, 6 Jun 2014 22:26:15 -0300
Eduardo Habkost <address@hidden> wrote:

> It would be much better if we didn't terminate QEMU inside
> device_post_init(), but at least exiting cleanly is better than aborting
> and dumping core.
> 
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
>  hw/core/qdev.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index e65a5aa..74862c2 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -901,7 +901,13 @@ static void device_initfn(Object *obj)
>  
>  static void device_post_init(Object *obj)
>  {
> -    qdev_prop_set_globals(DEVICE(obj), &error_abort);
> +    Error *err = NULL;
> +    qdev_prop_set_globals(DEVICE(obj), &err);
> +    if (err) {
> +        qerror_report_err(err);
> +        error_free(err);
> +        exit(EXIT_FAILURE);
> +    }
>  }
>  
>  /* Unlink device from bus and free the structure.  */
> -- 
> 1.9.0
> 
> 
Reviewed-By: Igor Mammedov <address@hidden>

-- 
Regards,
  Igor



reply via email to

[Prev in Thread] Current Thread [Next in Thread]