qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/4] i8254: Open-code timer restore


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 2/4] i8254: Open-code timer restore
Date: Sun, 05 Feb 2012 12:33:43 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-02-05 12:23, Paolo Bonzini wrote:
> On 02/05/2012 11:46 AM, Jan Kiszka wrote:
>> diff --git a/hw/i8254_common.c b/hw/i8254_common.c
>> index 0601d88..b60fbda 100644
>> --- a/hw/i8254_common.c
>> +++ b/hw/i8254_common.c
>> @@ -234,9 +234,8 @@ static int pit_load_old(QEMUFile *f, void *opaque,
>> int version_id)
>>           qemu_get_8s(f,&s->gate);
>>           s->count_load_time = qemu_get_be64(f);
>>           s->irq_disabled = 0;
>> -        if (s->irq_timer) {
>> +        if (i == 0) {
>>               s->next_transition_time = qemu_get_be64(f);
>> -            qemu_get_timer(f, s->irq_timer);
>>           }
>>       }
>>       return 0;
> 
> You need to invoke the post load callback manually in the load_old
> callback; see vmstate_load_state:
> 
>     if  (version_id < vmsd->minimum_version_id) {
>         return vmsd->load_state_old(f, opaque, version_id);
>     }
> 
> I noticed that in apic_common's apic_load_old you don't have the bug,
> but on the other hand you're unconditionally loading into s->timer, so
> "old" migration to a destination with in-kernel APIC doesn't work:
> 
>     if (version_id >= 2) {
>         qemu_get_timer(f, s->timer);
>     }
> 

Hmm, true. The whole load_old is broken, in both APIC and PIT. Need to
call the post_load callbacks from there as well. Will fix, thanks.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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