qemu-patch-raspberry4/python/qemu/machine
John Snow 1611e6cf4e python/machine: handle "fast" QEMU terminations
In the case that the QEMU process actually launches -- but then dies so
quickly that we can't establish a QMP connection to it -- QEMUMachine
currently calls _post_shutdown() assuming that it never launched the VM
process.

This isn't true, though: it "merely" may have failed to establish a QMP
connection and the process is in the middle of its own exit path.

If we don't wait for the subprocess, the caller may get a bogus `None`
return for .exitcode(). This behavior was observed from
device-crash-test; after the switch to Async QMP, the timings were
changed such that it was now seemingly possible to witness the failure
of "vm.launch()" *prior* to the exitcode becoming available.

The semantic of the `_launched` property is changed in this
patch. Instead of representing the condition "launch() executed
successfully", it will now represent "has forked a child process
successfully". This way, wait() when called in the exit path won't
become a no-op.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-6-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-11-22 18:41:17 -05:00
..
__init__.py python: Fix broken ReST docstrings 2021-06-30 21:57:08 -04:00
console_socket.py python: create qemu packages 2021-06-01 16:21:21 -04:00
machine.py python/machine: handle "fast" QEMU terminations 2021-11-22 18:41:17 -05:00
py.typed python: expose typing information via PEP 561 2021-06-30 21:54:04 -04:00
qtest.py python, iotests: remove socket_scm_helper 2021-10-12 12:22:11 -04:00
README.rst tests/acceptance: rename tests acceptance to tests avocado 2021-11-08 17:00:22 +01:00

qemu.machine package
====================

This package provides core utilities used for testing and debugging
QEMU. It is used by the iotests, vm tests, avocado tests, and several
other utilities in the ./scripts directory. It is not a fully-fledged
SDK and it is subject to change at any time.

See the documentation in ``__init__.py`` for more information.