qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Make -kernel command line option optional
@ 2013-10-18 18:42 Roy Franz
  2013-10-19  9:45 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Roy Franz @ 2013-10-18 18:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: grant.likely, peter.maydell, Roy Franz, patches

From: Grant Likely <grant.likely@linaro.org>

The kernel parameter is not used when booting using firmware
such as UEFI.  The firmware image is supplied with the -pflash
parameter, and the -kernel parameter should not be required since
the kernel will be loaded by the firmware.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
---
 hw/arm/boot.c |   47 ++++++++++++++++++++++-------------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 1e313af..66a057d 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -352,12 +352,6 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
     hwaddr entry;
     int big_endian;
 
-    /* Load the kernel.  */
-    if (!info->kernel_filename) {
-        fprintf(stderr, "Kernel image must be specified\n");
-        exit(1);
-    }
-
     info->dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
 
     if (!info->secondary_cpu_reset_hook) {
@@ -389,26 +383,29 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
     info->initrd_start = info->loader_start +
         MIN(info->ram_size / 2, 128 * 1024 * 1024);
 
-    /* Assume that raw images are linux kernels, and ELF images are not.  */
-    kernel_size = load_elf(info->kernel_filename, NULL, NULL, &elf_entry,
-                           NULL, NULL, big_endian, ELF_MACHINE, 1);
-    entry = elf_entry;
-    if (kernel_size < 0) {
-        kernel_size = load_uimage(info->kernel_filename, &entry, NULL,
-                                  &is_linux);
-    }
-    if (kernel_size < 0) {
-        entry = info->loader_start + KERNEL_LOAD_ADDR;
-        kernel_size = load_image_targphys(info->kernel_filename, entry,
-                                          info->ram_size - KERNEL_LOAD_ADDR);
-        is_linux = 1;
-    }
-    if (kernel_size < 0) {
-        fprintf(stderr, "qemu: could not load kernel '%s'\n",
-                info->kernel_filename);
-        exit(1);
+    if (info->kernel_filename) {
+        /* Assume that raw images are linux kernels, and ELF images are not.  */
+        kernel_size = load_elf(info->kernel_filename, NULL, NULL, &elf_entry,
+                               NULL, NULL, big_endian, ELF_MACHINE, 1);
+        entry = elf_entry;
+        if (kernel_size < 0) {
+            kernel_size = load_uimage(info->kernel_filename, &entry, NULL,
+                                      &is_linux);
+        }
+        if (kernel_size < 0) {
+            entry = info->loader_start + KERNEL_LOAD_ADDR;
+            kernel_size = load_image_targphys(info->kernel_filename, entry,
+                                              info->ram_size - KERNEL_LOAD_ADDR);
+            is_linux = 1;
+        }
+        if (kernel_size < 0) {
+            fprintf(stderr, "qemu: could not load kernel '%s'\n",
+                    info->kernel_filename);
+            exit(1);
+        }
+        info->entry = entry;
     }
-    info->entry = entry;
+
     if (is_linux) {
         if (info->initrd_filename) {
             initrd_size = load_ramdisk(info->initrd_filename,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] Make -kernel command line option optional
  2013-10-18 18:42 [Qemu-devel] [PATCH] Make -kernel command line option optional Roy Franz
@ 2013-10-19  9:45 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2013-10-19  9:45 UTC (permalink / raw)
  To: Roy Franz; +Cc: Grant Likely, QEMU Developers, Patch Tracking

On 18 October 2013 19:42, Roy Franz <roy.franz@linaro.org> wrote:
> From: Grant Likely <grant.likely@linaro.org>
>
> The kernel parameter is not used when booting using firmware
> such as UEFI.  The firmware image is supplied with the -pflash
> parameter, and the -kernel parameter should not be required since
> the kernel will be loaded by the firmware.

I already have a patch to do this queued, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-19  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 18:42 [Qemu-devel] [PATCH] Make -kernel command line option optional Roy Franz
2013-10-19  9:45 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).