summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPavel Butsykin <pbutsykin@virtuozzo.com>2016-03-29 17:00:49 +0300
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 20:01:35 -0600
commit6736cc67171827806bcc4cce103a651afe090a75 (patch)
treee6d5b5db809f23c696e37bbd038137a550c05e0f /hw
parent1057097e66d16b4020783f26cf1b5508cdf65160 (diff)
downloadhqemu-6736cc67171827806bcc4cce103a651afe090a75.zip
hqemu-6736cc67171827806bcc4cce103a651afe090a75.tar.gz
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 <pbutsykin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/virtio-balloon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 22ad25c..c74101e 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;
}
OpenPOWER on IntegriCloud