[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging] python/machine.py: re-add sigkill warning suppression



commit de6e08b5b987afbaf22e37e7f9e34421fb76ef3f
Author:     John Snow <jsnow@xxxxxxxxxx>
AuthorDate: Fri Jul 10 01:06:48 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: re-add sigkill warning suppression
    
    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@xxxxxxxxxx>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
    Reviewed-by: Cleber Rosa <crosa@xxxxxxxxxx>
    Message-Id: <20200710050649.32434-12-jsnow@xxxxxxxxxx>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
 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 logging
 import os
 import subprocess
 import shutil
+import signal
 import socket
 import tempfile
 from typing import Optional, Type
@@ -133,6 +134,7 @@ class QEMUMachine:
         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 @@ class QEMUMachine:
             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 @@ class QEMUMachine:
                 command = ''
             LOG.warning(msg, -int(exitcode), command)
 
+        self._user_killed = False
         self._launched = False
 
     def launch(self):
@@ -469,6 +473,7 @@ class QEMUMachine:
 
         try:
             if hard:
+                self._user_killed = True
                 self._hard_shutdown()
             else:
                 self._do_shutdown(has_quit, timeout=timeout)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.