qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: vmstate: Useless post_save?


From: andrzej zaborowski
Subject: [Qemu-devel] Re: vmstate: Useless post_save?
Date: Tue, 11 May 2010 04:39:01 +0200

Hi,

On 8 May 2010 00:39, Jan Kiszka <address@hidden> wrote:
> I wondered why we have the post_save callback in vmstate. Conceptually,
> it made no sense to me. So I grep'ed for its users - and found exactly
> one: tmp105. As suspected, only "strange" code was found:
>
> static void tmp105_post_save(void *opaque)
> {
>    TMP105State *s = opaque;
>    s->faults = tmp105_faultq[(s->config >> 3) & 3];            /* F */
> }
>
> First, s->config cannot be changed by saving the state. And, second,
> s->faults is only written by this driver, never read.

I'm not sure why the post_save is there, it looks like it should be in
post_load rather.

The faults counter is an actual register somewhere in the hardware,
just not exposed through I2C bus.  However the counter is never
decremented because the temperature measurements are fake so there's
no measurement error and no point in delaying the interrupt until the
counter reaches zero.

Cheers



reply via email to

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