Skip to contentSkip to conversation

Remove g_sequence_lookup from qemu-img help function

PATCH Applied Mike Day 6 participants 6 messages May 13, 2014 – May 16, 2014

lore
Share & tools
lore

Mike Day

author
#0 lore raw

PATCH 1/1 Remove g_sequence_lookup from qemu-img help function

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
qemu-img.c +2 -5
index 04ce02a..1ad899e 100644
@@ -70,11 +70,8 @@ static void add_format_to_seq(void *opaque, const char *fmt_name)
 {
     GSequence *seq = opaque;
 
-    if (!g_sequence_lookup(seq, (gpointer)fmt_name,
-                           compare_data, NULL)) {
-        g_sequence_insert_sorted(seq, (gpointer)fmt_name,
-                                 compare_data, NULL);
-    }
+    g_sequence_insert_sorted(seq, (gpointer)fmt_name,
+                             compare_data, NULL);
 }
 
 static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, ...)
Signature · 1 line
1.9.0
Reviewed-by on v1 1/1
#1 lore raw

On 05/13/2014 03:11 PM, Mike Day wrote:

Subject line could have used a [PATCHv2] designation to make it obvious this is a fixed version. But that doesn't affect what goes into git.

Quoted 10 lines

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Applied
#2 lore raw

Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:

Quoted 11 lines · Mike Day

Subject line could have used a [PATCHv2] designation to make it obvious this is a fixed version. But that doesn't affect what goes into git.

Quoted 6 lines

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

Quoted 6 lines
Quoted 4 lines
---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Thanks, applied to the block branch.

Kevin

#3 lore raw
Quoted 12 lines · Kevin Wolf

Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:

Quoted 11 lines · Mike Day

Subject line could have used a [PATCHv2] designation to make it obvious this is a fixed version. But that doesn't affect what goes into git.

Quoted 6 lines

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Thanks, applied to the block branch.

Ah, I was thinking about applying this directly since it's a build fix. But I guess it could go through the block branch instead...

thanks
-- PMM

#4 lore raw
Quoted 13 lines · Peter Maydell
Quoted 12 lines · Kevin Wolf

Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:

Quoted 11 lines · Mike Day

Subject line could have used a [PATCHv2] designation to make it obvious this is a fixed version. But that doesn't affect what goes into git.

Quoted 6 lines

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
---
  qemu-img.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)

Thanks, applied to the block branch.

Ah, I was thinking about applying this directly since it's a build fix. But I guess it could go through the block branch instead...

Yes, could you please apply it directly?

Alex

Acked-by on v1 1/1
#5 lore raw
In reply to Mike Day
Quoted 10 lines · On Tue, 13 May 2014 17:11:06 -0400 Mike Day <[email protected]> wrote:

g_sequence_lookup is not supported by glib < 2.28. The usage of g_sequence_lookup is not essential in this context (it's a safeguard against duplicate values in the help message). Removing the call enables the build on all platforms and does not change the operation of the help function.

---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

I don't get duplicates even without the safeguard :)