qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/8] Sort RAMBlocks by ID for migration, not by ram_


From: Avi Kivity
Subject: [Qemu-devel] [PATCH 3/8] Sort RAMBlocks by ID for migration, not by ram_addr
Date: Wed, 21 Dec 2011 15:34:32 +0200

ram_addr is (a) unstable (b) going away.  Sort by idstr instead.

Signed-off-by: Avi Kivity <address@hidden>
---
 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)
-- 
1.7.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]