Paolo Bonzini <pbonz...@redhat.com> 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.