From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGQeY-0002PF-PB for qemu-devel@nongnu.org; Tue, 25 Sep 2012 04:38:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGQeS-0005ir-Vd for qemu-devel@nongnu.org; Tue, 25 Sep 2012 04:38:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGQeS-0005il-NT for qemu-devel@nongnu.org; Tue, 25 Sep 2012 04:37:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8P8bt2a015904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 Sep 2012 04:37:55 -0400 Message-ID: <50616D66.1000806@redhat.com> Date: Tue, 25 Sep 2012 10:37:58 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1348217255-22441-1-git-send-email-quintela@redhat.com> <1348217255-22441-9-git-send-email-quintela@redhat.com> In-Reply-To: <1348217255-22441-9-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/41] savevm: Factorize ram globals reset in its own function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 09/21/2012 11:47 AM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > arch_init.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 52ccc7b..57f7f1a 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -482,6 +482,14 @@ static void ram_migration_cancel(void *opaque) > migration_end(); > } > > + > +static void reset_ram_globals(void) > +{ > + last_block = NULL; > + last_offset = 0; > + sort_ram_list(); > +} > + > #define MAX_WAIT 50 /* ms, half buffered_file limit */ > > static int ram_save_setup(QEMUFile *f, void *opaque) > @@ -491,9 +499,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) > > memory_global_sync_dirty_bitmap(get_system_memory()); > bytes_transferred = 0; > - last_block = NULL; > - last_offset = 0; > - sort_ram_list(); > + reset_ram_globals(); > > if (migrate_use_xbzrle()) { > XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() / > Reviewed-by: Orit Wasserman