From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH v3 2/3] vl.c: Use qemu_get_boot_opts
Date: Wed, 7 May 2014 22:36:26 -0700 [thread overview]
Message-ID: <a90d587f07fbfd1932aa9667290a75a19db52d68.1399509809.git.peter.crosthwaite@xilinx.com> (raw)
In-Reply-To: <cover.1399509809.git.peter.crosthwaite@xilinx.com>
To simplfiy and make consistent with surrounding code using
qemu_get_machine_opts(). Create a new local variable name boot_opts
for consistency as well.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
vl.c | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/vl.c b/vl.c
index 10a0c59..6d670fe 100644
--- a/vl.c
+++ b/vl.c
@@ -2971,7 +2971,7 @@ int main(int argc, char **argv, char **envp)
const char *boot_order;
DisplayState *ds;
int cyls, heads, secs, translation;
- QemuOpts *hda_opts = NULL, *opts, *machine_opts;
+ QemuOpts *hda_opts = NULL, *opts, *machine_opts, *boot_opts;
QemuOptsList *olist;
int optind;
const char *optarg;
@@ -3000,6 +3000,9 @@ int main(int argc, char **argv, char **envp)
const ram_addr_t default_ram_size = (ram_addr_t)DEFAULT_RAM_SIZE *
1024 * 1024;
+ char *normal_boot_order;
+ const char *order, *once;
+
atexit(qemu_run_exit_notifiers);
error_set_progname(argv[0]);
qemu_init_exec_dir(argv[0]);
@@ -4245,29 +4248,25 @@ int main(int argc, char **argv, char **envp)
bios_name = qemu_opt_get(machine_opts, "firmware");
boot_order = machine_class->default_boot_order;
- opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
- if (opts) {
- char *normal_boot_order;
- const char *order, *once;
-
- order = qemu_opt_get(opts, "order");
- if (order) {
- validate_bootdevices(order);
- boot_order = order;
- }
+ boot_opts = qemu_get_boot_opts();
- once = qemu_opt_get(opts, "once");
- if (once) {
- validate_bootdevices(once);
- normal_boot_order = g_strdup(boot_order);
- boot_order = once;
- qemu_register_reset(restore_boot_order, normal_boot_order);
- }
+ order = qemu_opt_get(boot_opts, "order");
+ if (order) {
+ validate_bootdevices(order);
+ boot_order = order;
+ }
- boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu);
- boot_strict = qemu_opt_get_bool(opts, "strict", false);
+ once = qemu_opt_get(boot_opts, "once");
+ if (once) {
+ validate_bootdevices(once);
+ normal_boot_order = g_strdup(boot_order);
+ boot_order = once;
+ qemu_register_reset(restore_boot_order, normal_boot_order);
}
+ boot_menu = qemu_opt_get_bool(boot_opts, "menu", boot_menu);
+ boot_strict = qemu_opt_get_bool(boot_opts, "strict", false);
+
if (!kernel_cmdline) {
kernel_cmdline = "";
}
--
1.9.2.1.g06c4abd
next prev parent reply other threads:[~2014-05-08 5:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 5:35 [Qemu-devel] [PATCH v3 0/3] Introduce qemu_get_boot_opts() Peter Crosthwaite
2014-05-08 5:35 ` [Qemu-devel] [PATCH v3 1/3] vl.c: Add qemu_get_boot_opts() Peter Crosthwaite
2014-05-08 5:36 ` Peter Crosthwaite [this message]
2014-05-15 18:01 ` [Qemu-devel] [PATCH v3 2/3] vl.c: Use qemu_get_boot_opts Markus Armbruster
2014-05-08 5:37 ` [Qemu-devel] [PATCH v3 3/3] nvram: fw_cfg: Fix -boot options in nvram/fw_cfg Peter Crosthwaite
2014-05-15 18:03 ` Markus Armbruster
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=a90d587f07fbfd1932aa9667290a75a19db52d68.1399509809.git.peter.crosthwaite@xilinx.com \
--to=peter.crosthwaite@xilinx.com \
--cc=armbru@redhat.com \
--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).