From patchwork Fri Feb 1 12:32:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 217459 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A121F2C0292 for ; Sat, 2 Feb 2013 00:35:20 +1100 (EST) Received: from localhost ([::1]:53097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Fnu-0005Ub-To for incoming@patchwork.ozlabs.org; Fri, 01 Feb 2013 07:33:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Fnj-0005UR-Jh for qemu-devel@nongnu.org; Fri, 01 Feb 2013 07:33:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1Fni-0000Nf-L5 for qemu-devel@nongnu.org; Fri, 01 Feb 2013 07:33:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Fni-0000NT-Dk for qemu-devel@nongnu.org; Fri, 01 Feb 2013 07:33:02 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r11CX1xa023632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Feb 2013 07:33:01 -0500 Received: from trasno.mitica (ovpn-113-123.phx2.redhat.com [10.3.113.123]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r11CWvKO020403; Fri, 1 Feb 2013 07:33:00 -0500 From: Juan Quintela To: Qemu Devel , Anthony Liguori Date: Fri, 1 Feb 2013 13:32:54 +0100 Message-Id: <1359721976-19238-3-git-send-email-quintela@redhat.com> In-Reply-To: <1359721976-19238-1-git-send-email-quintela@redhat.com> References: <1359721976-19238-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] migration: calculate end time after we have sent the data X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela Reviewed-by: Orit Wasserman --- migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration.c b/migration.c index d86946e..67abd12 100644 --- a/migration.c +++ b/migration.c @@ -681,7 +681,7 @@ static void *buffered_file_thread(void *opaque) qemu_mutex_unlock_iothread(); while (true) { - int64_t current_time = qemu_get_clock_ms(rt_clock); + int64_t current_time; uint64_t pending_size; qemu_mutex_lock_iothread(); @@ -735,6 +735,7 @@ static void *buffered_file_thread(void *opaque) } } qemu_mutex_unlock_iothread(); + current_time = qemu_get_clock_ms(rt_clock); if (current_time >= initial_time + BUFFER_DELAY) { uint64_t transferred_bytes = s->bytes_xfer; uint64_t time_spent = current_time - initial_time;