From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoRNA-0000cI-HJ for qemu-devel@nongnu.org; Fri, 08 Apr 2016 04:02:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoRN5-0005gd-U7 for qemu-devel@nongnu.org; Fri, 08 Apr 2016 04:02:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoRN5-0005gZ-PA for qemu-devel@nongnu.org; Fri, 08 Apr 2016 04:02:27 -0400 Date: Fri, 8 Apr 2016 11:02:24 +0300 From: "Michael S. Tsirkin" Message-ID: <1460102154-16096-7-git-send-email-mst@redhat.com> References: <1460102154-16096-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460102154-16096-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 06/15] virtio-balloon: reset the statistic timer to load device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Pavel Butsykin , Roman Kagan , "Denis V . Lunev" From: Pavel Butsykin 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 --- hw/virtio/virtio-balloon.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- MST