Blob Blame History Raw
From 5129a1337bbbac935b8d17205eb9131645fc5831 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 16 Jan 2014 09:31:58 -0500
Subject: [PATCH 08/14] add firmware to machine options

Message-id: <1389864720-14128-2-git-send-email-kraxel@redhat.com>
Patchwork-id: 56739
O-Subject: [RHEL-7 qemu-kvm PATCH 1/3] add firmware to machine options
Bugzilla: 1038603
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

This patch adds firmware to the machine options.  -bios <file> becomes a
shortcut for -machine firmware=<file>.  Advantage is that the firmware
can be specified via config file as -machine is parsed using QemuOpts
and it is also possible to use different defaults for different
machine types (via QEMUMachine->default_machine_opts).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 1442d3e6912d7ec88480099503cfa0aeaedf5634)
---
 vl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 vl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index 5aea00c..b70d107 100644
--- a/vl.c
+++ b/vl.c
@@ -428,6 +428,10 @@ static QemuOptsList qemu_machine_opts = {
             .name = "usb",
             .type = QEMU_OPT_BOOL,
             .help = "Set on/off to enable/disable usb",
+        },{
+            .name = "firmware",
+            .type = QEMU_OPT_STRING,
+            .help = "firmware image",
         },
         { /* End of list */ }
     },
@@ -3204,7 +3208,7 @@ int main(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_bios:
-                bios_name = optarg;
+                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg);
                 break;
             case QEMU_OPTION_singlestep:
                 singlestep = 1;
@@ -4035,6 +4039,7 @@ int main(int argc, char **argv, char **envp)
     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");
 
     if (!boot_order) {
         boot_order = machine->boot_order;
-- 
1.8.3.1