From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsC0-0007xk-6b for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:59:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwsBy-0006AL-RX for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:59:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsBy-0006AH-Ja for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:59:42 -0400 From: Juan Quintela In-Reply-To: <501A44FF.9030904@redhat.com> (Paolo Bonzini's message of "Thu, 02 Aug 2012 11:14:39 +0200") References: <1343839312-24030-1-git-send-email-pbonzini@redhat.com> <1343839312-24030-6-git-send-email-pbonzini@redhat.com> <87d3393bka.fsf@elfo.mitica> <501A44FF.9030904@redhat.com> Date: Thu, 02 Aug 2012 11:58:49 +0200 Message-ID: <87zk6d1up2.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 05/10] RTC: Update the RTC clock only when reading it Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: yang.z.zhang@intel.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Paolo Bonzini 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.