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 <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
{
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)