From: Pavel Butsykin Date: Tue, 29 Mar 2016 14:00:49 +0000 (+0300) Subject: virtio-balloon: reset the statistic timer to load device X-Git-Tag: v2.6.0-rc2~11^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fecb48f7444edd29d2d6f048ce6460e1a23d0204;p=thirdparty%2Fqemu.git virtio-balloon: reset the statistic timer to load device If before loading snapshot we had set the timer of statistics, then after applying snapshot the expiry time would be irrelevant for the restored state of the virtual clocks. A simple fix is just to restart the timer after loading snapshot. For the user it may look like a long delay of statistics update after switch to the snapshot. Signed-off-by: Pavel Butsykin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 22ad25cc97f..c74101e4792 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -426,6 +426,10 @@ static int virtio_balloon_load_device(VirtIODevice *vdev, QEMUFile *f, s->num_pages = qemu_get_be32(f); s->actual = qemu_get_be32(f); + + if (balloon_stats_enabled(s)) { + balloon_stats_change_timer(s, s->stats_poll_interval); + } return 0; }