diff mbox

[v2,04/14] cmdline: implement -bios with QemuOpts

Message ID 1334180081-6172-5-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini April 11, 2012, 9:34 p.m. UTC
This becomes -machine bios.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-config.c |    4 ++++
 vl.c          |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/qemu-config.c b/qemu-config.c
index 3a313de..89706df 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -563,6 +563,10 @@  static QemuOptsList qemu_machine_opts = {
             .type = QEMU_OPT_BOOL,
             .help = "start machine immediately",
         }, {
+            .name = "bios",
+            .type = QEMU_OPT_STRING,
+            .help = "BIOS/firmware file",
+        }, {
             .name = "kernel_irqchip",
             .type = QEMU_OPT_BOOL,
             .help = "use KVM in-kernel irqchip",
diff --git a/vl.c b/vl.c
index 9d48f17..eb0eee7 100644
--- a/vl.c
+++ b/vl.c
@@ -2672,7 +2672,7 @@  int main(int argc, char **argv, char **envp)
                 data_dir = optarg;
                 break;
             case QEMU_OPTION_bios:
-                bios_name = optarg;
+                qemu_opts_set(qemu_find_opts("machine"), 0, "bios", optarg);
                 break;
             case QEMU_OPTION_singlestep:
                 singlestep = 1;
@@ -3308,10 +3308,12 @@  int main(int argc, char **argv, char **envp)
     }
 
     machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
+    bios_name = NULL;
     kernel_filename = initrd_filename = kernel_cmdline = NULL;
     ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
     if (machine_opts) {
         autostart = qemu_opt_get_bool(machine_opts, "autostart", true);
+        bios_name = qemu_opt_get(machine_opts, "bios");
         ram_size = qemu_opt_get_size(machine_opts, "ram_size", ram_size);
         kernel_filename = qemu_opt_get(machine_opts, "kernel");
         initrd_filename = qemu_opt_get(machine_opts, "initrd");