Actually it's not always zero because - presave() calls e1000_mit_timer(), which sets mit_timer_on to 0 and calls set_interrupt_cause(ICR);
- if there are pending events, set_interrupt_cause(ICR) detects a raising edge, and doesn't filter out the interrupt since mit_timer_on == 0. Therefore, the timer is reloaded and mit_timer_on is set to 1. However, I've just realized that this is a mistake, since it would need the post_load() to call qemu_mod_timer() when mit_timer_on is migrated as "1", otherwise the interrupt delivery would deadlock on the migrated system. I think it's way better not to migrate mit_timer_on, so that the migrated system sees mit_timer_on==0 and doesn't need to call qemu_mod_timer() in post_load(). The first interrupt request (set_interrupt_cause()) will cause an immediate interrupt. Thanks, Vincenzo 2013/7/29 Stefan Hajnoczi <stefa...@redhat.com>: > On Fri, Jul 26, 2013 at 05:02:50PM +0200, Vincenzo Maffione wrote: >> +static const VMStateDescription vmstate_e1000_mit_state = { >> + .name = "e1000/mit_state", >> + .version_id = 1, >> + .minimum_version_id = 1, >> + .minimum_version_id_old = 1, >> + .fields = (VMStateField[]) { >> + VMSTATE_UINT32(mac_reg[RDTR], E1000State), >> + VMSTATE_UINT32(mac_reg[RADV], E1000State), >> + VMSTATE_UINT32(mac_reg[TADV], E1000State), >> + VMSTATE_UINT32(mac_reg[ITR], E1000State), >> + VMSTATE_BOOL(mit_timer_on, E1000State), > > Why is this migrated? I it is always 0 since pre_save calls > set_interrupt_cause(s, 0, s->mac_reg[ICR]). -- Vincenzo Maffione