All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Michel <luc@lmichel.fr>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Liviu Ionescu" <ilg@livius.net>
Subject: Re: [PATCH 2/2] semihosting/config: Merge --semihosting-config option groups
Date: Thu, 9 Jun 2022 22:02:28 +0200	[thread overview]
Message-ID: <YqJR1FFnRZy6U9Fd@sekoia-pc.home.lmichel.fr> (raw)
In-Reply-To: <20220526190053.521505-3-peter.maydell@linaro.org>

On 20:00 Thu 26 May     , Peter Maydell wrote:
> Currently we mishandle the --semihosting-config option if the
> user specifies it on the command line more than once. For
> example with:
>  --semihosting-config target=gdb --semihosting-config arg=foo,arg=bar
> 
> the function qemu_semihosting_config_options() is called twice, once
> for each argument.  But that function expects to be called only once,
> and it always unconditionally sets the semihosting.enabled,
> semihost_chardev and semihosting.target variables.  This means that
> if any of those options were set anywhere except the last
> --semihosting-config option on the command line, those settings are
> ignored.  In the example above, 'target=gdb' in the first option is
> overridden by an implied default 'target=auto' in the second.
> 
> The QemuOptsList machinery has a flag for handling this kind of
> "option group is setting global state": by setting
>  .merge_lists = true;
> we make the machinery merge all the --semihosting-config arguments
> the user passes into a single set of options and call our
> qemu_semihosting_config_options() just once.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Luc Michel <luc@lmichel.fr>

> ---
>  semihosting/config.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/semihosting/config.c b/semihosting/config.c
> index 50d82108e6e..3afacf54ab2 100644
> --- a/semihosting/config.c
> +++ b/semihosting/config.c
> @@ -27,6 +27,7 @@
>  
>  QemuOptsList qemu_semihosting_config_opts = {
>      .name = "semihosting-config",
> +    .merge_lists = true,
>      .implied_opt_name = "enable",
>      .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head),
>      .desc = {
> -- 
> 2.25.1
> 
> 

-- 


  reply	other threads:[~2022-06-09 20:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 19:00 [PATCH 0/2] gdbstub: don't crash if no gdb attached and gdb syscall attempted Peter Maydell
2022-05-26 19:00 ` [PATCH 1/2] gdbstub: Don't use GDB syscalls if no GDB is attached Peter Maydell
2022-05-29 11:06   ` Philippe Mathieu-Daudé via
2022-06-09 20:01   ` Luc Michel
2022-05-26 19:00 ` [PATCH 2/2] semihosting/config: Merge --semihosting-config option groups Peter Maydell
2022-06-09 20:02   ` Luc Michel [this message]
2022-06-10 13:04 ` [PATCH 0/2] gdbstub: don't crash if no gdb attached and gdb syscall attempted Peter Maydell
2022-06-10 14:40   ` Alex Bennée

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=YqJR1FFnRZy6U9Fd@sekoia-pc.home.lmichel.fr \
    --to=luc@lmichel.fr \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=ilg@livius.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.