qemu.qmp.qemu_ga_client module

QEMU Guest Agent Client

Usage:

Start QEMU with:

# qemu […] -chardev socket,path=/tmp/qga.sock,server,wait=off,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0

Run the script:

$ qemu-ga-client –address=/tmp/qga.sock <command> [args…]

or

$ export QGA_CLIENT_ADDRESS=/tmp/qga.sock $ qemu-ga-client <command> [args…]

For example:

$ qemu-ga-client cat /etc/resolv.conf # Generated by NetworkManager nameserver 10.0.2.3 $ qemu-ga-client fsfreeze status thawed $ qemu-ga-client fsfreeze freeze 2 filesystems frozen

See also: https://wiki.qemu.org/Features/QAPI/GuestAgent

class qemu.qmp.qemu_ga_client.QemuGuestAgent(address: Union[Tuple[str, int], str], server: bool = False, nickname: Optional[str] = None)[source]

Bases: qemu.qmp.QEMUMonitorProtocol

class qemu.qmp.qemu_ga_client.QemuGuestAgentClient(address: Union[Tuple[str, int], str])[source]

Bases: object

fsfreeze(cmd: str)object[source]
fstrim(minimum: int)Dict[str, object][source]
ifconfig()str[source]
info()str[source]
ping(timeout: Optional[float])bool[source]
read(path: str)bytes[source]
shutdown(mode: str = 'powerdown')None[source]
suspend(mode: str)None[source]
sync(timeout: Optional[float] = 3)None[source]
qemu.qmp.qemu_ga_client.main()None[source]
qemu.qmp.qemu_ga_client.send_command(address: str, cmd: str, args: Sequence[str])None[source]