Received: from eggs.gnu.org ([2001:4830:134:3::10]:50546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkDXw-0000aY-2g for qemu-devel@nongnu.org; Tue, 13 May 2014 10:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkDXl-0005cX-DC for qemu-devel@nongnu.org; Tue, 13 May 2014 10:19:08 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:35487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkDXl-0005c9-4X for qemu-devel@nongnu.org; Tue, 13 May 2014 10:18:57 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 May 2014 15:18:55 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 50CE11B08061 for ; Tue, 13 May 2014 15:19:06 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4DEIqei59965654 for ; Tue, 13 May 2014 14:18:52 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4DEIpnC028150 for ; Tue, 13 May 2014 08:18:51 -0600 Date: Tue, 13 May 2014 16:18:49 +0200 From: Cornelia Huck Message-ID: <20140513161849.08628e6c.cornelia.huck@de.ibm.com> In-Reply-To: <1399662217-31148-4-git-send-email-stefanha@redhat.com> References: <1399662217-31148-1-git-send-email-stefanha@redhat.com> <1399662217-31148-4-git-send-email-stefanha@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 03/17] qemu-img: sort block formats in help message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Mike Day , Peter Maydell , qemu-devel@nongnu.org On Fri, 9 May 2014 21:03:23 +0200 Stefan Hajnoczi wrote: > From: Mike Day >=20 > The help message for qemu-img lists the supported block formats, of > which there are 27 as of version 2.0.50. The formats are printed in > the order of their driver's position in a linked list, which appears > random. This patch prints the formats in sorted order, making it > easier to read and to find a specific format in the list. >=20 > [Added suggestions from Fam Zheng to declare variables > at the top of the scope in help() and to omit explicit cast for void* > opaque. > --Stefan] >=20 > Signed-off-by: Mike Day > Signed-off-by: Stefan Hajnoczi > --- > qemu-img.c | 28 +++++++++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 deletions(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index 96f4463..317bc6c 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > +static void add_format_to_seq(void *opaque, const char *fmt_name) > +{ > + GSequence *seq =3D opaque; > + > + if (!g_sequence_lookup(seq, (gpointer)fmt_name, > + compare_data, NULL)) { > + g_sequence_insert_sorted(seq, (gpointer)fmt_name, > + compare_data, NULL); > + } > } Now that this has hit master, I noticed that this breaks the build on my build server: /home/cohuck/git/qemu/qemu-img.c: In function =E2=80=98add_format_to_seq=E2= =80=99: /home/cohuck/git/qemu/qemu-img.c:73: warning: implicit declaration of funct= ion =E2=80=98g_sequence_lookup=E2=80=99 /home/cohuck/git/qemu/qemu-img.c:73: warning: nested extern declaration of = =E2=80=98g_sequence_lookup=E2=80=99 qemu-img.o: In function `add_format_to_seq': /home/cohuck/git/qemu/qemu-img.c:73: undefined reference to `g_sequence_loo= kup' collect2: ld returned 1 exit status g_sequence_lookup has been added with glib 2.28, and this box has 2.22.5. configure looks for glib >=3D 2.12 (2.20 for mingw).