From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Hao QingFeng <haoqf@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 1/3] block: Fix bdrv_iterate_format() sorting
Date: Wed, 12 Oct 2016 22:49:05 +0200 [thread overview]
Message-ID: <20161012204907.25941-2-mreitz@redhat.com> (raw)
In-Reply-To: <20161012204907.25941-1-mreitz@redhat.com>
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>
---
block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block.c b/block.c
index bb1f1ec..e46e4b2 100644
--- a/block.c
+++ b/block.c
@@ -2789,7 +2789,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),
--
2.10.0
next prev parent reply other threads:[~2016-10-12 20:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 20:49 [Qemu-devel] [PATCH 0/3] iotests: Skip 162 if there is no SSH support Max Reitz
2016-10-12 20:49 ` Max Reitz [this message]
2016-10-12 21:31 ` [Qemu-devel] [PATCH 1/3] block: Fix bdrv_iterate_format() sorting Eric Blake
2016-10-12 20:49 ` [Qemu-devel] [PATCH 2/3] block: Emit modules in bdrv_iterate_format() Max Reitz
2016-10-12 22:35 ` Eric Blake
2016-11-02 10:52 ` Hao QingFeng
2016-11-02 11:15 ` Kevin Wolf
2016-11-02 11:59 ` Hao QingFeng
2016-11-02 15:29 ` Eric Blake
2016-10-12 20:49 ` [Qemu-devel] [PATCH 3/3] iotests: Skip test 162 if there is no SSH support Max Reitz
2016-10-12 22:36 ` Eric Blake
2016-10-12 22:26 ` [Qemu-devel] [PATCH 0/3] iotests: Skip " no-reply
2016-10-28 15:13 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161012204907.25941-2-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=haoqf@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).