Commit fecb48f7 authored by Pavel Butsykin's avatar Pavel Butsykin Committed by Michael S. Tsirkin
Browse files

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: default avatarPavel Butsykin <pbutsykin@virtuozzo.com>
Reviewed-by: default avatarRoman Kagan <rkagan@virtuozzo.com>
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 3d100d0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}