rtl8139: simplify timer logic
commit237c255c6cefefda9c5dd077860cfa20a77d9a6a
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 20 Jan 2015 14:44:59 +0000 (20 15:44 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 6 Feb 2015 14:04:36 +0000 (6 14:04 +0000)
tree9a71ee27822125ac9767dbb71658f4b8fda03b57
parent442469e61d276440d485b80514c0df89266fdc13
rtl8139: simplify timer logic

Pavel Dovgalyuk reports that TimerExpire and the timer are not restored
correctly on the receiving end of migration.

It is not clear to me whether this is really the case, but we can take
the occasion to get rid of the complicated code that computes PCSTimeout
on the fly upon changes to IntrStatus/IntrMask.  Just always keep a
timer running, it will fire every ~130 seconds at most if the interrupt
is masked with TimerInt != 0.

This makes rtl8139_set_next_tctr_time idempotent (when the virtual clock
is stopped between two calls, as is the case during migration).

Tested with Frediano's qtest.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1421765099-26190-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/rtl8139.c