import os
import subprocess
import shutil
+import signal
import socket
import tempfile
from typing import Optional, Type
self._console_address = None
self._console_socket = None
self._remove_files = []
+ self._user_killed = False
self._console_log_path = console_log
if self._console_log_path:
# In order to log the console, buffering needs to be enabled.
self._remove_if_exists(self._remove_files.pop())
exitcode = self.exitcode()
- if exitcode is not None and exitcode < 0:
+ if (exitcode is not None and exitcode < 0
+ and not (self._user_killed and exitcode == -signal.SIGKILL)):
msg = 'qemu received signal %i; command: "%s"'
if self._qemu_full_args:
command = ' '.join(self._qemu_full_args)
command = ''
LOG.warning(msg, -int(exitcode), command)
+ self._user_killed = False
self._launched = False
def launch(self):
try:
if hard:
+ self._user_killed = True
self._hard_shutdown()
else:
self._do_shutdown(has_quit, timeout=timeout)