[PATCH] hw/i386: Add remedy tip to initrd too large error

Nir Lichtman posted 1 patch 2 days, 17 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/aPuYRU83h0YDg0fK@nirs-laptop.local
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
hw/i386/x86-common.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] hw/i386: Add remedy tip to initrd too large error
Posted by Nir Lichtman 2 days, 17 hours ago
Problem: The current error is very confusing since
the default x86 machine memory size is small and it
gives a sense that there is no way to fix for slightly
larger images.

Solution: Add a remediation tip to the error message.

Signed-off-by: Nir Lichtman <nir@lichtman.org>
---
 hw/i386/x86-common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index 7512be6..4e6c098 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -874,8 +874,9 @@ void x86_load_linux(X86MachineState *x86ms,
         initrd_data = g_mapped_file_get_contents(mapped_file);
         initrd_size = g_mapped_file_get_length(mapped_file);
         if (initrd_size >= initrd_max) {
-            fprintf(stderr, "qemu: initrd is too large, cannot support."
-                    "(max: %"PRIu32", need %"PRId64")\n",
+            fprintf(stderr, "qemu: initrd is too large, try increasing"
+                    " the machine memory with -m."
+                    " (max: %"PRIu32", need %"PRId64")\n",
                     initrd_max, (uint64_t)initrd_size);
             exit(1);
         }
-- 
2.49.1