From 8fec98b41b0535ea4823c59ee9bf7d768feac74a Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 21 Dec 2011 13:22:16 +0200 Subject: [PATCH] Sort RAMBlocks by ID for migration, not by ram_addr ram_addr is (a) unstable (b) going away. Sort by idstr instead. Commit b2e0a138e initially introduced the sorting for the purpose of improving debuggability. After this patch, the order is still stable, but perhaps less usable by a human. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- arch_init.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch_init.c b/arch_init.c index c73fa1b2c..5df84048a 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)