feat(qemu): add mtda-cli firmware command to switch boot firmware - #601
Open
chombourger wants to merge 1 commit into
Open
feat(qemu): add mtda-cli firmware command to switch boot firmware#601chombourger wants to merge 1 commit into
chombourger wants to merge 1 commit into
Conversation
chombourger
force-pushed
the
feat/qemu-legacy-firmware
branch
from
July 24, 2026 08:35
0a2b9b5 to
537be5f
Compare
chombourger
force-pushed
the
feat/qemu-legacy-firmware
branch
from
July 24, 2026 08:37
537be5f to
36188b4
Compare
fmoessbauer
reviewed
Jul 24, 2026
Add "mtda-cli firmware [efi|legacy]" to query or switch the boot firmware used by the qemu power controller, between OVMF (EFI) and SeaBIOS (legacy). Querying with no argument returns the current mode; other power controllers report "not supported". Config gains optional [efi] and [legacy] sections under [power] to point at OVMF pflash files or a custom legacy BIOS image; flat pflash_ro/pflash_rw/bios keys directly under [power] keep working for backward compatibility. The active mode is persisted across mtda-agent restarts in /var/lib/mtda/qemu-firmware and defaults to efi unless only [legacy] is configured (overridable via [firmware] default=). Switching modes while qemu is already running restarts the qemu process itself so the new firmware takes effect immediately. Internal drives now get an explicit bootindex (0, 1, ...) instead of none at all: without one, OVMF's BootOrder ends up empty and it drops to the EFI shell instead of booting them. Hot-plugged USB storage (e.g. an installer image) keeps a higher bootindex (100+) so it never preempts internal storage; picking it instead requires going through the firmware's own boot menu, which "-boot menu=on" now enables for both firmwares. Restarting qemu for a firmware switch also unlinks and recreates its serial pipes, so an already-attached console needs to be closed and reopened around the restart or it's left on a stale fifo; fixed console.qemu.close(), which used to be a no-op, to actually release its file handles. Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
chombourger
force-pushed
the
feat/qemu-legacy-firmware
branch
from
July 26, 2026 09:26
36188b4 to
87fd3b0
Compare
Collaborator
Author
|
found an issue with consoles not being re-attached to the new qemu/kvm instance on restart. fixed now. |
Collaborator
Author
|
Proposing to rebase this MR after #603 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "mtda-cli firmware [efi|legacy]" to query or switch the boot firmware used by the qemu power controller, between OVMF (EFI) and SeaBIOS (legacy). Querying with no argument returns the current mode; other power controllers report "not supported".
Config gains optional [efi] and [legacy] sections under [power] to point at OVMF pflash files or a custom legacy BIOS image; flat pflash_ro/pflash_rw/bios keys directly under [power] keep working for backward compatibility. The active mode is persisted across mtda-agent restarts in /var/lib/mtda/qemu-firmware and defaults to efi unless only [legacy] is configured (overridable via [firmware] default=). Switching modes while qemu is already running restarts the qemu process itself so the new firmware takes effect immediately.