fix: treat any HMP reply to set_password as a rejection - #41
Merged
Conversation
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
force-pushed
the
fix/hmp-reply-check
branch
from
September 3, 2026 05:07
f4ae51c to
ffb5ddc
Compare
The second case reassigned the pipe the first goroutine still closed; each transcript now owns its pipe, which the race detector flagged in CI.
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.
Seen on hardware while verifying #39: with the whitespace rule absent,
set_password vnc ab cdmade QEMU printError: invalid parameter value: cd,setVNCPasswordonly matchedCould not, and the VM booted withpassword=on, no password set, andvnc_password_set: truein 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,aslboth GOOS,go test ./cmd/vm/.