All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17
@ 2019-01-17 20:17 Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes Eduardo Habkost
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

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

-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 2/9] scripts: Remove unused python imports Eduardo Habkost
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa, Thomas Huth

From: Thomas Huth <thuth@redhat.com>

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.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1541510826-21031-1-git-send-email-thuth@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 scripts/device-crash-test | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index e93a7c0c84..549162a547 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -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},
 ]
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 2/9] scripts: Remove unused python imports
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 3/9] configure: keep track of Python version Eduardo Habkost
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Alex Bennée, Cleber Rosa, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

Reported-by: LGTM code review
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181108143422.15955-1-philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 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(-)

diff --git a/scripts/analyse-locks-simpletrace.py b/scripts/analyse-locks-simpletrace.py
index 30090bdfff..7d9b574300 100755
--- a/scripts/analyse-locks-simpletrace.py
+++ b/scripts/analyse-locks-simpletrace.py
@@ -7,7 +7,6 @@
 #
 
 from __future__ import print_function
-import os
 import simpletrace
 import argparse
 import numpy as np
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 5c2010c917..e527eb168e 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -23,7 +23,6 @@ import json
 import os
 import argparse
 import collections
-import pprint
 
 def mkdir_p(path):
     try:
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index 4ad34f90cd..45485b864b 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -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
diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index fe2b0771f2..3beaa66bd8 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -15,8 +15,6 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 
 import sys
 import getopt
-import os.path
-import re
 
 from tracetool import error_write, out
 import tracetool.backend
diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/tracetool/format/simpletrace_stap.py
index e7e44842ca..57b04061cf 100644
--- a/scripts/tracetool/format/simpletrace_stap.py
+++ b/scripts/tracetool/format/simpletrace_stap.py
@@ -14,7 +14,7 @@ __email__      = "stefanha@redhat.com"
 
 
 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
 
diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index 549162a547..b32aa93f89 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -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
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 3/9] configure: keep track of Python version
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 2/9] scripts: Remove unused python imports Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 4/9] check-venv: use recorded " Eduardo Habkost
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

From: Cleber Rosa <crosa@redhat.com>

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.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181109150710.31085-2-crosa@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 3eee3fcf70..ca3d407d75 100755
--- a/configure
+++ b/configure
@@ -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
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 4/9] check-venv: use recorded Python version
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (2 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 3/9] configure: keep track of Python version Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 5/9] Travis CI: make specified Python versions usable on jobs Eduardo Habkost
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

From: Cleber Rosa <crosa@redhat.com>

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.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181109150710.31085-3-crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 tests/Makefile.include | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index f403a6571d..f8d4399293 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -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 $@, \
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 5/9] Travis CI: make specified Python versions usable on jobs
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (3 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 4/9] check-venv: use recorded " Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 6/9] check-help: visual and content improvements Eduardo Habkost
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

From: Cleber Rosa <crosa@redhat.com>

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
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181109150710.31085-4-crosa@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
[ehabkost: Now 3.4 is the lowest Python version available]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

fixup! Travis CI: make specified Python versions usable on jobs

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 .travis.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 93fd0164a0..87d9fa971c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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"
 
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 6/9] check-help: visual and content improvements
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (4 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 5/9] Travis CI: make specified Python versions usable on jobs Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 7/9] Acceptance tests: add Linux initrd checking test Eduardo Habkost
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

From: Cleber Rosa <crosa@redhat.com>

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.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181109150710.31085-5-crosa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 tests/Makefile.include | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index f8d4399293..9348451450 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -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"
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 7/9] Acceptance tests: add Linux initrd checking test
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (5 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 6/9] check-help: visual and content improvements Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 8/9] qemu.py: Fix error message when qemu dies from signal Eduardo Habkost
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Alex Bennée, Cleber Rosa, Wainer dos Santos Moschetta

From: Wainer dos Santos Moschetta <wainersm@redhat.com>

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 <lizhijian@cn.fujitsu.com>
	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.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181109182153.5390-1-wainersm@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 tests/acceptance/linux_initrd.py | 48 ++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 tests/acceptance/linux_initrd.py

diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
new file mode 100644
index 0000000000..737355c2ef
--- /dev/null
+++ b/tests/acceptance/linux_initrd.py
@@ -0,0 +1,48 @@
+# Linux initrd acceptance test.
+#
+# Copyright (c) 2018 Red Hat, Inc.
+#
+# Author:
+#  Wainer dos Santos Moschetta <wainersm@redhat.com>
+#
+# 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)
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 8/9] qemu.py: Fix error message when qemu dies from signal
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (6 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 7/9] Acceptance tests: add Linux initrd checking test Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-17 20:17 ` [Qemu-devel] [PULL 9/9] scripts/replay-dump.py: fix utf-8 mangling Eduardo Habkost
  2019-01-18 16:55 ` [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Alex Bennée, Cleber Rosa, Eric Blake, qemu-trivial

From: Eric Blake <eblake@redhat.com>

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.

CC: qemu-trivial@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190111201330.14473-1-eblake@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 scripts/qemu.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index 6e3b0e6771..0a5e02eb56 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -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
 
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 9/9] scripts/replay-dump.py: fix utf-8 mangling
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (7 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 8/9] qemu.py: Fix error message when qemu dies from signal Eduardo Habkost
@ 2019-01-17 20:17 ` Eduardo Habkost
  2019-01-18 16:55 ` [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2019-01-17 20:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Alex Bennée, Cleber Rosa

From: Alex Bennée <alex.bennee@linaro.org>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20190117153338.11820-1-alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 scripts/replay-dump.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py
index 5ae77c8a92..ee7fda2638 100755
--- a/scripts/replay-dump.py
+++ b/scripts/replay-dump.py
@@ -3,7 +3,7 @@
 #
 # Dump the contents of a recorded execution stream
 #
-#  Copyright (c) 2017 Alex Bennée <alex.bennee@linaro.org>
+#  Copyright (c) 2017 Alex Bennée <alex.bennee@linaro.org>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
-- 
2.18.0.rc1.1.g3f1ff2140

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17
  2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
                   ` (8 preceding siblings ...)
  2019-01-17 20:17 ` [Qemu-devel] [PULL 9/9] scripts/replay-dump.py: fix utf-8 mangling Eduardo Habkost
@ 2019-01-18 16:55 ` Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2019-01-18 16:55 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: QEMU Developers, Alex Bennée, Cleber Rosa

On Thu, 17 Jan 2019 at 20:17, Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> 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
>
> ----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-18 16:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 20:17 [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 1/9] scripts/device-crash-test: Remove known crashes Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 2/9] scripts: Remove unused python imports Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 3/9] configure: keep track of Python version Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 4/9] check-venv: use recorded " Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 5/9] Travis CI: make specified Python versions usable on jobs Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 6/9] check-help: visual and content improvements Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 7/9] Acceptance tests: add Linux initrd checking test Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 8/9] qemu.py: Fix error message when qemu dies from signal Eduardo Habkost
2019-01-17 20:17 ` [Qemu-devel] [PULL 9/9] scripts/replay-dump.py: fix utf-8 mangling Eduardo Habkost
2019-01-18 16:55 ` [Qemu-devel] [PULL 0/9] Python queue, 2019-01-17 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.