qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: damien.hedde@greensocs.com, alex.bennee@linaro.org,
	luc@lmichel.fr, qemu-devel@nongnu.org
Subject: Re: [PATCH] clock-vmstate: Add missing END_OF_LIST
Date: Tue, 11 Jan 2022 14:01:09 +0000	[thread overview]
Message-ID: <Yd2NpdtUt2hRzYgu@work-vm> (raw)
In-Reply-To: <CAFEAcA-e61v6nTzH=Ep-KMVCJsVA=17O8CtDCLyk5DOtjVNgGw@mail.gmail.com>

* Peter Maydell (peter.maydell@linaro.org) wrote:
> On Tue, 11 Jan 2022 at 10:19, Dr. David Alan Gilbert (git)
> <dgilbert@redhat.com> wrote:
> >
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
> >
> > Fixes: 99abcbc7600 ("clock: Provide builtin multiplier/divider")
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> >  hw/core/clock-vmstate.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c
> > index 9d9174ffbd..7eccb6d4ea 100644
> > --- a/hw/core/clock-vmstate.c
> > +++ b/hw/core/clock-vmstate.c
> > @@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = {
> >      .fields = (VMStateField[]) {
> >          VMSTATE_UINT32(multiplier, Clock),
> >          VMSTATE_UINT32(divider, Clock),
> > +        VMSTATE_END_OF_LIST()
> >      },
> >  };
> 
> Oops :-(
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> We could maybe make this kind of bug more likely to be detected by
> instead of having the terminator be an "all zeros" VMStateField,
> having it check both for name == NULL and for a magic number in the
> VMStateFlags field. That way (assuming something in "make check"
> causes us to do a scan through every registered vmstate struct)
> forgetting the terminator will be likely to cause us to crash or hang
> rather than finding some 0 data and thinking that's the
> terminator.

Yeh, let me see what I can come up with for that.

Dave

> thanks
> -- PMM
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



  reply	other threads:[~2022-01-11 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 10:19 [PATCH] clock-vmstate: Add missing END_OF_LIST Dr. David Alan Gilbert (git)
2022-01-11 10:30 ` Peter Maydell
2022-01-11 14:01   ` Dr. David Alan Gilbert [this message]
2022-01-11 12:11 ` Peter Maydell
2022-01-11 13:01 ` Philippe Mathieu-Daudé
2022-01-11 13:40 ` Alex Bennée
2022-01-12  7:48 ` Luc Michel
2022-03-02 10:49 ` Dr. David Alan Gilbert

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=Yd2NpdtUt2hRzYgu@work-vm \
    --to=dgilbert@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=damien.hedde@greensocs.com \
    --cc=luc@lmichel.fr \
    --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).