diff mbox series

[PULL,21/38] plugins: update lockstep to use g_memdup2

Message ID 20230703134427.1389440-22-alex.bennee@linaro.org
State New
Headers show
Series [PULL,01/38] gitlab: explicit set artifacts publishing criteria | expand

Commit Message

Alex Bennée July 3, 2023, 1:44 p.m. UTC
The old g_memdup is deprecated, use the replacement.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org>

Comments

Thomas Huth Nov. 13, 2023, 10:46 a.m. UTC | #1
On 03/07/2023 15.44, Alex Bennée wrote:
> The old g_memdup is deprecated, use the replacement.
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org>
> 
> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
> index e36f0b9562..3614c3564c 100644
> --- a/contrib/plugins/lockstep.c
> +++ b/contrib/plugins/lockstep.c
> @@ -130,7 +130,7 @@ static void report_divergance(ExecState *us, ExecState *them)
>           }
>       }
>       divergence_log = g_slist_prepend(divergence_log,
> -                                     g_memdup(&divrec, sizeof(divrec)));
> +                                     g_memdup2(&divrec, sizeof(divrec)));
>   
>       /* Output short log entry of going out of sync... */
>       if (verbose || divrec.distance == 1 || diverged) {

FYI, this seems to trigger a compiler warning on Ubuntu 20.04:

https://app.travis-ci.com/github/huth/qemu/jobs/613144955#L1914

  Thomas
Alex Bennée Nov. 13, 2023, 11:40 a.m. UTC | #2
Thomas Huth <thuth@redhat.com> writes:

> On 03/07/2023 15.44, Alex Bennée wrote:
>> The old g_memdup is deprecated, use the replacement.
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org>
>> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
>> index e36f0b9562..3614c3564c 100644
>> --- a/contrib/plugins/lockstep.c
>> +++ b/contrib/plugins/lockstep.c
>> @@ -130,7 +130,7 @@ static void report_divergance(ExecState *us, ExecState *them)
>>           }
>>       }
>>       divergence_log = g_slist_prepend(divergence_log,
>> -                                     g_memdup(&divrec, sizeof(divrec)));
>> +                                     g_memdup2(&divrec, sizeof(divrec)));
>>         /* Output short log entry of going out of sync... */
>>       if (verbose || divrec.distance == 1 || diverged) {
>
> FYI, this seems to trigger a compiler warning on Ubuntu 20.04:
>
> https://app.travis-ci.com/github/huth/qemu/jobs/613144955#L1914

Isn't 20.04 outside of our support range now? Otherwise we could add a
helper to glib-compat.
Daniel P. Berrangé Nov. 13, 2023, 11:55 a.m. UTC | #3
On Mon, Nov 13, 2023 at 11:40:18AM +0000, Alex Bennée wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
> > On 03/07/2023 15.44, Alex Bennée wrote:
> >> The old g_memdup is deprecated, use the replacement.
> >> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> >> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org>
> >> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
> >> index e36f0b9562..3614c3564c 100644
> >> --- a/contrib/plugins/lockstep.c
> >> +++ b/contrib/plugins/lockstep.c
> >> @@ -130,7 +130,7 @@ static void report_divergance(ExecState *us, ExecState *them)
> >>           }
> >>       }
> >>       divergence_log = g_slist_prepend(divergence_log,
> >> -                                     g_memdup(&divrec, sizeof(divrec)));
> >> +                                     g_memdup2(&divrec, sizeof(divrec)));
> >>         /* Output short log entry of going out of sync... */
> >>       if (verbose || divrec.distance == 1 || diverged) {
> >
> > FYI, this seems to trigger a compiler warning on Ubuntu 20.04:
> >
> > https://app.travis-ci.com/github/huth/qemu/jobs/613144955#L1914
> 
> Isn't 20.04 outside of our support range now? Otherwise we could add a
> helper to glib-compat.

We're still in the 2 year overlap since 22.04 was released, so 20.04 will
remain a target until April next year.

With regards,
Daniel
Thomas Huth Nov. 13, 2023, 12:21 p.m. UTC | #4
On 13/11/2023 12.40, Alex Bennée wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
>> On 03/07/2023 15.44, Alex Bennée wrote:
>>> The old g_memdup is deprecated, use the replacement.
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org>
>>> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
>>> index e36f0b9562..3614c3564c 100644
>>> --- a/contrib/plugins/lockstep.c
>>> +++ b/contrib/plugins/lockstep.c
>>> @@ -130,7 +130,7 @@ static void report_divergance(ExecState *us, ExecState *them)
>>>            }
>>>        }
>>>        divergence_log = g_slist_prepend(divergence_log,
>>> -                                     g_memdup(&divrec, sizeof(divrec)));
>>> +                                     g_memdup2(&divrec, sizeof(divrec)));
>>>          /* Output short log entry of going out of sync... */
>>>        if (verbose || divrec.distance == 1 || diverged) {
>>
>> FYI, this seems to trigger a compiler warning on Ubuntu 20.04:
>>
>> https://app.travis-ci.com/github/huth/qemu/jobs/613144955#L1914
> 
> Isn't 20.04 outside of our support range now? Otherwise we could add a
> helper to glib-compat.

It's "Support for the previous major version will be dropped 2 years after 
the new major version is released", so we claim to support 20.04 until 2024 
(since the "new major version" has been released in 2022).

  Thomas
diff mbox series

Patch

diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
index e36f0b9562..3614c3564c 100644
--- a/contrib/plugins/lockstep.c
+++ b/contrib/plugins/lockstep.c
@@ -130,7 +130,7 @@  static void report_divergance(ExecState *us, ExecState *them)
         }
     }
     divergence_log = g_slist_prepend(divergence_log,
-                                     g_memdup(&divrec, sizeof(divrec)));
+                                     g_memdup2(&divrec, sizeof(divrec)));
 
     /* Output short log entry of going out of sync... */
     if (verbose || divrec.distance == 1 || diverged) {