Boxwright.Qmp
0.3.0
dotnet add package Boxwright.Qmp --version 0.3.0
NuGet\Install-Package Boxwright.Qmp -Version 0.3.0
<PackageReference Include="Boxwright.Qmp" Version="0.3.0" />
<PackageVersion Include="Boxwright.Qmp" Version="0.3.0" />
<PackageReference Include="Boxwright.Qmp" />
paket add Boxwright.Qmp --version 0.3.0
#r "nuget: Boxwright.Qmp, 0.3.0"
#:package Boxwright.Qmp@0.3.0
#addin nuget:?package=Boxwright.Qmp&version=0.3.0
#tool nuget:?package=Boxwright.Qmp&version=0.3.0
Boxwright.Qmp
A small, dependency-free C# client for the QEMU Machine Protocol (QMP) and the
QEMU Guest Agent (QGA). It talks to a running qemu-system-* over a TCP or
Unix-domain socket — connect, run correlated commands, observe events — using only
System.Text.Json and the base class library (no third-party packages, no UI framework).
It's the protocol layer of Boxwright, a cross-platform QEMU GUI, and is designed to stand on its own.
Install
dotnet add package Boxwright.Qmp
QMP — connect and run a command
using System.Text.Json;
using Boxwright.Qmp;
await using var client = new QmpClient();
// Performs the greeting + qmp_capabilities handshake.
await client.ConnectAsync(QmpEndpoint.Tcp("127.0.0.1", 4444));
// Correlated request/response.
JsonElement status = await client.ExecuteAsync("query-status");
Console.WriteLine(status.GetProperty("status").GetString()); // e.g. "running"
// Asynchronous events are exposed as IObservable<QmpEvent> on client.Events.
Launch QEMU with a QMP server, e.g.:
qemu-system-x86_64 ... -qmp tcp:127.0.0.1:4444,server,nowait
QEMU Guest Agent
using Boxwright.Qmp;
await using var agent = new QgaClient();
await agent.ConnectAsync("127.0.0.1", 4445);
if (await agent.PingAsync())
{
foreach (string ip in await agent.GetIpAddressesAsync())
Console.WriteLine(ip);
}
Scope
- Connect to a QMP endpoint (TCP or Unix socket) and run the
qmp_capabilitieshandshake. - Send
executecommands with correlated, awaitable replies. - Surface asynchronous QMP events (
SHUTDOWN,RESET,STOP, …) as a stream. - Probe
query-qmp-schemafor capability detection. - A minimal QEMU Guest Agent client (ping, shutdown, guest IP addresses).
Connection retry/policy logic lives in the consuming application, not here. Tested against an in-memory loopback fake server — no live QEMU required.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
0.3.0 — version aligned with the Boxwright 0.3.0 release. No public QMP/QGA API changes since 0.1.0.