qemu.machine.console_socket module¶
QEMU Console Socket Module:
This python module implements a ConsoleSocket object, which can drain a socket and optionally dump the bytes to file.
- class qemu.machine.console_socket.ConsoleSocket(address: str, file: Optional[str] = None, drain: bool = False)[source]¶
Bases:
socket.socket
ConsoleSocket represents a socket attached to a char device.
Optionally (if drain==True), drains the socket and places the bytes into an in memory buffer for later processing.
Optionally a file path can be passed in and we will also dump the characters to this file for debugging purposes.
- recv(bufsize: int = 1, flags: int = 0) → bytes[source]¶
Return chars from in memory buffer. Maintains the same API as socket.socket.recv.