All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: yang.z.zhang@intel.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
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	[thread overview]
Message-ID: <87zk6d1up2.fsf@elfo.mitica> (raw)
In-Reply-To: <501A44FF.9030904@redhat.com> (Paolo Bonzini's message of "Thu, 02 Aug 2012 11:14:39 +0200")

Paolo Bonzini <pbonzini@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.

  reply	other threads:[~2012-08-02  9:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 16:41 [Qemu-devel] [PATCH 0/10] Remove periodic wakeup from RTC timer Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 01/10] RTC: Remove the logic to update time format when DM bit changed Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 02/10] RTC: Rename rtc_timer_update Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 03/10] RTC: Update interrupt state when interrupts are masked/unmasked Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 06/10] vmstate: add VMSTATE_TIMER_V Paolo Bonzini
2012-08-02  8:56   ` Juan Quintela
2012-08-02  9:02     ` Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 05/10] RTC: Update the RTC clock only when reading it Paolo Bonzini
2012-08-01 19:48   ` Anthony Liguori
2012-08-02  9:09   ` Juan Quintela
2012-08-02  9:14     ` Paolo Bonzini
2012-08-02  9:58       ` Juan Quintela [this message]
2012-08-01 16:41 ` [Qemu-devel] [PATCH 06/10] RTC: Add divider reset support Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 07/10] RTC: Do not fire timer periodically to catch next alarm Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 08/10] RTC: Get and set time without going through s->current_tm Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 09/10] RTC: Remove the current_tm field Paolo Bonzini
2012-08-01 16:41 ` [Qemu-devel] [PATCH 10/10] RTC: Allow to migrate from old QEMU Paolo Bonzini
2012-08-01 19:51 ` [Qemu-devel] [PATCH 0/10] Remove periodic wakeup from RTC timer Anthony Liguori
2012-08-02  6:32   ` Paolo Bonzini
2012-08-02  0:44 ` Zhang, Yang Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zk6d1up2.fsf@elfo.mitica \
    --to=quintela@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.