We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5449d93 commit 0858096Copy full SHA for 0858096
python/qemu/machine.py
@@ -277,10 +277,6 @@ def _post_shutdown(self):
277
278
self._qemu_log_path = None
279
280
- if self._console_socket is not None:
281
- self._console_socket.close()
282
- self._console_socket = None
283
-
284
if self._temp_dir is not None:
285
shutil.rmtree(self._temp_dir)
286
self._temp_dir = None
@@ -342,6 +338,13 @@ def shutdown(self, has_quit=False):
342
338
"""
343
339
Terminate the VM and clean up
344
340
341
+ # 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:
345
+ self._console_socket.close()
346
+ self._console_socket = None
347
+
348
if self.is_running():
349
try:
350
if not has_quit:
0 commit comments