|
@@ -277,10 +277,6 @@ def _post_shutdown(self):
|
|
|
|
|
|
self._qemu_log_path = None
|
|
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:
|
|
if self._temp_dir is not None:
|
|
shutil.rmtree(self._temp_dir)
|
|
shutil.rmtree(self._temp_dir)
|
|
self._temp_dir = None
|
|
self._temp_dir = None
|
|
@@ -342,6 +338,13 @@ def shutdown(self, has_quit=False):
|
|
"""
|
|
"""
|
|
Terminate the VM and clean up
|
|
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():
|
|
if self.is_running():
|
|
try:
|
|
try:
|
|
if not has_quit:
|
|
if not has_quit:
|