hw/i386: switch shim loading to load_image_to_fw_cfg_file
Use the new helper function instead of open-coding the shim image load. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260521112806.504961-3-kraxel@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Gerd Hoffmann committed
May 21, 2026 at 13:28 UTC
5ecd98063ec072f3db868467a93577e50c05624e
1 file changed
+2
-13
hw/i386/x86-common.c
+2
-13
@@ -980,19 +980,8 @@ void x86_load_linux(X86MachineState *x86ms,
980
fw_cfg_add_file(fw_cfg, "etc/boot/kernel", kernel, kernel_size);
981
982
if (machine->shim_filename) {
983
- GMappedFile *mapped_file;
984
- GError *gerr = NULL;
985
-
986
- mapped_file = g_mapped_file_new(machine->shim_filename, false, &gerr);
987
- if (!mapped_file) {
988
- fprintf(stderr, "qemu: error reading shim %s: %s\n",
989
- machine->shim_filename, gerr->message);
990
- exit(1);
991
- }
992
-
993
- fw_cfg_add_file(fw_cfg, "etc/boot/shim",
994
- g_mapped_file_get_contents(mapped_file),
995
- g_mapped_file_get_length(mapped_file));
983
+ load_image_to_fw_cfg_file(fw_cfg, "etc/boot/shim",
984
+ machine->shim_filename);
985
}
986
987
if (sev_enabled()) {