[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/19] python/machine.py: re-add sigkill warning suppression
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 12/19] python/machine.py: re-add sigkill warning suppression |
Date: |
Wed, 15 Jul 2020 00:21:25 +0200 |
From: John Snow <jsnow@redhat.com>
If the user kills QEMU on purpose, we don't need to warn
them about that having happened: they know already.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20200710050649.32434-12-jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
python/qemu/machine.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index a955e3f221..736a3c906f 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -22,6 +22,7 @@
import os
import subprocess
import shutil
+import signal
import socket
import tempfile
from typing import Optional, Type
@@ -133,6 +134,7 @@ def __init__(self, binary, args=None, wrapper=None,
name=None,
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.
@@ -327,7 +329,8 @@ def _post_shutdown(self):
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)
@@ -335,6 +338,7 @@ def _post_shutdown(self):
command = ''
LOG.warning(msg, -int(exitcode), command)
+ self._user_killed = False
self._launched = False
def launch(self):
@@ -469,6 +473,7 @@ def shutdown(self, has_quit: bool = False,
try:
if hard:
+ self._user_killed = True
self._hard_shutdown()
else:
self._do_shutdown(has_quit, timeout=timeout)
--
2.21.3
- [PULL 02/19] python/machine.py: consolidate _post_shutdown(), (continued)
- [PULL 02/19] python/machine.py: consolidate _post_shutdown(), Philippe Mathieu-Daudé, 2020/07/14
- [PULL 03/19] python/machine.py: Close QMP socket in cleanup, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 04/19] python/machine.py: Add _early_cleanup hook, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 05/19] python/machine.py: Perform early cleanup for wait() calls, too, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 06/19] python/machine.py: Prohibit multiple shutdown() calls, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 07/19] python/machine.py: Add a configurable timeout to shutdown(), Philippe Mathieu-Daudé, 2020/07/14
- [PULL 08/19] python/machine.py: Make wait() call shutdown(), Philippe Mathieu-Daudé, 2020/07/14
- [PULL 09/19] tests/acceptance: wait() instead of shutdown() where appropriate, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 11/19] python/machine.py: split shutdown into hard and soft flavors, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 10/19] tests/acceptance: Don't test reboot on cubieboard, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 12/19] python/machine.py: re-add sigkill warning suppression,
Philippe Mathieu-Daudé <=
- [PULL 13/19] python/machine.py: change default wait timeout to 3 seconds, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 14/19] python/qmp.py: Define common types, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 15/19] iotests.py: use qemu.qmp type aliases, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 16/19] python/qmp.py: re-absorb MonitorResponseError, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 17/19] python/qmp.py: Do not return None from cmd_obj, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 18/19] python/qmp.py: add casts to JSON deserialization, Philippe Mathieu-Daudé, 2020/07/14
- [PULL 19/19] python/qmp.py: add QMPProtocolError, Philippe Mathieu-Daudé, 2020/07/14
- Re: [PULL 00/19] Python patches for 5.1, Peter Maydell, 2020/07/15