diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-09-05 16:12:10 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2024-12-16 07:31:28 +0100 |
commit | a5bd044b15793ab041102a1e784813f54912a836 (patch) | |
tree | cf2ef1e91c0daad40f6365fb908107eaa430fa7f /hw/core | |
parent | f2594d928444fc4d593117db2da8c9ffa26433f7 (diff) | |
download | qemu-a5bd044b15793ab041102a1e784813f54912a836.zip qemu-a5bd044b15793ab041102a1e784813f54912a836.tar.gz qemu-a5bd044b15793ab041102a1e784813f54912a836.tar.bz2 |
x86/loader: add -shim option
Add new -shim command line option, wire up for the x86 loader.
When specified load shim into the new "etc/boot/shim" fw_cfg file.
Needs OVMF changes too to be actually useful.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20240905141211.1253307-6-kraxel@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/machine.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c index e6900b4..d970f75 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -305,6 +305,21 @@ static void machine_set_kernel(Object *obj, const char *value, Error **errp) ms->kernel_filename = g_strdup(value); } +static char *machine_get_shim(Object *obj, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + return g_strdup(ms->shim_filename); +} + +static void machine_set_shim(Object *obj, const char *value, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + g_free(ms->shim_filename); + ms->shim_filename = g_strdup(value); +} + static char *machine_get_initrd(Object *obj, Error **errp) { MachineState *ms = MACHINE(obj); @@ -1082,6 +1097,11 @@ static void machine_class_init(ObjectClass *oc, void *data) object_class_property_set_description(oc, "kernel", "Linux kernel image file"); + object_class_property_add_str(oc, "shim", + machine_get_shim, machine_set_shim); + object_class_property_set_description(oc, "shim", + "shim.efi file"); + object_class_property_add_str(oc, "initrd", machine_get_initrd, machine_set_initrd); object_class_property_set_description(oc, "initrd", |