yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
0a122b
From 5129a1337bbbac935b8d17205eb9131645fc5831 Mon Sep 17 00:00:00 2001
0a122b
From: Gerd Hoffmann <kraxel@redhat.com>
0a122b
Date: Thu, 16 Jan 2014 09:31:58 -0500
0a122b
Subject: [PATCH 08/14] add firmware to machine options
0a122b
0a122b
Message-id: <1389864720-14128-2-git-send-email-kraxel@redhat.com>
0a122b
Patchwork-id: 56739
0a122b
O-Subject: [RHEL-7 qemu-kvm PATCH 1/3] add firmware to machine options
0a122b
Bugzilla: 1038603
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
0a122b
This patch adds firmware to the machine options.  -bios <file> becomes a
0a122b
shortcut for -machine firmware=<file>.  Advantage is that the firmware
0a122b
can be specified via config file as -machine is parsed using QemuOpts
0a122b
and it is also possible to use different defaults for different
0a122b
machine types (via QEMUMachine->default_machine_opts).
0a122b
0a122b
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
0a122b
(cherry picked from commit 1442d3e6912d7ec88480099503cfa0aeaedf5634)
0a122b
---
0a122b
 vl.c | 7 ++++++-
0a122b
 1 file changed, 6 insertions(+), 1 deletion(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 vl.c | 7 ++++++-
0a122b
 1 file changed, 6 insertions(+), 1 deletion(-)
0a122b
0a122b
diff --git a/vl.c b/vl.c
0a122b
index 5aea00c..b70d107 100644
0a122b
--- a/vl.c
0a122b
+++ b/vl.c
0a122b
@@ -428,6 +428,10 @@ static QemuOptsList qemu_machine_opts = {
0a122b
             .name = "usb",
0a122b
             .type = QEMU_OPT_BOOL,
0a122b
             .help = "Set on/off to enable/disable usb",
0a122b
+        },{
0a122b
+            .name = "firmware",
0a122b
+            .type = QEMU_OPT_STRING,
0a122b
+            .help = "firmware image",
0a122b
         },
0a122b
         { /* End of list */ }
0a122b
     },
0a122b
@@ -3204,7 +3208,7 @@ int main(int argc, char **argv, char **envp)
0a122b
                 }
0a122b
                 break;
0a122b
             case QEMU_OPTION_bios:
0a122b
-                bios_name = optarg;
0a122b
+                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg);
0a122b
                 break;
0a122b
             case QEMU_OPTION_singlestep:
0a122b
                 singlestep = 1;
0a122b
@@ -4035,6 +4039,7 @@ int main(int argc, char **argv, char **envp)
0a122b
     kernel_filename = qemu_opt_get(machine_opts, "kernel");
0a122b
     initrd_filename = qemu_opt_get(machine_opts, "initrd");
0a122b
     kernel_cmdline = qemu_opt_get(machine_opts, "append");
0a122b
+    bios_name = qemu_opt_get(machine_opts, "firmware");
0a122b
 
0a122b
     if (!boot_order) {
0a122b
         boot_order = machine->boot_order;
0a122b
-- 
0a122b
1.8.3.1
0a122b