qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] qom: Improve error message displayed with missing object pro


From: Li Qiang
Subject: Re: [PATCH] qom: Improve error message displayed with missing object properties
Date: Mon, 21 Sep 2020 00:08:51 +0800

Philippe Mathieu-Daudé <f4bug@amsat.org> 于2020年9月20日周日 下午11:54写道:
>
> Instead of only displaying the property missing, also display
> the object name. This help developer to quickly figure out the
> mistake without opening a debugger.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
>  qom/object.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index 387efb25ebe..257914b1fe3 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1259,7 +1259,8 @@ ObjectProperty *object_property_find(Object *obj, const 
> char *name,
>          return prop;
>      }
>
> -    error_setg(errp, "Property '.%s' not found", name);
> +    error_setg(errp, "Property '%s.%s' not found",
> +               object_get_typename(obj), name);
>      return NULL;
>  }
>
> --
> 2.26.2
>
>



reply via email to

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