mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
block: Fix bdrv_iterate_format() sorting
bdrv_iterate_format() did not actually sort the formats by name but by "pointer interpreted as string". That is probably not what we intended to do, so fix it (by changing qsort_strcmp() so it matches the example from qsort()'s manual page). Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20161012204907.25941-2-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
07555ba6f3
commit
ceff5bd79c
1 changed files with 1 additions and 1 deletions
2
block.c
2
block.c
|
@ -2796,7 +2796,7 @@ const char *bdrv_get_format_name(BlockDriverState *bs)
|
|||
|
||||
static int qsort_strcmp(const void *a, const void *b)
|
||||
{
|
||||
return strcmp(a, b);
|
||||
return strcmp(*(char *const *)a, *(char *const *)b);
|
||||
}
|
||||
|
||||
void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue