From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKMdN-0006B1-NZ for qemu-devel@nongnu.org; Mon, 12 Jun 2017 06:31:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKMdJ-0004j7-N5 for qemu-devel@nongnu.org; Mon, 12 Jun 2017 06:31:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32958) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKMdJ-0004ij-Gr for qemu-devel@nongnu.org; Mon, 12 Jun 2017 06:31:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 460F480F63 for ; Mon, 12 Jun 2017 10:31:40 +0000 (UTC) References: <20170601212921.30241-1-quintela@redhat.com> <20170601212921.30241-3-quintela@redhat.com> From: Laurent Vivier Message-ID: <15fa6b0a-e0de-250b-1df2-e96c98c845f8@redhat.com> Date: Mon, 12 Jun 2017 12:31:36 +0200 MIME-Version: 1.0 In-Reply-To: <20170601212921.30241-3-quintela@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/11] migration: Move self_announce_delay() to misc.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: dgilbert@redhat.com, peterx@redhat.com On 01/06/2017 23:29, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > hw/net/virtio-net.c | 1 + > include/migration/misc.h | 10 ++++++++++ > include/migration/vmstate.h | 10 ---------- > migration/savevm.c | 1 + > 4 files changed, 12 insertions(+), 10 deletions(-) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 9a3d769..91eddaf 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -25,6 +25,7 @@ > #include "qapi/qmp/qjson.h" > #include "qapi-event.h" > #include "hw/virtio/virtio-access.h" > +#include "migration/misc.h" > > #define VIRTIO_NET_VM_VERSION 11 > > diff --git a/include/migration/misc.h b/include/migration/misc.h > index d7892b7..60486d4 100644 > --- a/include/migration/misc.h > +++ b/include/migration/misc.h > @@ -26,4 +26,14 @@ void blk_mig_init(void); > static inline void blk_mig_init(void) {} > #endif > > +#define SELF_ANNOUNCE_ROUNDS 5 > + > +static inline > +int64_t self_announce_delay(int round) > +{ > + assert(round < SELF_ANNOUNCE_ROUNDS && round > 0); > + /* delay 50ms, 150ms, 250ms, ... */ > + return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100; > +} > + It seems it is not used in a migration purpose by virtio-net, so it should be moved out of include/migration, perhaps in include/qemu/timer.h ? Thanks, Laurent