Paolo Bonzini <pbonz...@redhat.com> wrote: > From: "Zhang, Yang Z" <yang.z.zh...@intel.com> > > The new logic is compatible with old, and it should not block migration > from old QEMU. However, the new version cannot migrate to the old one. > > Cc: Juan Quintela <quint...@redhat.com>
I guess that you removed the tm structs. This are the current fields. .fields = (VMStateField []) { VMSTATE_BUFFER(cmos_data, RTCState), VMSTATE_UINT8(cmos_index, RTCState), VMSTATE_INT32(current_tm.tm_sec, RTCState), VMSTATE_INT32(current_tm.tm_min, RTCState), VMSTATE_INT32(current_tm.tm_hour, RTCState), VMSTATE_INT32(current_tm.tm_wday, RTCState), VMSTATE_INT32(current_tm.tm_mday, RTCState), VMSTATE_INT32(current_tm.tm_mon, RTCState), VMSTATE_INT32(current_tm.tm_year, RTCState), you can change this to: VMSTATE_UNUSED(7*4); Some for the others. VMSTATE_TIMER(periodic_timer, RTCState), VMSTATE_INT64(next_periodic_time, RTCState), 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_END_OF_LIST() } > static const VMStateDescription vmstate_rtc = { > .name = "mc146818rtc", > - .version_id = 2, > - .minimum_version_id = 1, > + .version_id = 3, > + .minimum_version_id = 3, > .minimum_version_id_old = 1, > + .load_state_old = rtc_load_old, > .post_load = rtc_post_load, > .fields = (VMStateField []) { > VMSTATE_BUFFER(cmos_data, RTCState), > @@ -837,7 +873,7 @@ static int rtc_initfn(ISADevice *dev) no changes in the other part of vmstate? that is at least strange? I guess they are on the other patches on the series. Will take a look. > memory_region_init_io(&s->io, &cmos_ops, s, "rtc", 2); > isa_register_ioport(dev, &s->io, base); > > - qdev_set_legacy_instance_id(&dev->qdev, base, 2); > + qdev_set_legacy_instance_id(&dev->qdev, base, 3); > qemu_register_reset(rtc_reset, s); > > object_property_add(OBJECT(s), "date", "struct tm",