qemu.py: Fix error message when qemu dies from signal
PATCH 1/1 qemu.py: Fix error message when qemu dies from signal
When qemu dies from a signal, the python code gets a negative value for exitcode; but signal numbers are positive. Copy the pattern used in qemu-iotests/iotests.py for reporting a positive value.
--- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qemu.py +1 -1
@@ -351,7 +351,7 @@ class QEMUMachine(object): command = ' '.join(self._qemu_full_args) else: command = '' - LOG.warn(msg, exitcode, command) + LOG.warn(msg, -exitcode, command) self._launched = False
Signature · 1 line
2.20.1
Hi Eric,
Quoted 16 lines · Eric Blake
When qemu dies from a signal, the python code gets a negative value for exitcode; but signal numbers are positive. Copy the pattern used in
qemu-iotests/iotests.pyfor reporting a positive value.Signed-off-by Eric Blake <[email protected]>--- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/qemu.py +0
-0
scripts/qemu.py class QEMUMachine(object): · line 354
Quoted 5 lines
scripts/qemu.py +1
-1@@ -351,7 +351,7 @@ class QEMUMachine(object): command = ' '.join(self._qemu_full_args) else: command = '' - LOG.warn(msg, exitcode, command) + LOG.warn(msg, -exitcode, command)
What about displaying signal name directly?
import signal
...
msg = 'qemu received %s: %s'
...
LOG.warn(msg, signal.Signals(-exitcode).name, command)
Quoted 3 lines
scripts/qemu.py +0
-0self._launched = False
Quoted 14 lines · Philippe Mathieu-Daudé
Hi Eric,
Quoted 11 lines · Eric Blake
When qemu dies from a signal, the python code gets a negative value for exitcode; but signal numbers are positive. Copy the pattern used in
qemu-iotests/iotests.pyfor reporting a positive value.Signed-off-by Eric Blake <[email protected]>--- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
scripts/qemu.py class QEMUMachine(object): · line 354
Quoted 10 lines
scripts/qemu.py +1
-1@@ -351,7 +351,7 @@ class QEMUMachine(object): command = ' '.join(self._qemu_full_args) else: command = '' - LOG.warn(msg, exitcode, command) + LOG.warn(msg, -exitcode, command)What about displaying signal name directly?
If you want to do that, it should be a separate patch, and fix iotests.py at the same time.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Quoted 28 lines · Eric Blake
Quoted 14 lines · Philippe Mathieu-Daudé
Hi Eric,
Quoted 11 lines · Eric Blake
When qemu dies from a signal, the python code gets a negative value for exitcode; but signal numbers are positive. Copy the pattern used in
qemu-iotests/iotests.pyfor reporting a positive value.Signed-off-by Eric Blake <[email protected]>--- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 12 lines
scripts/qemu.py class QEMUMachine(object): · line 354
Quoted 10 lines
scripts/qemu.py +1
-1@@ -351,7 +351,7 @@ class QEMUMachine(object): command = ' '.join(self._qemu_full_args) else: command = '' - LOG.warn(msg, exitcode, command) + LOG.warn(msg, -exitcode, command)What about displaying signal name directly?
Quoted 2 lines
If you want to do that, it should be a separate patch, and fix
iotests.pyat the same time.
Fair enough :)