All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qom: Improve error message displayed with missing object properties
@ 2020-09-20 15:53 Philippe Mathieu-Daudé
  2020-09-20 16:08 ` Li Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-20 15:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Daniel P. Berrangé,
	Eduardo Habkost, Philippe Mathieu-Daudé

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>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] qom: Improve error message displayed with missing object properties
  2020-09-20 15:53 [PATCH] qom: Improve error message displayed with missing object properties Philippe Mathieu-Daudé
@ 2020-09-20 16:08 ` Li Qiang
  2020-10-05  7:42 ` Philippe Mathieu-Daudé
  2020-10-05  8:46 ` Paolo Bonzini
  2 siblings, 0 replies; 6+ messages in thread
From: Li Qiang @ 2020-09-20 16:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-trivial, Paolo Bonzini, Daniel P. Berrangé,
	Qemu Developers, Eduardo Habkost

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
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qom: Improve error message displayed with missing object properties
  2020-09-20 15:53 [PATCH] qom: Improve error message displayed with missing object properties Philippe Mathieu-Daudé
  2020-09-20 16:08 ` Li Qiang
@ 2020-10-05  7:42 ` Philippe Mathieu-Daudé
  2020-10-05  8:46 ` Paolo Bonzini
  2 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-05  7:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

Eduardo, can you take this patch, or can it goes via qemu-trivial?

On 9/20/20 5:53 PM, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>  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;
>  }
>  
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qom: Improve error message displayed with missing object properties
  2020-09-20 15:53 [PATCH] qom: Improve error message displayed with missing object properties Philippe Mathieu-Daudé
  2020-09-20 16:08 ` Li Qiang
  2020-10-05  7:42 ` Philippe Mathieu-Daudé
@ 2020-10-05  8:46 ` Paolo Bonzini
  2020-10-05 16:42   ` Eduardo Habkost
  2 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2020-10-05  8:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-trivial, Daniel P. Berrangé, Eduardo Habkost

On 20/09/20 17:53, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>  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;
>  }
>  
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

I think it's okay for qemu-trivial.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qom: Improve error message displayed with missing object properties
  2020-10-05  8:46 ` Paolo Bonzini
@ 2020-10-05 16:42   ` Eduardo Habkost
  2020-10-05 17:20     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Habkost @ 2020-10-05 16:42 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-trivial, Daniel P. Berrangé,
	Philippe Mathieu-Daudé,
	qemu-devel

On Mon, Oct 05, 2020 at 10:46:38AM +0200, Paolo Bonzini wrote:
> On 20/09/20 17:53, Philippe Mathieu-Daudé wrote:
> > 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>
> > ---
> >  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;
> >  }
> >  
> > 
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> I think it's okay for qemu-trivial.

It would be okay, but it doesn't apply on master anymore due to
the object_propert_find_err() refactor.  I've fixed the conflicts
and queued it on machine-next.

-- 
Eduardo



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qom: Improve error message displayed with missing object properties
  2020-10-05 16:42   ` Eduardo Habkost
@ 2020-10-05 17:20     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-05 17:20 UTC (permalink / raw)
  To: Eduardo Habkost, Paolo Bonzini
  Cc: qemu-trivial, Daniel P. Berrangé, qemu-devel

On 10/5/20 6:42 PM, Eduardo Habkost wrote:
> On Mon, Oct 05, 2020 at 10:46:38AM +0200, Paolo Bonzini wrote:
>> On 20/09/20 17:53, Philippe Mathieu-Daudé wrote:
>>> 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>
>>> ---
>>>  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;
>>>  }
>>>  
>>>
>>
>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>>
>> I think it's okay for qemu-trivial.
> 
> It would be okay, but it doesn't apply on master anymore due to
> the object_propert_find_err() refactor.  I've fixed the conflicts
> and queued it on machine-next.

Oh sorry I didn't noticed, thanks for fixing/queuing!

Phil.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-05 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-20 15:53 [PATCH] qom: Improve error message displayed with missing object properties Philippe Mathieu-Daudé
2020-09-20 16:08 ` Li Qiang
2020-10-05  7:42 ` Philippe Mathieu-Daudé
2020-10-05  8:46 ` Paolo Bonzini
2020-10-05 16:42   ` Eduardo Habkost
2020-10-05 17:20     ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.