Skip to content

fix(test): place the persist boot overlay next to its backing image - #149

Closed
imlk0 wants to merge 1 commit into
masterfrom
fix-persist-overlay
Closed

imlk0 wants to merge 1 commit into
masterfrom
fix-persist-overlay

Conversation

@imlk0

@imlk0 imlk0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Since the disk-persist regression coverage landed (d83f85b), the fsck-140 rows of test-convert-persist fail on both alinux3 and alinux4 with:

qemu-img: <test>-persist-overlay.qcow2: Could not open 'output.qcow2': No such file or directory
qemu-system-x86_64: -drive file=/diskdir/<test>-persist-overlay.qcow2,...: Could not open '/diskdir/<test>-persist-overlay.qcow2': No such file or directory
[ERROR] Persist boot #1 failed

Root cause

test_qemu_boot_persist_second created the overlay in ${WORKDIR} but referenced the backing image by bare basename:

local overlay="${WORKDIR}/${test_name}-persist-overlay.qcow2"
( cd "${WORKDIR}" && qemu-img create -f qcow2 -F qcow2 -b "output.qcow2" ... >/dev/null )

The output image actually lives in ${WORKDIR}/${test_name}/output.qcow2, so qemu-img create failed to open the backing file. The error was swallowed (>/dev/null, no error check), the overlay was never created, and the first boot then failed on the missing overlay. The "relative backing filename resolves inside the container" mechanism the comment describes never actually worked.

Fix

Create the overlay in the same directory as the output image; the basename backing reference then resolves both at creation time and inside the QEMU boot container (which mounts that directory as /diskdir). Also check the qemu-img create result and fail loudly instead of discarding the error.

Verified locally:

  • old command reproduces the exact CI error (Could not open 'output.qcow2' → overlay not created);
  • new command creates the overlay, and inside ghcr.io/qemus/qemu:7.29 with the directory mounted at /diskdir, qemu-img info resolves the backing to /diskdir/output.qcow2;
  • bash -n + shellcheck -S error clean.

Not addressed here (separate issues)

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

test_qemu_boot_persist_second created its overlay in ${WORKDIR} while
referencing the backing output.qcow2 by basename, but the output image
lives in ${WORKDIR}/${test_name}. qemu-img create therefore failed to
open the backing file (error swallowed by >/dev/null), the overlay was
never created, and the first persist boot died with
"Could not open '<overlay>': No such file or directory" - so both
fsck-140 test-convert-persist rows (alinux3 and alinux4) have been red
since the regression coverage landed.

Create the overlay in the same directory as the output image: the
basename backing reference then resolves both at overlay creation time
and inside the QEMU boot container (which mounts that directory as
/diskdir), matching what the original comment intended. Also fail
loudly when qemu-img create fails instead of discarding the error.

Assisted-by: Claude:glm-5.3
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@imlk0
imlk0 force-pushed the fix-persist-overlay branch from a73895e to 211bc45 Compare October 9, 2026 02:04
@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@imlk0

imlk0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: master 6ce9c51 landed the same fix (overlay created next to the output image, bare-name backing reference, error-checked qemu-img create) independently. Closing this PR as redundant.

@imlk0 imlk0 closed this Oct 9, 2026
@imlk0
imlk0 deleted the fix-persist-overlay branch October 9, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants