]> git.proxmox.com Git - mirror_qemu.git/commit - python/qemu/machine/console_socket.py
python/qemu: Add ConsoleSocket for optional use in QEMUMachine
authorRobert Foley <robert.foley@linaro.org>
Wed, 1 Jul 2020 13:56:24 +0000 (14:56 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Sat, 11 Jul 2020 14:53:00 +0000 (15:53 +0100)
commit0fc8f660c5c0d7b4513805f4798e97e4c371e486
tree6746a8c269a2fdae2d4a8a3dbcd46e0512c6a7cf
parentdf00168039c8a58db3c33456db2c00da51043ee2
python/qemu: Add ConsoleSocket for optional use in QEMUMachine

We add the ConsoleSocket object, which has a socket interface
and which will consume all arriving characters on the
socket, placing them into an in memory buffer.
This will also provide those chars via recv() as
would a regular socket.
ConsoleSocket also has the option of dumping
the console bytes to a log file.

We also give QEMUMachine the option of using ConsoleSocket
to drain and to use for logging console to a file.
By default QEMUMachine does not use ConsoleSocket.

This is added in preparation for use by basevm.py in a later commit.
This is a workaround we found was needed for basevm.py since
there is a known issue where QEMU will hang waiting
for console characters to be consumed.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200601211421.1277-9-robert.foley@linaro.org>
Message-Id: <20200701135652.1366-13-alex.bennee@linaro.org>
python/qemu/console_socket.py [new file with mode: 0644]
python/qemu/machine.py