From patchwork Tue Mar 12 15:49:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 227059 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 D9CB32C0299 for ; Wed, 13 Mar 2013 02:50:20 +1100 (EST) Received: from localhost ([::1]:51143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRT1-0007zc-43 for incoming@patchwork.ozlabs.org; Tue, 12 Mar 2013 11:50:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRSe-0007Xb-SD for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:50:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFRSW-00024O-85 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:49:56 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:46008 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRSW-00022H-2k for qemu-devel@nongnu.org; Tue, 12 Mar 2013 11:49:48 -0400 Received: from localhost (localhost [127.0.0.1]) by ssl.dlh.net (Postfix) with ESMTP id 460A514540E; Tue, 12 Mar 2013 16:49:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ssl.dlh.net Received: from ssl.dlh.net ([127.0.0.1]) by localhost (ssl.dlh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sdX366eAmvvm; Tue, 12 Mar 2013 16:49:44 +0100 (CET) Received: from [172.21.12.60] (unknown [82.141.1.226]) by ssl.dlh.net (Postfix) with ESMTPSA id E5A9413F711; Tue, 12 Mar 2013 16:49:44 +0100 (CET) Message-ID: <513F4E9B.60504@dlhnet.de> Date: Tue, 12 Mar 2013 16:49:47 +0100 From: Peter Lieven User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: "qemu-devel@nongnu.org" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 91.198.192.8 Cc: Kevin Wolf , Paolo Bonzini , Orit Wasserman , Stefan Hajnoczi Subject: [Qemu-devel] [RFC][PATCH 3/9] migration: add an indicator for bulk state of ram migration 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: Peter Lieven --- arch_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch_init.c b/arch_init.c index 1b71912..d48b914 100644 --- a/arch_init.c +++ b/arch_init.c @@ -326,6 +326,7 @@ static ram_addr_t last_offset; static unsigned long *migration_bitmap; static uint64_t migration_dirty_pages; static uint32_t last_version; +static bool ram_bulk_stage; static inline ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr, @@ -433,6 +434,7 @@ static int ram_save_block(QEMUFile *f, bool last_stage) if (!block) { block = QTAILQ_FIRST(&ram_list.blocks); complete_round = true; + ram_bulk_stage = false; } } else { uint8_t *p; @@ -536,6 +538,7 @@ static void reset_ram_globals(void) last_sent_block = NULL; last_offset = 0; last_version = ram_list.version; + ram_bulk_stage = true; } #define MAX_WAIT 50 /* ms, half buffered_file limit */