From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdMe4-0006A8-S6 for qemu-devel@nongnu.org; Wed, 21 Dec 2011 08:55:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdMe3-0000c0-7E for qemu-devel@nongnu.org; Wed, 21 Dec 2011 08:55:48 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:34279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdMe3-0000bw-1M for qemu-devel@nongnu.org; Wed, 21 Dec 2011 08:55:47 -0500 Received: by ggnk1 with SMTP id k1so6394607ggn.4 for ; Wed, 21 Dec 2011 05:55:46 -0800 (PST) Message-ID: <4EF1E55F.1050604@codemonkey.ws> Date: Wed, 21 Dec 2011 07:55:43 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1324474477-22267-1-git-send-email-avi@redhat.com> <1324474477-22267-4-git-send-email-avi@redhat.com> In-Reply-To: <1324474477-22267-4-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/8] Sort RAMBlocks by ID for migration, not by ram_addr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, quintela@redhat.com On 12/21/2011 07:34 AM, Avi Kivity wrote: > ram_addr is (a) unstable (b) going away. Sort by idstr instead. > > Signed-off-by: Avi Kivity I don't see this as a problem, per say, but this is a significant behavioral change. ram_addr does correspond roughly to the location in memory and historically we would send memory starting from 0 upward whereas now, the order that we send RAMBlocks will be random for all intents and purposes. Again, I don't think it's a problem, but we should note this in the commit message in case it creates a problem down the road. Regards, Anthony Liguori > --- > arch_init.c | 8 ++------ > 1 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 2743bfd..8a3f052 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -217,12 +217,8 @@ static int block_compar(const void *a, const void *b) > { > RAMBlock * const *ablock = a; > RAMBlock * const *bblock = b; > - if ((*ablock)->offset< (*bblock)->offset) { > - return -1; > - } else if ((*ablock)->offset> (*bblock)->offset) { > - return 1; > - } > - return 0; > + > + return strcmp((*ablock)->idstr, (*bblock)->idstr); > } > > static void sort_ram_list(void)