cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-microblaze-Fix-latent-bug-with-default-DTB-lookup.patch

218e99
From 216010b25271a2814abef68971d672632ddbd122 Mon Sep 17 00:00:00 2001
218e99
From: Markus Armbruster <armbru@redhat.com>
218e99
Date: Tue, 6 Aug 2013 13:17:04 +0200
218e99
Subject: [PATCH 11/28] microblaze: Fix latent bug with default DTB lookup
218e99
218e99
RH-Author: Markus Armbruster <armbru@redhat.com>
218e99
Message-id: <1375795025-28674-6-git-send-email-armbru@redhat.com>
218e99
Patchwork-id: 52994
218e99
O-Subject: [PATCH 7.0 qemu-kvm 5/6] microblaze: Fix latent bug with default DTB lookup
218e99
Bugzilla: 980782
218e99
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
218e99
RH-Acked-by: Michal Novotny <minovotn@redhat.com>
218e99
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
218e99
218e99
microblaze_load_kernel() fails to call
218e99
qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename) when no -machine
218e99
options are given.  This can't normally happen, because -machine
218e99
option kernel is mandatory for this target.  Fix it anyway, by using
218e99
qemu_get_machine_opts().
218e99
218e99
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
218e99
Signed-off-by: Markus Armbruster <armbru@redhat.com>
218e99
Message-id: 1372943363-24081-6-git-send-email-armbru@redhat.com
218e99
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
218e99
(cherry picked from commit 7bccd9402691e712305bc3b5cc6cf2fa1cc27631)
218e99
---
218e99
 hw/microblaze/boot.c | 27 +++++++++++++--------------
218e99
 1 file changed, 13 insertions(+), 14 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 hw/microblaze/boot.c |   27 +++++++++++++--------------
218e99
 1 files changed, 13 insertions(+), 14 deletions(-)
218e99
218e99
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
218e99
index e543d88..f03934b 100644
218e99
--- a/hw/microblaze/boot.c
218e99
+++ b/hw/microblaze/boot.c
218e99
@@ -28,6 +28,7 @@
218e99
 #include "qemu/config-file.h"
218e99
 #include "qemu-common.h"
218e99
 #include "sysemu/device_tree.h"
218e99
+#include "sysemu/sysemu.h"
218e99
 #include "hw/loader.h"
218e99
 #include "elf.h"
218e99
 
218e99
@@ -105,20 +106,18 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
218e99
                             void (*machine_cpu_reset)(MicroBlazeCPU *))
218e99
 {
218e99
     QemuOpts *machine_opts;
218e99
-    const char *kernel_filename = NULL;
218e99
-    const char *kernel_cmdline = NULL;
218e99
-
218e99
-    machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
218e99
-    if (machine_opts) {
218e99
-        const char *dtb_arg;
218e99
-        kernel_filename = qemu_opt_get(machine_opts, "kernel");
218e99
-        kernel_cmdline = qemu_opt_get(machine_opts, "append");
218e99
-        dtb_arg = qemu_opt_get(machine_opts, "dtb");
218e99
-        if (dtb_arg) { /* Preference a -dtb argument */
218e99
-            dtb_filename = dtb_arg;
218e99
-        } else { /* default to pcbios dtb as passed by machine_init */
218e99
-            dtb_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
218e99
-        }
218e99
+    const char *kernel_filename;
218e99
+    const char *kernel_cmdline;
218e99
+    const char *dtb_arg;
218e99
+
218e99
+    machine_opts = qemu_get_machine_opts();
218e99
+    kernel_filename = qemu_opt_get(machine_opts, "kernel");
218e99
+    kernel_cmdline = qemu_opt_get(machine_opts, "append");
218e99
+    dtb_arg = qemu_opt_get(machine_opts, "dtb");
218e99
+    if (dtb_arg) { /* Preference a -dtb argument */
218e99
+        dtb_filename = dtb_arg;
218e99
+    } else { /* default to pcbios dtb as passed by machine_init */
218e99
+        dtb_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
218e99
     }
218e99
 
218e99
     boot_info.machine_cpu_reset = machine_cpu_reset;
218e99
-- 
218e99
1.7.1
218e99