qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Damien Hedde <damien.hedde@greensocs.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Luc Michel" <luc@lmichel.fr>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Tyrone Ting" <kfting@nuvoton.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Havard Skinnemoen" <hskinnemoen@google.com>
Subject: Re: [PATCH 3/3] hw/qdev-clock: Display error hint when clock is missing from device
Date: Mon, 28 Sep 2020 12:48:33 +0200	[thread overview]
Message-ID: <20200928104833.GE17122@toto> (raw)
In-Reply-To: <20f0ab00-8ca4-1a8f-43de-3b86dacc2124@greensocs.com>

On Mon, Sep 28, 2020 at 12:45:15PM +0200, Damien Hedde wrote:
> 
> 
> On 9/28/20 9:53 AM, Luc Michel wrote:
> > On 11:08 Sun 27 Sep     , Philippe Mathieu-Daudé wrote:
> >> Instead of directly aborting, display a hint to help the developer
> >> figure out the problem (likely trying to connect a clock to a device
> >> pre-dating the Clock API, thus not expecting clocks).
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > 
> > Reviewed-by: Luc Michel <luc@lmichel.fr>
> 
> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> 
> > 
> >> ---
> >>  hw/core/qdev-clock.c | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/hw/core/qdev-clock.c b/hw/core/qdev-clock.c
> >> index 47ecb5b4fae..33bd4a9d520 100644
> >> --- a/hw/core/qdev-clock.c
> >> +++ b/hw/core/qdev-clock.c
> >> @@ -12,6 +12,7 @@
> >>   */
> >>  
> >>  #include "qemu/osdep.h"
> >> +#include "qemu/error-report.h"
> >>  #include "hw/qdev-clock.h"
> >>  #include "hw/qdev-core.h"
> >>  #include "qapi/error.h"
> >> @@ -153,6 +154,11 @@ Clock *qdev_get_clock_in(DeviceState *dev, const char *name)
> >>      assert(name);
> >>  
> >>      ncl = qdev_get_clocklist(dev, name);
> >> +    if (!ncl) {
> >> +        error_report("can not find clock-in '%s' for device type '%s'",
> >> +                     name, object_get_typename(OBJECT(dev)));
> >> +        abort();
> >> +    }
> >>      assert(!ncl->output);
> >>  
> >>      return ncl->clock;
> >> @@ -165,6 +171,11 @@ Clock *qdev_get_clock_out(DeviceState *dev, const char *name)
> >>      assert(name);
> >>  
> >>      ncl = qdev_get_clocklist(dev, name);
> >> +    if (!ncl) {
> >> +        error_report("can not find clock-out '%s' for device type '%s'",
> >> +                     name, object_get_typename(OBJECT(dev)));
> >> +        abort();
> >> +    }
> >>      assert(ncl->output);
> >>  
> >>      return ncl->clock;
> >> -- 
> >> 2.26.2
> >>


      reply	other threads:[~2020-09-28 11:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27  9:08 [PATCH 0/3] qdev-clock: Minor improvements to the Clock API Philippe Mathieu-Daudé
2020-09-27  9:08 ` [PATCH 1/3] util/cutils: Introduce freq_to_str() to display Hertz units Philippe Mathieu-Daudé
2020-09-28  7:50   ` Luc Michel
2020-09-28 13:04     ` Philippe Mathieu-Daudé
2020-09-27  9:08 ` [PATCH 2/3] qdev-monitor: Display frequencies scaled to SI unit Philippe Mathieu-Daudé
2020-09-28  7:52   ` Luc Michel
2020-09-28  8:45     ` Damien Hedde
2020-09-27  9:08 ` [PATCH 3/3] hw/qdev-clock: Display error hint when clock is missing from device Philippe Mathieu-Daudé
2020-09-28  7:53   ` Luc Michel
2020-09-28 10:45     ` Damien Hedde
2020-09-28 10:48       ` Edgar E. Iglesias [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200928104833.GE17122@toto \
    --to=edgar.iglesias@xilinx.com \
    --cc=alistair.francis@wdc.com \
    --cc=berrange@redhat.com \
    --cc=damien.hedde@greensocs.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=hskinnemoen@google.com \
    --cc=kfting@nuvoton.com \
    --cc=luc@lmichel.fr \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).