qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH] Workaround to bypass default qemu boot devices passed


From: Avik Sil
Subject: [Qemu-ppc] [PATCH] Workaround to bypass default qemu boot devices passed to SLOF
Date: Fri, 5 Oct 2012 13:59:08 +0530

Hi David,

Please find below the patch for working around the default boot device issue 
currently being discussed on the list.

Regards,
Avik
---

The default qemu boot_devices string passed to firmware is "cad"
which creates a confusion whether -boot oprion is specified or
not. This patch handles this issue by setting a global flag when
no -boot option is specified.

Signed-off-by: Avik Sil <address@hidden>
---
 hw/spapr.c | 3 ++-
 sysemu.h   | 1 +
 vl.c       | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/spapr.c b/hw/spapr.c
index e6bf522..673bcc8 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -284,7 +284,8 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
 
         _FDT((fdt_property(fdt, "qemu,boot-kernel", &kprop, sizeof(kprop))));
     }
-    _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
+    if (!default_boot_order)
+        _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
     _FDT((fdt_property_cell(fdt, "qemu,graphic-width", graphic_width)));
     _FDT((fdt_property_cell(fdt, "qemu,graphic-height", graphic_height)));
     _FDT((fdt_property_cell(fdt, "qemu,graphic-depth", graphic_depth)));
diff --git a/sysemu.h b/sysemu.h
index 65552ac..f0822b4 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -129,6 +129,7 @@ extern int no_shutdown;
 extern int semihosting_enabled;
 extern int old_param;
 extern int boot_menu;
+extern int default_boot_order;
 extern uint8_t *boot_splash_filedata;
 extern int boot_splash_filedata_size;
 extern uint8_t qemu_extra_params_fw[2];
diff --git a/vl.c b/vl.c
index 48049ef..bf369e6 100644
--- a/vl.c
+++ b/vl.c
@@ -230,6 +230,7 @@ int ctrl_grab = 0;
 unsigned int nb_prom_envs = 0;
 const char *prom_envs[MAX_PROM_ENVS];
 int boot_menu;
+int default_boot_order = 1;
 uint8_t *boot_splash_filedata;
 int boot_splash_filedata_size;
 uint8_t qemu_extra_params_fw[2];
@@ -2668,6 +2669,7 @@ int main(int argc, char **argv, char **envp)
                         qemu_opts_parse(qemu_find_opts("boot-opts"),
                                         optarg, 0);
                     }
+                    default_boot_order = 0;
                 }
                 break;
             case QEMU_OPTION_fda:
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]