[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/10] RTC: Update the RTC clock only when readi
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 05/10] RTC: Update the RTC clock only when reading it |
Date: |
Thu, 02 Aug 2012 11:58:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Paolo Bonzini <address@hidden> wrote:
> Il 02/08/2012 11:09, Juan Quintela ha scritto:
>> Why did you remove all the migration from previous versions?
>> You can't migrate now from version{1,2}, and we used to be able to do
>> it?
>>
>> Why did you remove it?
>
> Because it won't work; we removed three fields. You need to add
> rtc_load_old which is done later in the series. But I guess I can use
> VMSTATE_UNUSED instead.
Something like (completely untested):
static bool version_less_3(void *opaque, int version_id)
{
return version_id < 3;
}
static const VMStateDescription vmstate_rtc = {
.name = "mc146818rtc",
.version_id = 3,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.post_load = rtc_post_load,
.fields = (VMStateField []) {
VMSTATE_BUFFER(cmos_data, RTCState),
@@ -542,11 +595,12 @@ static const VMStateDescription vmstate_rtc = {
VMSTATE_INT32(current_tm.tm_year, RTCState),
VMSTATE_TIMER(periodic_timer, RTCState),
VMSTATE_INT64(next_periodic_time, RTCState),
VMSTATE_UNUSED_TEST(8*3, v_less_3); //* whatever space */
- VMSTATE_INT64(next_second_time, RTCState),
- VMSTATE_TIMER(second_timer, RTCState),
- VMSTATE_TIMER(second_timer2, RTCState),
VMSTATE_UINT32_V(irq_coalesced, RTCState, 2),
VMSTATE_UINT32_V(period, RTCState, 2),
+ VMSTATE_UINT64_V(base_rtc, RTCState, 3),
+ VMSTATE_UINT64_V(last_update, RTCState, 3),
+ VMSTATE_INT64_V(offset, RTCState, 3),
+ VMSTATE_TIMER_V(update_timer, RTCState, 3),
VMSTATE_END_OF_LIST()
}
};
This will make "migration protocol" work, I have zero clue if
"obviating" the value of next_second_time, and the two second_timers*
can work, that depends on how rtc works. Perhaps some extra magic on
post_load() is needed, though.
Could you tell me if you need anything else?
Later, Juan.
- [Qemu-devel] [PATCH 02/10] RTC: Rename rtc_timer_update, (continued)
- [Qemu-devel] [PATCH 02/10] RTC: Rename rtc_timer_update, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 03/10] RTC: Update interrupt state when interrupts are masked/unmasked, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 06/10] vmstate: add VMSTATE_TIMER_V, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 06/10] RTC: Add divider reset support, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 05/10] RTC: Update the RTC clock only when reading it, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 07/10] RTC: Do not fire timer periodically to catch next alarm, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 09/10] RTC: Remove the current_tm field, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 08/10] RTC: Get and set time without going through s->current_tm, Paolo Bonzini, 2012/08/01
- [Qemu-devel] [PATCH 10/10] RTC: Allow to migrate from old QEMU, Paolo Bonzini, 2012/08/01
- Re: [Qemu-devel] [PATCH 0/10] Remove periodic wakeup from RTC timer, Anthony Liguori, 2012/08/01
- Re: [Qemu-devel] [PATCH 0/10] Remove periodic wakeup from RTC timer, Zhang, Yang Z, 2012/08/01