vee qmp
Send a QMP (QEMU Machine Protocol) command to a running VM and print the JSON return payload.
vee qmp <name> [command]
QMP is the same control channel vee speaks internally. vee qmp exposes it directly, so you can query or drive QEMU without going through a higher-level vee command.
| Flag | Default | Description |
|---|---|---|
--args | "" | JSON object passed as the command’s QMP arguments |
--raw | false | Emit compact single-line JSON instead of pretty-printed output |
--stdin | false | Read one or more QMP request objects from stdin instead of positional args |
--timeout | 3s | How long to wait for the QMP socket/daemon to respond |
QEMU’s QMP socket accepts only one connected client at a time, and the vee daemon holds that connection for every VM it supervises (to watch for guest SHUTDOWN events).
- Daemon running — the command is routed through the daemon’s control socket (
~/.vee/daemon.sock, owner-only0600); the daemon runs it on the connection it already owns and returns the result. This is the normal path. - No daemon —
vee qmpdials the VM’s QMP socket directly (for a VM started by a standalonevee start).
# Query the QEMU version
vee qmp myvm query-version
# Query VM run state
vee qmp myvm query-status
# Command with arguments
vee qmp myvm device_add --args '{"driver":"virtio-net-pci","id":"net1"}'
# Pipe a full request object
echo '{"execute":"query-block"}' | vee qmp myvm --stdin
# Compact output for scripting
vee qmp myvm query-name --raw
vee qmp does not whitelist commands. human-monitor-command, migrate, and block-device operations can disrupt or destroy a running guest — treat it like direct QEMU monitor access.
See docs/qmp.md for the daemon transport internals.