From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Yao Xingtao <yaoxt.fnst@fujitsu.com>,
qemu-devel@nongnu.org, alex.bennee@linaro.org, erdnaxe@crans.org,
ma.mandourr@gmail.com
Subject: Re: [PATCH v2] contrib/plugins/execlog: Fix compiler warning
Date: Mon, 25 Mar 2024 14:16:03 +0400 [thread overview]
Message-ID: <3e202821-7f78-4b4c-9b16-ee47c51e2a62@linaro.org> (raw)
In-Reply-To: <CAFEAcA8AhymqyzF5aPWMKA_R64tFHbyJuQhpPbAuoabHdh0e=A@mail.gmail.com>
On 3/25/24 13:58, Peter Maydell wrote:
> On Mon, 25 Mar 2024 at 06:41, Pierrick Bouvier
> <pierrick.bouvier@linaro.org> wrote:
>>
>> On 3/25/24 10:06, Yao Xingtao wrote:
>>> diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
>>> index a1dfd59ab7..09654910ee 100644
>>> --- a/contrib/plugins/execlog.c
>>> +++ b/contrib/plugins/execlog.c
>>> @@ -327,8 +327,13 @@ static GPtrArray *registers_init(int vcpu_index)
>>> for (int p = 0; p < rmatches->len; p++) {
>>> g_autoptr(GPatternSpec) pat = g_pattern_spec_new(rmatches->pdata[p]);
>>> g_autofree gchar *rd_lower = g_utf8_strdown(rd->name, -1);
>>> +#if GLIB_CHECK_VERSION(2, 70, 0)
>>> + if (g_pattern_spec_match_string(pat, rd->name) ||
>>> + g_pattern_spec_match_string(pat, rd_lower)) {
>>> +#else
>>> if (g_pattern_match_string(pat, rd->name) ||
>>> g_pattern_match_string(pat, rd_lower)) {
>>> +#endif
>>> Register *reg = init_vcpu_register(rd);
>>> g_ptr_array_add(registers, reg);
>>>
>>
>> As suggested by Peter on previous version, you can declare a new
>> function `g_pattern_match_string_qemu` in include/glib-compat.h which
>> abstract this.
>
> We should have an abstraction function, but it should *not*
> be in glib-compat.h, but local to this plugin's .c file. This is
> because the plugins are deliberately standalone binaries which do not
> rely on any of QEMU's include files or build process (you'll
> see they don't use osdep.h, for example).
>
Sorry, I misunderstood that, as it was discussed with Alex that maybe
plugins should be able to access glib-compat.h.
> thanks
> -- PMM
next prev parent reply other threads:[~2024-03-25 10:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 2:01 [PATCH] contrib/plugins/execlog: Fix compiler warning Yao Xingtao via
2024-03-22 11:50 ` Peter Maydell
2024-03-25 3:00 ` Xingtao Yao (Fujitsu) via
2024-03-25 4:31 ` Pierrick Bouvier
2024-03-25 5:55 ` Xingtao Yao (Fujitsu) via
2024-03-25 6:06 ` [PATCH v2] " Yao Xingtao via
2024-03-25 6:41 ` Pierrick Bouvier
2024-03-25 9:58 ` Peter Maydell
2024-03-25 10:16 ` Pierrick Bouvier [this message]
2024-03-26 1:52 ` [PATCH v3] " Yao Xingtao via
2024-03-26 3:33 ` Pierrick Bouvier
2024-03-26 9:54 ` Philippe Mathieu-Daudé
2024-03-26 10:33 ` Peter Maydell
2024-03-26 12:03 ` Philippe Mathieu-Daudé
2024-03-27 0:21 ` Xingtao Yao (Fujitsu) via
2024-03-26 12:38 ` Pierrick Bouvier
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=3e202821-7f78-4b4c-9b16-ee47c51e2a62@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=erdnaxe@crans.org \
--cc=ma.mandourr@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yaoxt.fnst@fujitsu.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).