qemu.qmp
QEMU Monitor Protocol library
What it is and what it does
qemu.qmp is a low-level Python asyncio library that implements the QEMU Monitor Protocol, allowing you to send commands and receive responses from running QEMU emulators and related tools. It does not define or validate commands—you specify exactly what QMP messages to send—making it a protocol transport rather than a high-level SDK. It is designed for QEMU developers, integrators building QEMU into larger systems (like KubeVirt or Kata Containers), and power users who need direct programmatic control over QEMU without the abstraction layers of libvirt or virt-manager.
The library uses Python's asyncio for non-blocking I/O and has no mandatory external dependencies, making it lightweight and easy to embed. It is currently in alpha (0.0.z), meaning the API may change between micro releases; the maintainers plan a 0.1.z beta release once the API stabilizes. It supports modern Python versions (3.8–3.14) and is actively maintained by the QEMU project itself.
Use it for:
- Scripting QEMU emulator control in test infrastructure or CI/CD pipelines without external VM management tools.
- Building custom VM orchestration or monitoring tools that need direct QMP access for specific use cases.
- Integrating QEMU control into larger applications like container runtimes or hypervisor management platforms.
- Querying and manipulating QEMU Guest Agent or Storage Daemon endpoints programmatically.
- Automating complex QEMU workflows (snapshots, migrations, device hotplug) in development or testing environments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python asyncio library for sending QMP (QEMU Monitor Protocol) messages to running QEMU emulators, Guest Agents, Storage Daemons, or other QMP-speaking endpoints.
Yes, if you need programmatic control over QEMU and accept the alpha API stability risk. The library is actively maintained, has no dependencies, installs easily, and is backed by the QEMU project itself. Not suitable if you want a stable, high-level VM management API—use libvirt or virt-manager instead. No known security vulnerabilities.
Install
qemu-qmp on PyPI
pip
pip install qemu-qmpuv
uv add qemu-qmppoetry
poetry add qemu-qmpInstalling qemu.qmp
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained (last release 136 days ago), supports Python 3.8 through 3.14, and marked as alpha (0.0.z versions may have breaking API changes).
License in practice
Dual-licensed under GPLv2 and LGPLv2+. Copyleft terms apply; derivative works and distributions must comply with GPL/LGPL obligations.
Quickstart
pip install qemu.qmp
import asyncio
from qemu.qmp import QMPClient
async def main():
qmp = QMPClient('my-vm')
await qmp.connect('qmp.sock')
res = await qmp.execute('query-status')
print(f"VM status: {res['status']}")
await qmp.disconnect()
asyncio.run(main())
Requires Python 3.8+; QEMU instance must be running with QMP monitor enabled (e.g., -qmp unix:qmp.sock,server=on,wait=off).
Verify before relying
- Whether the library handles reconnection, timeouts, or connection pooling automatically.
- Performance characteristics under high-frequency command execution or event streaming.
- Compatibility with specific QEMU versions or QMP protocol versions beyond the general statement.
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 136 days since the last release |
| First released | |
| Downloads | 455,226/month — #6,561 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: qemu_qmp-0.0.6-py3-none-any.whl
Tags
More Emulators packages
Provides extensions and additional…
unclear · top 15,000 on PyPI
cotCOT edits and deploys Open Virtualization…
permissive · top 15,000 on PyPI
aiormqaiormq is a pure Python AMQP 0.9.1 client…
permissive · top 5,000 on PyPI
pytest-embedded-qemuA pytest plugin that runs embedded system tests…
permissive · top 15,000 on PyPI
libvirt-pythonProvides Python bindings to the libvirt…
copyleft · top 15,000 on PyPI
unicornUnicorn is a Python binding for a lightweight…
permissive · top 5,000 on PyPI
p1monitorAsynchronous Python client library for reading…
permissive · top 15,000 on PyPI
aio-pikaaio-pika is an asyncio-based wrapper around…
permissive · top 5,000 on PyPI
aiomonitorAdds a concurrent monitor and interactive…
permissive · top 15,000 on PyPI
kclikcli is a command-line provisioning and…
unclear · top 15,000 on PyPI
bincopyConverts between binary file formats (Motorola…
permissive · top 15,000 on PyPI
pytest-cppA pytest plugin that discovers and runs C++…
permissive · top 15,000 on PyPI