* [Qemu-devel] [PATCH V2] vl.c: remove machine_opts from main and the duplicate call to qemu_get_machine_opts
@ 2016-02-08 12:15 Marcel Apfelbaum
2016-02-08 14:07 ` Igor Mammedov
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Apfelbaum @ 2016-02-08 12:15 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, pbonzini
Use current machine properties instead of querying machine's opts.
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
v1 -> v2:
- Use the current machine also for dtb
- Remove the machine_opts from main completely
vl.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/vl.c b/vl.c
index d4a8661..c8bc4bf 100644
--- a/vl.c
+++ b/vl.c
@@ -2991,7 +2991,7 @@ int main(int argc, char **argv, char **envp)
const char *boot_once = NULL;
DisplayState *ds;
int cyls, heads, secs, translation;
- QemuOpts *hda_opts = NULL, *opts, *machine_opts, *icount_opts = NULL;
+ QemuOpts *hda_opts = NULL, *opts, *icount_opts = NULL;
QemuOptsList *olist;
int optind;
const char *optarg;
@@ -4339,9 +4339,8 @@ int main(int argc, char **argv, char **envp)
exit(0);
}
- machine_opts = qemu_get_machine_opts();
- if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
- NULL)) {
+ if (qemu_opt_foreach(qemu_get_machine_opts(), machine_set_property,
+ current_machine, NULL)) {
object_unref(OBJECT(current_machine));
exit(1);
}
@@ -4352,11 +4351,10 @@ int main(int argc, char **argv, char **envp)
qtest_init(qtest_chrdev, qtest_log, &error_fatal);
}
- machine_opts = qemu_get_machine_opts();
- kernel_filename = qemu_opt_get(machine_opts, "kernel");
- initrd_filename = qemu_opt_get(machine_opts, "initrd");
- kernel_cmdline = qemu_opt_get(machine_opts, "append");
- bios_name = qemu_opt_get(machine_opts, "firmware");
+ kernel_filename = current_machine->kernel_filename;
+ initrd_filename = current_machine->initrd_filename;
+ kernel_cmdline = current_machine->kernel_cmdline;
+ bios_name = current_machine->firmware;
opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
if (opts) {
@@ -4395,7 +4393,7 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
- if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
+ if (!linux_boot && current_machine->dtb) {
error_report("-dtb only allowed with -kernel option");
exit(1);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH V2] vl.c: remove machine_opts from main and the duplicate call to qemu_get_machine_opts
2016-02-08 12:15 [Qemu-devel] [PATCH V2] vl.c: remove machine_opts from main and the duplicate call to qemu_get_machine_opts Marcel Apfelbaum
@ 2016-02-08 14:07 ` Igor Mammedov
0 siblings, 0 replies; 2+ messages in thread
From: Igor Mammedov @ 2016-02-08 14:07 UTC (permalink / raw)
To: Marcel Apfelbaum; +Cc: pbonzini, qemu-devel
On Mon, 8 Feb 2016 14:15:59 +0200
Marcel Apfelbaum <marcel@redhat.com> wrote:
> Use current machine properties instead of querying machine's opts.
>
> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
>
> v1 -> v2:
> - Use the current machine also for dtb
> - Remove the machine_opts from main completely
>
> vl.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index d4a8661..c8bc4bf 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2991,7 +2991,7 @@ int main(int argc, char **argv, char **envp)
> const char *boot_once = NULL;
> DisplayState *ds;
> int cyls, heads, secs, translation;
> - QemuOpts *hda_opts = NULL, *opts, *machine_opts, *icount_opts = NULL;
> + QemuOpts *hda_opts = NULL, *opts, *icount_opts = NULL;
> QemuOptsList *olist;
> int optind;
> const char *optarg;
> @@ -4339,9 +4339,8 @@ int main(int argc, char **argv, char **envp)
> exit(0);
> }
>
> - machine_opts = qemu_get_machine_opts();
> - if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
> - NULL)) {
> + if (qemu_opt_foreach(qemu_get_machine_opts(), machine_set_property,
> + current_machine, NULL)) {
> object_unref(OBJECT(current_machine));
> exit(1);
> }
> @@ -4352,11 +4351,10 @@ int main(int argc, char **argv, char **envp)
> qtest_init(qtest_chrdev, qtest_log, &error_fatal);
> }
>
> - machine_opts = qemu_get_machine_opts();
> - kernel_filename = qemu_opt_get(machine_opts, "kernel");
> - initrd_filename = qemu_opt_get(machine_opts, "initrd");
> - kernel_cmdline = qemu_opt_get(machine_opts, "append");
> - bios_name = qemu_opt_get(machine_opts, "firmware");
> + kernel_filename = current_machine->kernel_filename;
> + initrd_filename = current_machine->initrd_filename;
> + kernel_cmdline = current_machine->kernel_cmdline;
> + bios_name = current_machine->firmware;
>
> opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
> if (opts) {
> @@ -4395,7 +4393,7 @@ int main(int argc, char **argv, char **envp)
> exit(1);
> }
>
> - if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
> + if (!linux_boot && current_machine->dtb) {
> error_report("-dtb only allowed with -kernel option");
> exit(1);
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-08 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 12:15 [Qemu-devel] [PATCH V2] vl.c: remove machine_opts from main and the duplicate call to qemu_get_machine_opts Marcel Apfelbaum
2016-02-08 14:07 ` Igor Mammedov
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).