Python queue, 2019-01-17
The following changes since commit 681d61362d3f766a00806b89d6581869041f73cb:
Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging (2019-01-17 12:48:42 +0000)
are available in the Git repository at:
git://github.com/ehabkost/qemu.git tags/python-next-pull-request
for you to fetch changes up to 49ebe9b15876f3ce9a5f45cb53a16b6a788d65fd:
scripts/replay-dump.py: fix utf-8 mangling (2019-01-17 17:52:40 -0200)
----------------------------------------------------------------
Python queue, 2019-01-17
Fixes:
* Actually test different Python versions on Travis CI
* Fix qemu.py error message when qemu dies from signal
Cleanups:
* Track Python version on config-host.mak
* Remove fixed crashes from scripts/device-crash-test
* Acceptance tests: Linux initrd checking test
* Fix utf-8 mangling at scripts/replay-dump.py
* Remove unused python imports from multiple scripts
----------------------------------------------------------------
Alex Bennée (1):
scripts/replay-dump.py: fix utf-8 mangling
Cleber Rosa (4):
configure: keep track of Python version
check-venv: use recorded Python version
Travis CI: make specified Python versions usable on jobs
check-help: visual and content improvements
Eric Blake (1):
qemu.py: Fix error message when qemu dies from signal
Philippe Mathieu-Daudé (1):
scripts: Remove unused python imports
Thomas Huth (1):
scripts/device-crash-test: Remove known crashes
Wainer dos Santos Moschetta (1):
Acceptance tests: add Linux initrd checking test
configure | 6 ++- scripts/analyse-locks-simpletrace.py | 1 - scripts/analyze-migration.py | 1 - scripts/qemu.py | 2 +- scripts/replay-dump.py | 2 +- scripts/simpletrace.py | 1 - scripts/tracetool.py | 2 - scripts/tracetool/format/simpletrace_stap.py | 2 +- .travis.yml | 4 +- scripts/device-crash-test | 16 ------- tests/Makefile.include | 11 +++-- tests/acceptance/linux_initrd.py | 48 ++++++++++++++++++++ 12 files changed, 65 insertions(+), 31 deletions(-) create mode 100644 tests/acceptance/linux_initrd.py
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes
From: Thomas Huth <[email protected]>
Looks like we've fixed them all already in the past months, e.g. with:
f7d6bfcdc0fe49040aac3ac131a319cb5427957e
spapr_pci: fail gracefully with non-pseries machine types
2363d5ee231bf047479422d56d3b85b7d37a7c23 hw/ppc/spapr_cpu_core: Add a proper check for spapr machine
ef0e8fc768a561dd13a86420b3268f6f3d5d0621
iommu: Don't crash if machine is not PC_MACHINE
8929fc3a55f33a103adddf9cfd010bcf2b255c7d hw/block/pflash_cfi*.c: fix confusing assert fail message
... so we can remove these entries from the ERROR_WHITELIST now.
Message-Id: <[email protected]>
--- scripts/device-crash-test | 15 --------------- 1 file changed, 15 deletions(-)
scripts/device-crash-test +0 -15
@@ -182,21 +182,6 @@ ERROR_WHITELIST = [ # other exitcode=1 failures not listed above will just generate INFO messages: {'exitcode':1, 'loglevel':logging.INFO}, - # KNOWN CRASHES: - # Known crashes will generate error messages, but won't be fatal. - # Those entries must be removed once we fix the crashes. - {'exitcode':-6, 'log':r"Device 'serial0' is in use", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"qemu_net_client_setup: Assertion `!peer->peer' failed", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r'RAMBlock "[\w.-]+" already registered', 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"find_ram_offset: Assertion `size != 0' failed.", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"add_cpreg_to_hashtable: code should not be reached", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"qemu_alloc_display: Assertion `surface->image != NULL' failed", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"Unexpected error in error_set_from_qdev_prop_error", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"Object .* is not an instance of type spapr-machine", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"Object .* is not an instance of type generic-pc-machine", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"Object .* is not an instance of type e500-ccsr", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'log':r"vmstate_register_with_alias_id: Assertion `!se->compat \|\| se->instance_id == 0' failed", 'loglevel':logging.ERROR}, - # everything else (including SIGABRT and SIGSEGV) will be a fatal error: {'exitcode':None, 'fatal':True, 'loglevel':logging.FATAL}, ]
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 2/9] scripts: Remove unused python imports
In reply to Eduardo HabkostFrom: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
--- scripts/analyse-locks-simpletrace.py | 1 - scripts/analyze-migration.py | 1 - scripts/simpletrace.py | 1 - scripts/tracetool.py | 2 -- scripts/tracetool/format/simpletrace_stap.py | 2 +- scripts/device-crash-test | 1 - 6 files changed, 1 insertion(+), 7 deletions(-)
scripts/analyse-locks-simpletrace.py +0 -1
@@ -7,7 +7,6 @@ # from __future__ import print_function -import os import simpletrace import argparse import numpy as np
scripts/analyze-migration.py +0 -1
@@ -23,7 +23,6 @@ import json import os import argparse import collections -import pprint def mkdir_p(path): try:
scripts/simpletrace.py +0 -1
@@ -11,7 +11,6 @@ from __future__ import print_function import struct -import re import inspect from tracetool import read_events, Event from tracetool.backend.simple import is_string
scripts/tracetool.py +0 -2
@@ -15,8 +15,6 @@ __email__ = "[email protected]" import sys import getopt -import os.path -import re from tracetool import error_write, out import tracetool.backend
scripts/tracetool/format/simpletrace_stap.py +1 -1
@@ -14,7 +14,7 @@ __email__ = "[email protected]" from tracetool import out -from tracetool.backend.dtrace import binary, probeprefix +from tracetool.backend.dtrace import probeprefix from tracetool.backend.simple import is_string from tracetool.format.stap import stap_escape
scripts/device-crash-test +0 -1
@@ -26,7 +26,6 @@ check for crashes and unexpected errors. from __future__ import print_function import sys -import os import glob import logging import traceback
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 3/9] configure: keep track of Python version
In reply to Eduardo HabkostFrom: Cleber Rosa <[email protected]>
Some functionality is dependent on the Python version detected/configured on configure. While it's possible to run the Python version later and check for the version, doing it once is preferable. Also, it's a relevant information to keep in build logs, as the overall behavior of the build can be affected by it.
Message-Id: <[email protected]>
--- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
configure +5 -1
@@ -1797,6 +1797,9 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7))'; then "Use --python=/path/to/python to specify a supported Python." fi +# Preserve python version since some functionality is dependent on it +python_version=$($python -V 2>&1 | sed -e 's/Python\ //') + # Suppress writing compiled files python="$python -B"
@@ -6010,7 +6013,7 @@ echo "LDFLAGS $LDFLAGS" echo "QEMU_LDFLAGS $QEMU_LDFLAGS" echo "make $make" echo "install $install" -echo "python $python" +echo "python $python ($python_version)" if test "$slirp" = "yes" ; then echo "smbd $smbd" fi
@@ -6959,6 +6962,7 @@ echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak +echo "PYTHON_VERSION=$python_version" >> $config_host_mak echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=$iasl" >> $config_host_mak
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 4/9] check-venv: use recorded Python version
In reply to Eduardo HabkostFrom: Cleber Rosa <[email protected]>
The current approach works fine, but it runs Python on every make command (even if it's not related to the venv usage).
This is just an optimization, and not a change of behavior.
Message-Id: <[email protected]>
--- tests/Makefile.include | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/Makefile.include +1 -2
@@ -958,8 +958,7 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results # information please refer to "avocado --help". AVOCADO_SHOW=none -PYTHON3 = $(shell $(PYTHON) -c 'import sys; print(1 if sys.version_info >= (3, 0) else 0)') -ifeq ($(PYTHON3), 1) +ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(call quiet-command, \ $(PYTHON) -m venv --system-site-packages $@, \
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 5/9] Travis CI: make specified Python versions usable on jobs
In reply to Eduardo HabkostFrom: Cleber Rosa <[email protected]>
For the two Python jobs, which seem to have the goal of making sure QEMU builds successfully on the 3.0-3.6 spectrum of Python 3 versions, the specified version is only applicable if a Python virtual environment is used. To do that, it's necessary to define the (primary?) language of the job to be Python.
Also, Travis doesn't have a 3.0 Python installation available for the chosen distro, 3.4 being the lower version available.
Reference: https://docs.travis-ci.com/user/languages/python/#specifying-python-versions
Message-Id: <[email protected]>
fixup! Travis CI: make specified Python versions usable on jobs
--- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
.travis.yml +3 -1
@@ -175,12 +175,14 @@ matrix: # Python builds - env: - CONFIG="--target-list=x86_64-softmmu" + language: python python: - - "3.0" + - "3.4" - env: - CONFIG="--target-list=x86_64-softmmu" + language: python python: - "3.6"
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 6/9] check-help: visual and content improvements
In reply to Eduardo HabkostFrom: Cleber Rosa <[email protected]>
The "check" target is not a target that will run all other tests listed, so in order to be accurate it's necessary to list those that will run. The same is true for "check-clean".
Then, to give a better visual impression of the differences in the various targets, let's add empty lines.
Finally, a small (and hopeful) grammar fix from a non-native speaker.
Message-Id: <[email protected]>
--- tests/Makefile.include | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
tests/Makefile.include +5 -3
@@ -3,7 +3,8 @@ check-help: @echo "Regression testing targets:" @echo - @echo " $(MAKE) check Run all tests" + @echo " $(MAKE) check Run unit, qapi-schema, qtest and decodetree" + @echo @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" @echo " $(MAKE) check-unit Run qobject tests"
@@ -12,12 +13,13 @@ check-help: @echo " $(MAKE) check-block Run block tests" @echo " $(MAKE) check-tcg Run TCG tests" @echo " $(MAKE) check-acceptance Run all acceptance (functional) tests" + @echo @echo " $(MAKE) check-report.html Generates an HTML test report" @echo " $(MAKE) check-venv Creates a Python venv for tests" - @echo " $(MAKE) check-clean Clean the tests" + @echo " $(MAKE) check-clean Clean the tests and related data" @echo @echo "Please note that HTML reports do not regenerate if the unit tests" - @echo "has not changed." + @echo "have not changed." @echo @echo "The variable SPEED can be set to control the gtester speed setting." @echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 7/9] Acceptance tests: add Linux initrd checking test
In reply to Eduardo HabkostFrom: Wainer dos Santos Moschetta <[email protected]>
QEMU used to exits with a not accurate error message when an initrd > 2GiB was passed. That was fixed on patch:
commit f3839fda5771596152b75dd1e1a6d050e6e6e380 Author: Li Zhijian <[email protected]> Date: Thu Sep 13 18:07:13 2018 +0800 change get_image_size return type to int64_t
This change adds a regression test for that fix. It starts QEMU with a 2GiB dummy initrd, and checks that it evaluates the file size correctly and prints an accurate message.
Message-Id: <[email protected]>
--- tests/acceptance/linux_initrd.py | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/acceptance/linux_initrd.py
tests/acceptance/linux_initrd.py new file +48 -0
@@ -0,0 +1,48 @@ +# Linux initrd acceptance test. +# +# Copyright (c) 2018 Red Hat, Inc. +# +# Author: +# Wainer dos Santos Moschetta <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import tempfile +from avocado.utils.process import run + +from avocado_qemu import Test + + +class LinuxInitrd(Test): + """ + Checks QEMU evaluates correctly the initrd file passed as -initrd option. + + :avocado: enable + :avocado: tags=x86_64 + """ + + timeout = 60 + + def test_with_2gib_file_should_exit_error_msg(self): + """ + Pretends to boot QEMU with an initrd file with size of 2GiB + and expect it exits with error message. + """ + kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/' + 'Everything/x86_64/os/images/pxeboot/vmlinuz') + kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + max_size = 2 * (1024 ** 3) - 1 + + with tempfile.NamedTemporaryFile() as initrd: + initrd.seek(max_size) + initrd.write(b'\0') + initrd.flush() + cmd = "%s -kernel %s -initrd %s" % (self.qemu_bin, kernel_path, + initrd.name) + res = run(cmd, ignore_status=True) + self.assertEqual(res.exit_status, 1) + expected_msg = r'.*initrd is too large.*max: \d+, need %s.*' % ( + max_size + 1) + self.assertRegex(res.stderr_text, expected_msg)
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 9/9] scripts/replay-dump.py: fix utf-8 mangling
In reply to Eduardo HabkostFrom: Alex Bennée <[email protected]>
Message-Id: <[email protected]>
--- scripts/replay-dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/replay-dump.py +1 -1
@@ -3,7 +3,7 @@ # # Dump the contents of a recorded execution stream # -# Copyright (c) 2017 Alex Bennée <[email protected]> +# Copyright (c) 2017 Alex Bennée <[email protected]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140
[Qemu-devel] [PULL 8/9] qemu.py: Fix error message when qemu dies from signal
In reply to Eduardo HabkostFrom: Eric Blake <[email protected]>
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.
Message-Id: <[email protected]>
--- 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.18.0.rc1.1.g3f1ff2140
Peter Maydell
AppliedQuoted 20 lines · Eduardo Habkost
The following changes since commit
681d61362d3f766a00806b89d6581869041f73cb:Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging (2019-01-17 12:48:42 +0000)
are available in the Git repository at:
git://github.com/ehabkost/qemu.gittags/python-next-pull-requestfor you to fetch changes up to
49ebe9b15876f3ce9a5f45cb53a16b6a788d65fd:
scripts/replay-dump.py: fix utf-8 mangling (2019-01-17 17:52:40 -0200)----------------------------------------------------------------
Python queue, 2019-01-17Fixes:
* Actually test different Python versions on Travis CI
* Fixqemu.pyerror message when qemu dies from signal
Quoted 8 lines
Cleanups:
* Track Python version on config-host.mak
* Remove fixed crashes fromscripts/device-crash-test
* Acceptance tests: Linux initrd checking test
* Fix utf-8 mangling atscripts/replay-dump.py
* Remove unused python imports from multiple scripts----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.
-- PMM