qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
@ 2014-05-13 18:34 Mike Day
  2014-05-13 19:37 ` Eric Blake
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Day @ 2014-05-13 18:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, peter.maydell, Mike Day, stefanha, cornelia.huck, ambru

g_sequence_lookup is not supported by glib < 2.28. The usage
of g_sequence_lookup is not essential in this context (its 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.

Signed-off-by: Mike Day <ncmike@ncultra.org>
---
 qemu-img.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 04ce02a..bf5e74c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -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);
-    }
 }
 
 static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, ...)
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-13 18:34 Mike Day
@ 2014-05-13 19:37 ` Eric Blake
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2014-05-13 19:37 UTC (permalink / raw)
  To: Mike Day, qemu-devel
  Cc: kwolf, peter.maydell, cornelia.huck, Markus Armbruster, stefanha

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

On 05/13/2014 12:34 PM, Mike Day wrote:
> g_sequence_lookup is not supported by glib < 2.28. The usage
> of g_sequence_lookup is not essential in this context (its a

s/its/it's/

> 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.
> 
> Signed-off-by: Mike Day <ncmike@ncultra.org>
> ---
>  qemu-img.c | 3 ---
>  1 file changed, 3 deletions(-)

> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 04ce02a..bf5e74c 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -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,

Indentation is now off.  Please unindent the body now that you are
removing the surrounding if.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
@ 2014-05-13 21:11 Mike Day
  2014-05-13 21:48 ` Eric Blake
  2014-05-14  6:31 ` Cornelia Huck
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Day @ 2014-05-13 21:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, armbru, Mike Day, stefanha, cornelia.huck

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.

Signed-off-by: Mike Day <ncmike@ncultra.org>
---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 04ce02a..1ad899e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -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, ...)
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-13 21:11 [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function Mike Day
@ 2014-05-13 21:48 ` Eric Blake
  2014-05-14  7:44   ` Kevin Wolf
  2014-05-14  6:31 ` Cornelia Huck
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Blake @ 2014-05-13 21:48 UTC (permalink / raw)
  To: Mike Day, qemu-devel
  Cc: kwolf, peter.maydell, cornelia.huck, armbru, stefanha

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

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.

> 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.
> 
> Signed-off-by: Mike Day <ncmike@ncultra.org>
> ---
>  qemu-img.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-13 21:11 [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function Mike Day
  2014-05-13 21:48 ` Eric Blake
@ 2014-05-14  6:31 ` Cornelia Huck
  1 sibling, 0 replies; 8+ messages in thread
From: Cornelia Huck @ 2014-05-14  6:31 UTC (permalink / raw)
  To: Mike Day; +Cc: kwolf, peter.maydell, qemu-devel, stefanha, armbru

On Tue, 13 May 2014 17:11:06 -0400
Mike Day <ncmike@ncultra.org> 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.
> 
> Signed-off-by: Mike Day <ncmike@ncultra.org>
> ---
>  qemu-img.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

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

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-13 21:48 ` Eric Blake
@ 2014-05-14  7:44   ` Kevin Wolf
  2014-05-14  8:23     ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Wolf @ 2014-05-14  7:44 UTC (permalink / raw)
  To: Eric Blake
  Cc: peter.maydell, qemu-devel, armbru, Mike Day, stefanha,
	cornelia.huck

[-- Attachment #1: Type: text/plain, Size: 813 bytes --]

Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:
> 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.
> 
> > 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.
> > 
> > Signed-off-by: Mike Day <ncmike@ncultra.org>
> > ---
> >  qemu-img.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks, applied to the block branch.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-14  7:44   ` Kevin Wolf
@ 2014-05-14  8:23     ` Peter Maydell
  2014-05-16 12:35       ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2014-05-14  8:23 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: QEMU Developers, Markus Armbruster, Mike Day, Stefan Hajnoczi,
	Cornelia Huck

On 14 May 2014 08:44, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:
>> 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.
>>
>> > 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.
>> >
>> > Signed-off-by: Mike Day <ncmike@ncultra.org>
>> > ---
>> >  qemu-img.c | 7 ++-----
>> >  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
  2014-05-14  8:23     ` Peter Maydell
@ 2014-05-16 12:35       ` Alexander Graf
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2014-05-16 12:35 UTC (permalink / raw)
  To: Peter Maydell, Kevin Wolf
  Cc: Mike Day, Cornelia Huck, QEMU Developers, Stefan Hajnoczi,
	Markus Armbruster


On 14.05.14 10:23, Peter Maydell wrote:
> On 14 May 2014 08:44, Kevin Wolf <kwolf@redhat.com> wrote:
>> Am 13.05.2014 um 23:48 hat Eric Blake geschrieben:
>>> 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.
>>>
>>>> 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.
>>>>
>>>> Signed-off-by: Mike Day <ncmike@ncultra.org>
>>>> ---
>>>>   qemu-img.c | 7 ++-----
>>>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-16 12:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13 21:11 [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function Mike Day
2014-05-13 21:48 ` Eric Blake
2014-05-14  7:44   ` Kevin Wolf
2014-05-14  8:23     ` Peter Maydell
2014-05-16 12:35       ` Alexander Graf
2014-05-14  6:31 ` Cornelia Huck
  -- strict thread matches above, loose matches on Subject: below --
2014-05-13 18:34 Mike Day
2014-05-13 19:37 ` Eric Blake

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).