From: Christopher Covington <cov@codeaurora.org>
To: Leon Alrae <leon.alrae@imgtec.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, ilg@livius.net,
matthew.fortune@imgtec.com, christopher.covington@linaro.org
Subject: Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument
Date: Wed, 01 Apr 2015 11:45:28 -0400 [thread overview]
Message-ID: <551C1298.6090702@codeaurora.org> (raw)
In-Reply-To: <1427894283-31953-1-git-send-email-leon.alrae@imgtec.com>
Hi Leon,
On 04/01/2015 09:18 AM, Leon Alrae wrote:
> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
> ---
> Hi,
>
> Continuing the discussion related to extending QEMU's command line with new
> argument allowing to pass semi-hosting input arguments to the guest program:
> https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg05960.html
>
> This simple patch adds "arg" sub-argument which in my opinion is flexible
> enough to satisfy semi-hosting interfaces which allocate buffers at runtime
> (so it is possible to pass any number of strings of any length) as well as the
> ones which have limited buffer for a single input string.
>
> Highlights:
>
> * arg can appear multiple times in -semihosting-config group of sub-arguments
> and is used to create argc/argv.
>
> * Single string cmdline can be still easily created:
> static void concat_semihosting_args(char *buffer, int buffer_size,
> const char *separator)
> {
> int i;
> buffer[0] = '\0';
> for (i = 0; i < semihosting_argc - 1; i++) {
> pstrcat(buffer, buffer_size, semihosting_argv[i]);
> pstrcat(buffer, buffer_size, separator);
> }
> pstrcat(buffer, buffer_size, semihosting_argv[i]);
> }
>
> * argv[0] is set by the first occurence of "arg" rather than taking the same
> string from "-kernel". This might be required in cases where the path is too
> long and semi-hosting app's buffer for the cmdline is fixed and small.
>
> * No altering the parser itself, just traversing the -semihosting-config opts
> and picking all arg strings.
>
> * This patch doesn't fix the need of using double-commas if user want to have
> a comma in the string.
>
> If we agree on this new option then I would like to follow up with a clean up
> where we've got a semi-hosting specific structure rather than keep generating
> more semihosting_* variables (I skipped it in this patch to avoid generating
> clean up related noise in the diff).
I think the commit message and help text should include some information on
how this is different from -append and what the result is of specifying both
-append foo=a and -semihosting-config arg=foo=b.
Thanks,
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-04-01 15:54 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 13:18 [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument Leon Alrae
2015-04-01 15:21 ` Liviu Ionescu
2015-04-01 16:12 ` Matthew Fortune
2015-04-02 7:56 ` Leon Alrae
2015-04-02 8:29 ` Liviu Ionescu
2015-04-02 9:14 ` Leon Alrae
2015-04-02 10:36 ` Leon Alrae
2015-04-02 12:36 ` Liviu Ionescu
2015-04-02 14:27 ` Matthew Fortune
2015-04-02 16:47 ` Liviu Ionescu
2015-04-03 15:33 ` Liviu Ionescu
2015-04-08 16:20 ` Leon Alrae
2015-04-14 17:42 ` Liviu Ionescu
2015-04-15 9:09 ` Liviu Ionescu
2015-04-15 11:53 ` Leon Alrae
2015-04-15 12:02 ` Matthew Fortune
2015-04-15 12:06 ` Liviu Ionescu
2015-04-15 12:49 ` Leon Alrae
2015-04-15 16:08 ` Liviu Ionescu
2015-04-16 9:27 ` Leon Alrae
2015-04-17 17:45 ` Liviu Ionescu
2015-04-16 14:22 ` Peter Maydell
2015-04-21 13:34 ` Leon Alrae
2015-04-21 15:14 ` Liviu Ionescu
2015-04-21 15:55 ` Peter Maydell
2015-04-21 16:21 ` Liviu Ionescu
2015-04-21 16:23 ` Peter Maydell
2015-04-21 16:51 ` Liviu Ionescu
2015-04-21 17:50 ` Peter Maydell
2015-04-21 16:48 ` Eric Blake
2015-04-21 16:54 ` Peter Maydell
2015-04-21 17:22 ` Eric Blake
2015-04-21 17:49 ` Liviu Ionescu
2015-04-21 18:08 ` Liviu Ionescu
2015-04-23 11:55 ` Leon Alrae
2015-04-23 12:07 ` Liviu Ionescu
2015-04-01 15:45 ` Christopher Covington [this message]
2015-04-01 16:24 ` Liviu Ionescu
2015-04-04 15:20 ` Liviu Ionescu
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=551C1298.6090702@codeaurora.org \
--to=cov@codeaurora.org \
--cc=christopher.covington@linaro.org \
--cc=ilg@livius.net \
--cc=leon.alrae@imgtec.com \
--cc=matthew.fortune@imgtec.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 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).