[PATCH 00/18] Allow qtests with --without-default-devices (part 1)

Thomas Huth posted 18 patches 11 months, 3 weeks ago
Failed in applying to current master (apply log)
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Hervé Poussineau" <hpoussin@reactos.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Magnus Damm <magnus.damm@gmail.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
include/hw/boards.h             |  1 +
include/hw/char/parallel.h      |  2 ++
include/hw/i386/pc.h            |  1 -
hw/char/parallel-isa.c          |  2 +-
hw/char/parallel.c              |  1 -
hw/i386/pc.c                    |  3 ++-
hw/i386/pc_piix.c               |  7 ++++--
hw/i386/pc_q35.c                |  8 +++---
hw/isa/isa-superio.c            |  3 ++-
hw/ppc/e500.c                   |  3 ++-
hw/ppc/e500plat.c               |  1 +
hw/ppc/mac_newworld.c           |  4 ++-
hw/ppc/mac_oldworld.c           |  4 ++-
hw/ppc/mpc8544ds.c              |  1 +
hw/ppc/ppc440_bamboo.c          |  4 ++-
hw/ppc/prep.c                   |  4 ++-
hw/s390x/s390-virtio-ccw.c      |  4 ++-
hw/sh4/r2d.c                    |  4 ++-
hw/sparc64/sun4u.c              | 11 ++++++---
softmmu/vl.c                    | 20 ++++++++++++++-
tests/qtest/cdrom-test.c        | 18 +++++++++++---
tests/qtest/device-plug-test.c  |  9 ++++++-
tests/qtest/readconfig-test.c   |  5 +++-
tests/qtest/usb-hcd-uhci-test.c |  5 ++++
tests/qtest/virtio-ccw-test.c   | 43 ++++++++++-----------------------
.gitlab-ci.d/buildtest.yml      |  2 +-
hw/i386/Kconfig                 |  2 +-
tests/qemu-iotests/172          |  2 +-
tests/qtest/meson.build         | 10 +++-----
29 files changed, 118 insertions(+), 66 deletions(-)
[PATCH 00/18] Allow qtests with --without-default-devices (part 1)
Posted by Thomas Huth 11 months, 3 weeks ago
When configuring QEMU with --without-default-devices, many qtests
fail since they run QEMU without "-no-defaults", i.e. the QEMU
binary tries to instantiate a default VGA and a NIC device - which
fails when it has not been enabled in the config.

Here's now my attempt to fix these issues: The basic idea is to
use the default_display and the new default_nic setting in the
MachineClass to determine whether the default device is available
in the binary or not, and in the latter case skip the instantiation.
Some qtests also need some more check for optional devices on top,
but then it's possible to run "make check" for --without-default-devices
builds, too.

This series only tackles with x86 and the targets that are tested
in the "build-without-defaults" gitlab CI pipeline. If these changes
are acceptable, I can continue this cleanup for the other targets,
too.

Thomas Huth (18):
  hw/i386/Kconfig: ISAPC works fine without VGA_ISA
  softmmu/vl.c: Check for the availability of the VGA device before
    using it
  hw: Move the default NIC machine class setting from the x86 to the
    generic one
  softmmu/vl.c: Disable default NIC if it has not been compiled into the
    binary
  hw/ppc: Use MachineClass->default_nic in the ppc machines
  hw/s390x: Use MachineClass->default_nic in the s390x machine
  hw/sh4: Use MachineClass->default_nic in the sh4 r2d machine
  hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file
  hw/i386: Ignore the default parallel port if it has not been compiled
    into QEMU
  hw/sparc64/sun4u: Use MachineClass->default_nic and
    MachineClass->no_parallel
  tests/qtest/readconfig-test: Check for the availability of USB
    controllers
  tests/qtest/usb-hcd-uhci-test: Skip test if UHCI controller is not
    available
  tests/qtest/cdrom-test: Fix the test to also work without optional
    devices
  tests/qtest/virtio-ccw-test: Remove superfluous tests
  tests/qtest: Check for the availability of virtio-ccw devices before
    using them
  tests/qtest/meson.build: Run the net filter tests only with default
    devices
  tests/qemu-iotests/172: Run QEMU with -vga none and -nic none
  .gitlab-ci.d/buildtest.yml: Run full "make check" with
    --without-default-devices

 include/hw/boards.h             |  1 +
 include/hw/char/parallel.h      |  2 ++
 include/hw/i386/pc.h            |  1 -
 hw/char/parallel-isa.c          |  2 +-
 hw/char/parallel.c              |  1 -
 hw/i386/pc.c                    |  3 ++-
 hw/i386/pc_piix.c               |  7 ++++--
 hw/i386/pc_q35.c                |  8 +++---
 hw/isa/isa-superio.c            |  3 ++-
 hw/ppc/e500.c                   |  3 ++-
 hw/ppc/e500plat.c               |  1 +
 hw/ppc/mac_newworld.c           |  4 ++-
 hw/ppc/mac_oldworld.c           |  4 ++-
 hw/ppc/mpc8544ds.c              |  1 +
 hw/ppc/ppc440_bamboo.c          |  4 ++-
 hw/ppc/prep.c                   |  4 ++-
 hw/s390x/s390-virtio-ccw.c      |  4 ++-
 hw/sh4/r2d.c                    |  4 ++-
 hw/sparc64/sun4u.c              | 11 ++++++---
 softmmu/vl.c                    | 20 ++++++++++++++-
 tests/qtest/cdrom-test.c        | 18 +++++++++++---
 tests/qtest/device-plug-test.c  |  9 ++++++-
 tests/qtest/readconfig-test.c   |  5 +++-
 tests/qtest/usb-hcd-uhci-test.c |  5 ++++
 tests/qtest/virtio-ccw-test.c   | 43 ++++++++++-----------------------
 .gitlab-ci.d/buildtest.yml      |  2 +-
 hw/i386/Kconfig                 |  2 +-
 tests/qemu-iotests/172          |  2 +-
 tests/qtest/meson.build         | 10 +++-----
 29 files changed, 118 insertions(+), 66 deletions(-)

-- 
2.31.1