From nobody Mon Feb 9 12:43:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495649250791152.29269087202488; Wed, 24 May 2017 11:07:30 -0700 (PDT) Received: from localhost ([::1]:56192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDagv-0004hJ-KL for importer@patchew.org; Wed, 24 May 2017 14:07:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDafP-0003oS-0K for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDafM-0001Jj-J2 for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34900) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dDafM-0001Jb-D9 for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51B6037F1F for ; Wed, 24 May 2017 18:05:47 +0000 (UTC) Received: from flash.redhat.com (ovpn-116-215.phx2.redhat.com [10.3.116.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0282377DD9; Wed, 24 May 2017 18:05:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 51B6037F1F Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vyasevic@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 51B6037F1F From: Vladislav Yasevich To: qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com Date: Wed, 24 May 2017 14:05:18 -0400 Message-Id: <1495649128-10529-3-git-send-email-vyasevic@redhat.com> In-Reply-To: <1495649128-10529-1-git-send-email-vyasevic@redhat.com> References: <1495649128-10529-1-git-send-email-vyasevic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 24 May 2017 18:05:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 02/12] migration: Introduce announcement timer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: germano@redhat.com, lvivier@redhat.com, mst@redhat.com, jasowang@redhat.com, Vladislav Yasevich , armbru@redhat.com, kashyap@redhat.com, jdenemar@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Introdec an annoucement timer structure and initialization to be used by for self-annoucement. Based on the work by Germano Veit Michel Signed-off-by: Vlad Yasevich --- include/migration/vmstate.h | 13 +++++++++++++ migration/savevm.c | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 8489659..a6bf84d 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1057,6 +1057,19 @@ void vmstate_register_ram(struct MemoryRegion *memor= y, DeviceState *dev); void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev); void vmstate_register_ram_global(struct MemoryRegion *memory); =20 +typedef struct AnnounceTimer { + QEMUTimer *tm; + AnnounceParameters params; + QEMUClockType type; + int round; +} AnnounceTimer; + +AnnounceTimer *qemu_announce_timer_new(AnnounceParameters *params, + QEMUClockType type); +AnnounceTimer *qemu_announce_timer_create(AnnounceParameters *params, + QEMUClockType type, + QEMUTimerCB *cb); + static inline int64_t self_announce_delay(int round) { diff --git a/migration/savevm.c b/migration/savevm.c index cee2837..607b090 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -230,6 +230,28 @@ static void qemu_announce_self_once(void *opaque) } } =20 +AnnounceTimer *qemu_announce_timer_new(AnnounceParameters *params, + QEMUClockType type) +{ + AnnounceTimer *timer =3D g_new(AnnounceTimer, 1); + + timer->params =3D *params; + timer->round =3D params->rounds; + timer->type =3D type; + + return timer; +} + +AnnounceTimer *qemu_announce_timer_create(AnnounceParameters *params, + QEMUClockType type, + QEMUTimerCB *cb) +{ + AnnounceTimer *timer =3D qemu_announce_timer_new(params, type); + + timer->tm =3D timer_new_ms(type, cb, timer); + return timer; +} + void qemu_announce_self(void) { static QEMUTimer *timer; --=20 2.7.4