From: Anthony Liguori <aliguori@us.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
patches@linaro.org, qemu-devel@nongnu.org,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 3/4] Make kernel, initrd and append be machine_opts
Date: Wed, 22 Feb 2012 12:31:31 -0600 [thread overview]
Message-ID: <4F453483.5010203@us.ibm.com> (raw)
In-Reply-To: <1328679700-31015-4-git-send-email-peter.maydell@linaro.org>
On 02/07/2012 11:41 PM, Peter Maydell wrote:
> Make kernel, initrd, append be machine opts (ie -machine kernel=foo)
> with the old plain command line arguments as legacy/convenience
> equivalents.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
I applied this patch since Andrzej applied the first two. The four patch
conflicts a bit more than I feel comfortable fixing myself. I would suggest
that you just fold the 4th patch into your next pull request.
Regards,
Anthony Liguori
> ---
> qemu-config.c | 12 ++++++++++++
> vl.c | 24 ++++++++++++++++--------
> 2 files changed, 28 insertions(+), 8 deletions(-)
>
> diff --git a/qemu-config.c b/qemu-config.c
> index c938470..07480a4 100644
> --- a/qemu-config.c
> +++ b/qemu-config.c
> @@ -536,6 +536,18 @@ static QemuOptsList qemu_machine_opts = {
> .name = "kernel_irqchip",
> .type = QEMU_OPT_BOOL,
> .help = "use KVM in-kernel irqchip",
> + }, {
> + .name = "kernel",
> + .type = QEMU_OPT_STRING,
> + .help = "Linux kernel image file",
> + }, {
> + .name = "initrd",
> + .type = QEMU_OPT_STRING,
> + .help = "Linux initial ramdisk file",
> + }, {
> + .name = "append",
> + .type = QEMU_OPT_STRING,
> + .help = "Linux kernel command line",
> },
> { /* End of list */ }
> },
> diff --git a/vl.c b/vl.c
> index fe24ef8..b8bb955 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2238,11 +2238,8 @@ int main(int argc, char **argv, char **envp)
> module_call_init(MODULE_INIT_MACHINE);
> machine = find_default_machine();
> cpu_model = NULL;
> - initrd_filename = NULL;
> ram_size = 0;
> snapshot = 0;
> - kernel_filename = NULL;
> - kernel_cmdline = "";
> cyls = heads = secs = 0;
> translation = BIOS_ATA_TRANSLATION_AUTO;
>
> @@ -2318,9 +2315,6 @@ int main(int argc, char **argv, char **envp)
> cpu_model = optarg;
> }
> break;
> - case QEMU_OPTION_initrd:
> - initrd_filename = optarg;
> - break;
> case QEMU_OPTION_hda:
> {
> char buf[256];
> @@ -2451,10 +2445,13 @@ int main(int argc, char **argv, char **envp)
> }
> break;
> case QEMU_OPTION_kernel:
> - kernel_filename = optarg;
> + qemu_opts_set(qemu_find_opts("machine"), 0, "kernel", optarg);
> + break;
> + case QEMU_OPTION_initrd:
> + qemu_opts_set(qemu_find_opts("machine"), 0, "initrd", optarg);
> break;
> case QEMU_OPTION_append:
> - kernel_cmdline = optarg;
> + qemu_opts_set(qemu_find_opts("machine"), 0, "append", optarg);
> break;
> case QEMU_OPTION_cdrom:
> drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS);
> @@ -3241,6 +3238,17 @@ int main(int argc, char **argv, char **envp)
> fprintf(stderr, "qemu_init_main_loop failed\n");
> exit(1);
> }
> +
> + kernel_filename = qemu_opt_get(qemu_opts_find(qemu_find_opts("machine"),
> + 0), "kernel");
> + initrd_filename = qemu_opt_get(qemu_opts_find(qemu_find_opts("machine"),
> + 0), "initrd");
> + kernel_cmdline = qemu_opt_get(qemu_opts_find(qemu_find_opts("machine"),
> + 0), "append");
> + if (!kernel_cmdline) {
> + kernel_cmdline = "";
> + }
> +
> linux_boot = (kernel_filename != NULL);
>
> if (!linux_boot&& *kernel_cmdline != '\0') {
next prev parent reply other threads:[~2012-02-22 18:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 5:41 [Qemu-devel] [PATCH 0/4] arm: add device tree support (via machine opts) Peter Maydell
2012-02-08 5:41 ` [Qemu-devel] [PATCH 1/4] qemu-option: Add support for merged QemuOptsLists Peter Maydell
2012-02-08 5:41 ` [Qemu-devel] [PATCH 2/4] Make -machine/-enable-kvm options merge into a single list Peter Maydell
2012-02-17 8:11 ` andrzej zaborowski
2012-02-08 5:41 ` [Qemu-devel] [PATCH 3/4] Make kernel, initrd and append be machine_opts Peter Maydell
2012-02-22 18:31 ` Anthony Liguori [this message]
2012-02-08 5:41 ` [Qemu-devel] [PATCH 4/4] arm: add device tree support Peter Maydell
2012-02-20 19:47 ` Peter Maydell
2012-02-21 9:23 ` Peter Crosthwaite
2012-02-08 8:16 ` [Qemu-devel] [PATCH 0/4] arm: add device tree support (via machine opts) Peter Crosthwaite
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=4F453483.5010203@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=agraf@suse.de \
--cc=grant.likely@secretlab.ca \
--cc=patches@linaro.org \
--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).