[PATCH v2] Report any problems with loading the VGA driver for Macintosh targets

John Arbuckle posted 1 patch 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210830133945.11264-1-programmingkidx@gmail.com
Maintainers: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
hw/ppc/mac_newworld.c | 6 ++++++
hw/ppc/mac_oldworld.c | 6 ++++++
2 files changed, 12 insertions(+)
[PATCH v2] Report any problems with loading the VGA driver for Macintosh targets
Posted by John Arbuckle 2 years, 7 months ago
I was having a problem with missing video resolutions in my Mac OS 9 VM. When I
ran QEMU it gave no indication as to why these resolutions were missing. I found
out that the OpenFirmware VGA driver was not being loaded. To prevent anyone from
going thru the same trouble I went thru I added messages that the user can see
when a problem takes place with loading this driver in the future.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
v2 changes:
- Replaced printf() with warn_report().
- Removed newline characters from messages.

 hw/ppc/mac_newworld.c | 6 ++++++
 hw/ppc/mac_oldworld.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 7bb7ac3997..19a142cfe5 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -526,8 +526,14 @@ static void ppc_core99_init(MachineState *machine)
 
         if (g_file_get_contents(filename, &ndrv_file, &ndrv_size, NULL)) {
             fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size);
+        } else {
+            warn_report("failed to load driver %s. This may cause video"
+                        " problems.", NDRV_VGA_FILENAME);
         }
         g_free(filename);
+    } else {
+        warn_report("driver %s not found. This may cause video problems.",
+                    NDRV_VGA_FILENAME);
     }
 
     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index de2be960e6..041ccebe25 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -367,8 +367,14 @@ static void ppc_heathrow_init(MachineState *machine)
 
         if (g_file_get_contents(filename, &ndrv_file, &ndrv_size, NULL)) {
             fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size);
+        } else {
+            warn_report("failed to load driver %s. This may cause video "
+                        "problems.", NDRV_VGA_FILENAME);
         }
         g_free(filename);
+    } else {
+        warn_report("driver %s not found. This may cause video problems.",
+                    NDRV_VGA_FILENAME);
     }
 
     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
-- 
2.24.3 (Apple Git-128)