Skip to content

fix: treat any HMP reply to set_password as a rejection - #41

Merged
CMGS merged 3 commits into
masterfrom
fix/hmp-reply-check
Sep 3, 2026
Merged

fix: treat any HMP reply to set_password as a rejection#41
CMGS merged 3 commits into
masterfrom
fix/hmp-reply-check

Conversation

@CMGS

@CMGS CMGS commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Seen on hardware while verifying #39: with the whitespace rule absent, set_password vnc ab cd made QEMU print Error: invalid parameter value: cd, setVNCPassword only matched Could not, and the VM booted with password=on, no password set, and vnc_password_set: true in its record. #39's validation closes that input; this closes the check itself, so any HMP error wording is a rejection. The error message stays fixed because the monitor echoes the password. Unit test covers the echo-only reply, the invalid-parameter reply, and the display-inactive reply.

Gates: make lint (darwin, linux) 0 issues, make fmt-check, asl both GOOS, go test ./cmd/vm/.

CMGS added 2 commits September 3, 2026 13:06
QEMU answers a bad password value with "Error: invalid parameter value",
which the "Could not" match let through: the VM came up with password=on
and no password set while the record claimed vnc_password_set. HMP reports
failure only by printing, so any line beyond the echoed command and the
prompt is a rejection. The message stays fixed because the echo carries the
password.
A password of "(qemu)" echoes as the prompt marker, so the reader returned
before QEMU's answer; the marker is now the prompt with its trailing space.
A monitor that closes or times out after the echo no longer counts as
success. The transcript test drives readUntil over a fragmented pipe.
@CMGS
CMGS force-pushed the fix/hmp-reply-check branch from f4ae51c to ffb5ddc Compare September 3, 2026 05:07
The second case reassigned the pipe the first goroutine still closed; each transcript now owns its pipe, which the race detector flagged in CI.
@CMGS
CMGS merged commit 86df6dd into master Sep 3, 2026
3 checks passed
@CMGS
CMGS deleted the fix/hmp-reply-check branch September 3, 2026 05:59
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.

1 participant