Expand description
qmp - Async-first QEMU/QMP client library.
This crate is designed for:
- QEMU QMP sockets (Unix / TCP)
- PVE / Proxmox scenarios where you want observability and automation without invasive changes
It provides:
- socket connection management (Unix/TCP)
- handshake +
qmp_capabilitiesnegotiation - typed JSON (serde) request/response handling
- subscribable event stream
- per-call timeout and cooperative cancellation
- an optional “safe ops” layer with allow-lists, idempotency, mutex, and retry/backoff
§Quick start (Unix socket)
use qmp::{Client, Endpoint};
let client = Client::connect(Endpoint::unix("/var/run/qemu-server/100.qmp")).await?;
// Low-level (generic) call:
let status: serde_json::Value = client.execute("query-status", Option::<()>::None).await?;
println!("status = {status}");
// Subscribe to events:
let mut events = client.events();
if let Ok(ev) = events.recv().await {
println!("event: {}", ev.name);
}Re-exports§
Modules§
Structs§
- Call
Options - Options for a single command call.
- Cancel
Token - A clonable cancellation token.
- Client
- An async-first QMP client.
- Client
Builder - QMP client builder.
- Connect
Options - Options controlling how the QMP connection is established.
- Event
Stream - A clonable subscription stream of QMP events.
Enums§
- Endpoint
- QMP endpoint.