提交 8fec98b4 编写于 作者: A Avi Kivity

Sort RAMBlocks by ID for migration, not by ram_addr

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

Commit b2e0a138 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: NAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 71c510e2
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册