[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/16] Python libs: close console sockets before shutting down the
From: |
Cleber Rosa |
Subject: |
[PULL 3/16] Python libs: close console sockets before shutting down the VMs |
Date: |
Mon, 28 Oct 2019 19:49:49 -0400 |
Currently, the console socket on QEMUMachine is closed after the QMP
command to gracefully exit QEMU is executed. Because of a possible
deadlock (QEMU waiting for the socket to become writable) let's close
the console socket earlier.
Reference: <address@hidden>
Reference: https://bugs.launchpad.net/qemu/+bug/1829779
From: Eduardo Habkost <address@hidden>
Signed-off-by: Cleber Rosa <address@hidden>
Message-Id: <address@hidden>
---
python/qemu/machine.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 2024e8b1b1..a4631d6934 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -277,10 +277,6 @@ class QEMUMachine(object):
self._qemu_log_path = None
- if self._console_socket is not None:
- self._console_socket.close()
- self._console_socket = None
-
if self._temp_dir is not None:
shutil.rmtree(self._temp_dir)
self._temp_dir = None
@@ -342,6 +338,13 @@ class QEMUMachine(object):
"""
Terminate the VM and clean up
"""
+ # If we keep the console socket open, we may deadlock waiting
+ # for QEMU to exit, while QEMU is waiting for the socket to
+ # become writeable.
+ if self._console_socket is not None:
+ self._console_socket.close()
+ self._console_socket = None
+
if self.is_running():
try:
if not has_quit:
--
2.21.0
- [PULL 10/16] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p, (continued)
- [PULL 10/16] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p, Cleber Rosa, 2019/10/28
- [PULL 9/16] .travis.yml: Let the avocado job run the Leon3 test, Cleber Rosa, 2019/10/28
- [PULL 8/16] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3, Cleber Rosa, 2019/10/28
- [PULL 6/16] tests/acceptance: Send <carriage return> on serial lines, Cleber Rosa, 2019/10/28
- [PULL 4/16] Acceptance tests: refactor wait_for_console_pattern, Cleber Rosa, 2019/10/28
- [PULL 7/16] tests/acceptance: Refactor exec_command_and_wait_for_pattern(), Cleber Rosa, 2019/10/28
- [PULL 15/16] tests/boot_linux_console: Add initrd test for the Exynos4210, Cleber Rosa, 2019/10/28
- [PULL 1/16] MAINTAINERS: update location of Python libraries, Cleber Rosa, 2019/10/28
- [PULL 5/16] tests/acceptance: Fix wait_for_console_pattern() hangs, Cleber Rosa, 2019/10/28
- [PULL 2/16] Acceptance tests: work around socket dir, Cleber Rosa, 2019/10/28
- [PULL 3/16] Python libs: close console sockets before shutting down the VMs,
Cleber Rosa <=
- [PULL 16/16] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu, Cleber Rosa, 2019/10/28
- Re: [PULL 0/16] Python (acceptance tests) queue, 2019-10-28, Peter Maydell, 2019/10/29