From: Li Guang <lig.fnst@cn.fujitsu.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
"Andreas Färber" <afaerber@suse.de>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Juan Quintela" <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v11 1/5] vmstate: add VMSTATE_PTIMER_ARRAY
Date: Fri, 13 Dec 2013 08:43:09 +0800 [thread overview]
Message-ID: <52AA581D.9010207@cn.fujitsu.com> (raw)
In-Reply-To: <CAFEAcA-1TREft9edoa8O-K0Hs3djfc2LNJaFROMxOtGs7__aQQ@mail.gmail.com>
Peter Maydell wrote:
> On 11 December 2013 08:08, liguang<lig.fnst@cn.fujitsu.com> wrote:
>
>> +static int get_ptimer(QEMUFile *f, void *pv, size_t size)
>> +{
>> + ptimer_state *v = pv;
>> + uint64_t count;
>> +
>> + count = qemu_get_be64(f);
>> + if (count != -1) {
>> + ptimer_set_count(v, count);
>> + } else {
>> + ptimer_stop(v);
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static void put_ptimer(QEMUFile *f, void *pv, size_t size)
>> +{
>> + ptimer_state *v = pv;
>> + uint64_t count;
>> +
>> + count = ptimer_get_count(v);
>> + qemu_put_be64(f, count);
>> +}
>> +
>> +const VMStateInfo vmstate_info_ptimer = {
>> + .name = "ptimer",
>> + .get = get_ptimer,
>> + .put = put_ptimer,
>> +};
>>
> Sorry, I led you a bit astray with my last review comment;
> this is definitely wrong because it isn't saving and
> restoring each ptimer_state according to the vmstate_ptimer
> definition, it's only saving a single 64 bit count.
> Doing this right isn't quite as obvious as I thought
> because we haven't needed to do "array of pointers to
> structures" yet, so there's a missing macro.
>
> I've written a patch which does this correctly -- I'll
> send it out shortly and you can add it to your patch
> series in place of this one.
>
>
Ok, thanks!
next prev parent reply other threads:[~2013-12-13 0:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 8:08 [Qemu-devel] [PATCH v11 0/5] add allwinner A10 SoC support liguang
2013-12-11 8:08 ` [Qemu-devel] [PATCH v11 1/5] vmstate: add VMSTATE_PTIMER_ARRAY liguang
2013-12-12 8:59 ` Li Guang
2013-12-12 19:57 ` Peter Maydell
2013-12-13 0:43 ` Li Guang [this message]
2013-12-11 8:08 ` [Qemu-devel] [PATCH v11 2/5] hw/timer: add allwinner a10 timer liguang
2013-12-11 8:08 ` [Qemu-devel] [PATCH v11 3/5] hw/intc: add allwinner A10 interrupt controller liguang
2013-12-11 8:27 ` Peter Crosthwaite
2013-12-12 19:09 ` Peter Maydell
2013-12-12 19:11 ` Peter Maydell
2013-12-13 0:43 ` Li Guang
2013-12-11 8:09 ` [Qemu-devel] [PATCH v11 4/5] hw/arm: add allwinner a10 SoC support liguang
2013-12-11 8:09 ` [Qemu-devel] [PATCH v11 5/5] hw/arm: add cubieboard support liguang
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=52AA581D.9010207@cn.fujitsu.com \
--to=lig.fnst@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
/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).