Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From: Deckhouse Virtualization <virtualization@deckhouse.io>
Date: Thu, 3 Apr 2026 00:00:00 +0000
Subject: [PATCH] OvmfPkg: write "no bootable device" event to ISA debugcon port

Write a short diagnostic message to I/O port 0x402 (QEMU isa-debugcon)
when PlatformBootManagerUnableToBoot() is called. This allows external
monitoring tools (e.g. KubeVirt virt-launcher) to detect VM boot
failures via the debugcon socket without requiring a DEBUG build.

Unlike the DEBUG() macro, IoWrite8() is not compiled out in RELEASE
builds, so the message is always emitted regardless of build type.

---
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 14 ++++++++++++++
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 +
2 files changed, 15 insertions(+)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 1234567..abcdefg 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -12,6 +12,7 @@
#include <Protocol/FirmwareVolume2.h>
#include <Protocol/VirtioDevice.h>
#include <Library/PlatformBmPrintScLib.h>
#include <Library/Tcg2PhysicalPresenceLib.h>
#include <Library/XenPlatformLib.h>
+#include <Library/IoLib.h>

@@ -2018,6 +2019,17 @@ PlatformBootManagerUnableToBoot (
EFI_STATUS Status;
EFI_INPUT_KEY Key;
EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;
UINTN Index;

+ //
+ // Write boot failure event to ISA debugcon port (0x402).
+ // Captured by QEMU isa-debugcon device. Works in RELEASE builds
+ // unlike the DEBUG() macro which is compiled out in RELEASE.
+ //
+ {
+ CONST CHAR8 *DebugMsg = "BdsDxe: No bootable option or device was found.\r\n";
+
+ while (*DebugMsg != '\0') {
+ IoWrite8 (0x402, (UINT8)*DebugMsg++);
+ }
+ }
+
if (FeaturePcdGet (PcdBootRestrictToFirmware)) {
AsciiPrint (
"%a: No bootable option was found.\n",
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 1234567..abcdefg 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -43,6 +43,7 @@
DevicePathLib
PciLib
+ IoLib
NvVarsFileLib
QemuFwCfgLib
QemuFwCfgS3Lib
13 changes: 13 additions & 0 deletions images/edk2/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ git:
stageDependencies:
install:
- '*.bin'
- add: {{ .ModuleDir }}/images/{{ .ImageName }}/patches
to: /src/patches
includePaths:
- '*.patch'
stageDependencies:
install:
- '*.patch'
secrets:
- id: SOURCE_REPO
value: {{ $.SOURCE_REPO_GIT }}
Expand Down Expand Up @@ -90,6 +97,12 @@ shell:
submodule update --init --recursive --depth=1
fi

echo "Applying custom patches..."
for p in /src/patches/*.patch; do
echo "Applying $p ..."
git apply "$p"
done

---

image: {{ .ModuleNamePrefix }}{{ .ImageName }}
Expand Down
3 changes: 2 additions & 1 deletion images/virt-artifact/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ shell:
install:
- |
echo "Git clone {{ $gitRepoName }} repository..."
git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt
echo "kek2"
git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v1.6.2-virtualization-no-bootable /src/kubevirt

rm -rf /src/kubevirt/.git

Expand Down
Loading