Files
reims-vgpu/scripts/qmp
Anees IqbalandClaude 9b69aca199 ♻️ The dock hover is driven from the host, because the rail with the bug has no compiler
The probe committed at 142661e8 could not run on the only rail that shows the
defect, and its first live run is what said so. Three separate guest-side
dependencies fail on macos-26:

- **There are no command line developer tools**, so `clang` is absent and the
  `hover.c` build step requests an installer dialog instead of compiling. This
  also means `window-drag-probe --motion drag` cannot run there; it works only
  because `reposition` (AppleScript) is its default.
- `screencapture` fails outright — "could not create image from display" — so
  `scripts/lib/guest-display.sh`'s `guest_display_size` returns nothing and the
  probe exited 2 before hovering anything. `wallpaper-probe` and
  `modal-button-probe` share that helper and are expected to fail there too.
- The `osascript` desktop-bounds routes (`Finder`, `System Events`) both return
  empty in a fresh ssh session, which has no Apple Events consent.

So the pointer is now driven by QMP `input-send-event` to the machine's
usb-tablet — from outside the guest, needing no guest tooling, no consent and no
permission, and working identically on all six rails. It is the transport
`vibrancy-latch-probe` already uses. `hover.c` is deleted rather than kept as a
fallback: a second path that only works on five rails is a path that rots.

The consequence worth stating is that this probe **no longer uses ssh at all**.
A guest whose sshd never came up can still be photographed, which matters on a
rail that panics during a third of driven boots.

Adds `qmp.py size`, printing the guest display's dimensions. Sizing is not
capture, which is why it is allowed where `shot` is not: a screendump of the
host-owned window shows the wrong pixels but the DisplaySurface it reads still
carries the right dimensions, and that is all `click`/`move`/`drag` have ever
used it for — as the note in `CAPTURE_DISABLED` already said. Exposing it lets a
host-side probe place a pointer in guest coordinates without asking the guest.
Screenshots still go through the host helper, unchanged.

The hover semantics are preserved: a hover is an arrival followed by rest, so the
probe glides in over six sub-moves and then stops sending events, because
re-asserting the position on a timer restarts the window server's tooltip timer
and the tooltip never appears.

Component: `scripts/dock-hover-probe` and `scripts/qmp`, x86 pathway harness.
No crate code.

Not verified: the rewritten probe has not yet completed a run against a live
guest — the boot that exercises it is next. What is verified is the diagnosis it
is built on, each checked by hand against a live macos-26 guest this session:
`clang` absent, `screencapture` failing with that message, and both osascript
routes empty.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 04:31:50 +03:00
..
2026-07-26 15:24:53 +03:00

qmp.py

One-shot QMP client for the VM's control socket. vm/boot-arm64.sh opens a per-boot socket in vm/guest/run/ plus a stable qmp.sock symlink — the default here; override with QMP_SOCK=/path/to.sock.

The x86 guest rail (vm/boot-x86.sh) puts its per-boot socket + qmp.sock symlink under vm/disks/run/, so the arm default does not apply there — pass QMP_SOCK=vm/disks/run/qmp.sock (the boot script prints the exact path).

Covers both raw QMP commands and GUI input helpers over the machine's built-in usb-kbd + usb-tablet.

Raw QMP

scripts/qmp/qmp.py cmd query-status
scripts/qmp/qmp.py cmd quit
scripts/qmp/qmp.py cmd human-monitor-command '{"command-line":"info usb"}'

GUI helpers

scripts/qmp/qmp.py click 640 480
scripts/qmp/qmp.py click 640 480 --double
scripts/qmp/qmp.py move 100 100
scripts/qmp/qmp.py drag 900 500 400 500 1400 700   # left-button rubber-band drag through points
scripts/qmp/qmp.py key ret                  # qcodes; chords via +
scripts/qmp/qmp.py key meta_l+q
scripts/qmp/qmp.py type 'hello World_123'

Click coordinates are guest display pixels.

Screenshots

Screenshot capture is intentionally handled by the host helpers, not by QMP. qmp.py shot, qmp.py screendump, and qmp.py cmd screendump are blocked so a stale QEMU display surface is not mistaken for the host-owned window.

scripts/screenshot-when-macos-host/screenshot-when-macos-host.sh out.png
scripts/screenshot-when-kde-plasma-host/screenshot-when-kde-plasma-host.sh -o out.png

click / move / drag still size the guest display through QMP internally. They are input helpers, not screenshot helpers.

Why QMP Screenshots Are Blocked

QMP display capture reads QEMU's DisplaySurface. The host-owned window presents through the Rust backend and the compositor, so QMP is the wrong observation surface for screenshots. Use scripts/screenshot-when-macos-host/ on macOS or scripts/screenshot-when-kde-plasma-host/ on KDE Plasma.

Input delivery is unaffected. click / move / drag / key / type ride input-send-event to the guest's usb-kbd + usb-tablet, which is display- independent; they keep working under -display none and the host window. The pointer helpers still use QMP to learn the display geometry, but input delivery itself does not depend on QEMU owning the visible window.