skillfed

qemu.qmp

QEMU Monitor Protocol library

qemu-qmp v0.0.6 455.2K downloads/30d#6,561 on PyPI
Copyleft license Active released

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-qmp

uv

uv add qemu-qmp

poetry

poetry add qemu-qmp

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v2 (GPLv2)License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: System :: EmulatorsTyping :: Typed

Tags

qemu monitor protocol clientqmp library pythonqemu asyncio communicationqemu control scriptingqemu emulator remote controlqmp protocol implementationqemu guest agent interface
qemu-integrationasyncioprotocol-client

More Emulators packages