* First batch of fixes to allow "make check" with "--without-default-devices"

* Enable the "bios bits" avocado test in the gitlab-CI
 * Another minor fix for the redundancy DMA blocker code
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmRrVhoRHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbUaiRAApPVveet6WPQ7Ag1448LtqHTGiwl8x2Ba
 jQ7FTKhqdTC5O+/BU7IQkvGmErPxCc8WPB7eoowwBVA/4dr8YIIBLKqO4RtP6LXs
 rtUkzsPI9ExW+iJjIMVOmHsp/shlRhuf+Tmlr8OsTObecCeA4Vbxc+RlvYXfCPhM
 8tOuLO8n6LQY/62fgXSzI5WlLQSzIo3aDSmCeWa1QHkPLf6itvGkwsNBytMJLoUT
 pXZnBNqlXiuyPtloLp+DMfRRkpq8AHB04+Sri7TVPxi7bJL28RMZiaAXpvHSFLz8
 JR2ApRrzBthiLMK1I6A0c2ZGCbVOAi1dhNDNqWCyx8ZBASEJj0XuT/+Qse81sKmG
 zNXr57x0CzWAJ59/taBM2hjUks10rJOmxHJYxS6i1JJR7u1zTuvii7toPMmf35zX
 bM7TYjKpYGa2HneHpw1eOjpTgUYZpgla/pVXZhKqoGdfmseBMlFU424MNl/xDRng
 bxuam3Ku+ClOeQlzXt8aceL/gTApJfvy5FAIAK5yUOQDTs6HjJJL2AfcOzss8kXb
 k6IMHgV1tnLed8B7K4iml2rzvk+RT3CPGvmaNwSAkdh8SnE5/bv1I6s4fHiXMlvC
 mmfvFSoWwdhcsD5r+XOFxfke8sGrOeQIXKefp6UL3hYVV7o2NUe89BytXZCzut/Y
 6ulR25HHtmI=
 =m1Px
 -----END PGP SIGNATURE-----

Merge tag 'pull-request-2023-05-22' of https://gitlab.com/thuth/qemu into staging

* First batch of fixes to allow "make check" with "--without-default-devices"
* Enable the "bios bits" avocado test in the gitlab-CI
* Another minor fix for the redundancy DMA blocker code

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmRrVhoRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbUaiRAApPVveet6WPQ7Ag1448LtqHTGiwl8x2Ba
# jQ7FTKhqdTC5O+/BU7IQkvGmErPxCc8WPB7eoowwBVA/4dr8YIIBLKqO4RtP6LXs
# rtUkzsPI9ExW+iJjIMVOmHsp/shlRhuf+Tmlr8OsTObecCeA4Vbxc+RlvYXfCPhM
# 8tOuLO8n6LQY/62fgXSzI5WlLQSzIo3aDSmCeWa1QHkPLf6itvGkwsNBytMJLoUT
# pXZnBNqlXiuyPtloLp+DMfRRkpq8AHB04+Sri7TVPxi7bJL28RMZiaAXpvHSFLz8
# JR2ApRrzBthiLMK1I6A0c2ZGCbVOAi1dhNDNqWCyx8ZBASEJj0XuT/+Qse81sKmG
# zNXr57x0CzWAJ59/taBM2hjUks10rJOmxHJYxS6i1JJR7u1zTuvii7toPMmf35zX
# bM7TYjKpYGa2HneHpw1eOjpTgUYZpgla/pVXZhKqoGdfmseBMlFU424MNl/xDRng
# bxuam3Ku+ClOeQlzXt8aceL/gTApJfvy5FAIAK5yUOQDTs6HjJJL2AfcOzss8kXb
# k6IMHgV1tnLed8B7K4iml2rzvk+RT3CPGvmaNwSAkdh8SnE5/bv1I6s4fHiXMlvC
# mmfvFSoWwdhcsD5r+XOFxfke8sGrOeQIXKefp6UL3hYVV7o2NUe89BytXZCzut/Y
# 6ulR25HHtmI=
# =m1Px
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 22 May 2023 04:46:34 AM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2023-05-22' of https://gitlab.com/thuth/qemu:
  memory: stricter checks prior to unsetting engaged_in_io
  acpi/tests/avocado/bits: enable bios bits avocado tests on gitlab CI pipeline
  .gitlab-ci.d/buildtest.yml: Run full "make check" with --without-default-devices
  tests/qemu-iotests/172: Run QEMU with -vga none and -nic none
  tests/qtest/meson.build: Run the net filter tests only with default devices
  tests/qtest: Check for the availability of virtio-ccw devices before using them
  tests/qtest/virtio-ccw-test: Remove superfluous tests
  tests/qtest/cdrom-test: Fix the test to also work without optional devices
  tests/qtest/usb-hcd-uhci-test: Skip test if UHCI controller is not available
  tests/qtest/readconfig-test: Check for the availability of USB controllers
  hw/sparc64/sun4u: Use MachineClass->default_nic and MachineClass->no_parallel
  hw/i386: Ignore the default parallel port if it has not been compiled into QEMU
  hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file
  hw/sh4: Use MachineClass->default_nic in the sh4 r2d machine
  hw/s390x: Use MachineClass->default_nic in the s390x machine
  hw/ppc: Use MachineClass->default_nic in the ppc machines
  softmmu/vl.c: Disable default NIC if it has not been compiled into the binary
  hw: Move the default NIC machine class setting from the x86 to the generic one
  softmmu/vl.c: Check for the availability of the VGA device before using it
  hw/i386/Kconfig: ISAPC works fine without VGA_ISA

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2023-05-22 09:06:08 -07:00
commit 37246d54d6
31 changed files with 125 additions and 71 deletions

View File

@ -527,7 +527,7 @@ build-without-defaults:
--disable-strip
TARGETS: avr-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
MAKE_CHECK_ARGS: check-unit check-qtest-avr check-qtest-mips64
MAKE_CHECK_ARGS: check
build-libvhost-user:
extends: .base_job_template

View File

@ -21,7 +21,7 @@ static void parallel_init(ISABus *bus, int index, Chardev *chr)
DeviceState *dev;
ISADevice *isadev;
isadev = isa_new("isa-parallel");
isadev = isa_new(TYPE_ISA_PARALLEL);
dev = DEVICE(isadev);
qdev_prop_set_uint32(dev, "index", index);
qdev_prop_set_chr(dev, "chardev", chr);

View File

@ -93,7 +93,6 @@ typedef struct ParallelState {
PortioList portio_list;
} ParallelState;
#define TYPE_ISA_PARALLEL "isa-parallel"
OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL)
struct ISAParallelState {

View File

@ -80,10 +80,10 @@ config I440FX
config ISAPC
bool
imply VGA_ISA
select ISA_BUS
select PC
select IDE_ISA
select VGA_ISA
# FIXME: it is in the same file as i440fx, and does not compile
# if separated
depends on I440FX

View File

@ -1364,12 +1364,13 @@ void pc_basic_device_init(struct PCMachineState *pcms,
void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)
{
MachineClass *mc = MACHINE_CLASS(pcmc);
int i;
rom_set_order_override(FW_CFG_ORDER_OVERRIDE_NIC);
for (i = 0; i < nb_nics; i++) {
NICInfo *nd = &nd_table[i];
const char *model = nd->model ? nd->model : pcmc->default_nic_model;
const char *model = nd->model ? nd->model : mc->default_nic;
if (g_str_equal(model, "ne2k_isa")) {
pc_init_ne2k_isa(isa_bus, nd);

View File

@ -26,6 +26,7 @@
#include CONFIG_DEVICES
#include "qemu/units.h"
#include "hw/char/parallel.h"
#include "hw/dma/i8257.h"
#include "hw/loader.h"
#include "hw/i386/x86.h"
@ -450,7 +451,6 @@ static void pc_xen_hvm_init(MachineState *machine)
static void pc_i440fx_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pcmc->default_nic_model = "e1000";
pcmc->pci_root_uid = 0;
pcmc->default_cpu_version = 1;
@ -458,6 +458,8 @@ static void pc_i440fx_machine_options(MachineClass *m)
m->desc = "Standard PC (i440FX + PIIX, 1996)";
m->default_machine_opts = "firmware=bios-256k.bin";
m->default_display = "std";
m->default_nic = "e1000";
m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
}
@ -884,8 +886,9 @@ static void isapc_machine_options(MachineClass *m)
pcmc->gigabyte_align = false;
pcmc->smbios_legacy_mode = true;
pcmc->has_reserved_memory = false;
pcmc->default_nic_model = "ne2k_isa";
m->default_nic = "ne2k_isa";
m->default_cpu_type = X86_CPU_TYPE_NAME("486");
m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL);
}
DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,

View File

@ -30,6 +30,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "hw/char/parallel.h"
#include "hw/loader.h"
#include "hw/i2c/smbus_eeprom.h"
#include "hw/rtc/mc146818rtc.h"
@ -356,7 +357,6 @@ static void pc_q35_init(MachineState *machine)
static void pc_q35_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pcmc->default_nic_model = "e1000e";
pcmc->pci_root_uid = 0;
pcmc->default_cpu_version = 1;
@ -365,8 +365,10 @@ static void pc_q35_machine_options(MachineClass *m)
m->units_per_default_bus = 1;
m->default_machine_opts = "firmware=bios-256k.bin";
m->default_display = "std";
m->default_nic = "e1000e";
m->default_kernel_irqchip_split = false;
m->no_floppy = 1;
m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
@ -577,10 +579,8 @@ DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL,
static void pc_q35_2_11_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_q35_2_12_machine_options(m);
pcmc->default_nic_model = "e1000";
m->default_nic = "e1000";
compat_props_add(m->compat_props, hw_compat_2_11, hw_compat_2_11_len);
compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len);
}

View File

@ -16,6 +16,7 @@
#include "qapi/error.h"
#include "sysemu/blockdev.h"
#include "chardev/char.h"
#include "hw/char/parallel.h"
#include "hw/block/fdc.h"
#include "hw/isa/superio.h"
#include "hw/qdev-properties.h"
@ -51,7 +52,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
} else {
name = g_strdup_printf("parallel%d", i);
}
isa = isa_new("isa-parallel");
isa = isa_new(TYPE_ISA_PARALLEL);
d = DEVICE(isa);
qdev_prop_set_uint32(d, "index", i);
if (k->parallel.get_iobase) {

View File

@ -898,6 +898,7 @@ void ppce500_init(MachineState *machine)
MemoryRegion *address_space_mem = get_system_memory();
PPCE500MachineState *pms = PPCE500_MACHINE(machine);
const PPCE500MachineClass *pmc = PPCE500_MACHINE_GET_CLASS(machine);
MachineClass *mc = MACHINE_CLASS(pmc);
PCIBus *pci_bus;
CPUPPCState *env = NULL;
uint64_t loadaddr;
@ -1073,7 +1074,7 @@ void ppce500_init(MachineState *machine)
if (pci_bus) {
/* Register network interfaces. */
for (i = 0; i < nb_nics; i++) {
pci_nic_init_nofail(&nd_table[i], pci_bus, "virtio-net-pci", NULL);
pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
}
}

View File

@ -99,6 +99,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data)
mc->max_cpus = 32;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
mc->default_ram_id = "mpc8544ds.ram";
mc->default_nic = "virtio-net-pci";
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_ETSEC_COMMON);
}

View File

@ -132,6 +132,7 @@ static void ppc_core99_reset(void *opaque)
static void ppc_core99_init(MachineState *machine)
{
Core99MachineState *core99_machine = CORE99_MACHINE(machine);
MachineClass *mc = MACHINE_GET_CLASS(machine);
PowerPCCPU *cpu = NULL;
CPUPPCState *env = NULL;
char *filename;
@ -444,7 +445,7 @@ static void ppc_core99_init(MachineState *machine)
}
for (i = 0; i < nb_nics; i++) {
pci_nic_init_nofail(&nd_table[i], pci_bus, "sungem", NULL);
pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
}
/* The NewWorld NVRAM is not located in the MacIO device */
@ -577,6 +578,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
mc->max_cpus = 1;
mc->default_boot_order = "cd";
mc->default_display = "std";
mc->default_nic = "sungem";
mc->kvm_type = core99_kvm_type;
#ifdef TARGET_PPC64
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1");

View File

@ -87,6 +87,7 @@ static void ppc_heathrow_reset(void *opaque)
static void ppc_heathrow_init(MachineState *machine)
{
const char *bios_name = machine->firmware ?: PROM_FILENAME;
MachineClass *mc = MACHINE_GET_CLASS(machine);
PowerPCCPU *cpu = NULL;
CPUPPCState *env = NULL;
char *filename;
@ -276,7 +277,7 @@ static void ppc_heathrow_init(MachineState *machine)
pci_vga_init(pci_bus);
for (i = 0; i < nb_nics; i++) {
pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
}
/* MacIO IDE */
@ -424,6 +425,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
mc->kvm_type = heathrow_kvm_type;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("750_v3.1");
mc->default_display = "std";
mc->default_nic = "ne2k_pci";
mc->ignore_boot_device_suffixes = true;
mc->default_ram_id = "ppc_heathrow.ram";
fwc->get_dev_path = heathrow_fw_dev_path;

View File

@ -61,6 +61,7 @@ static void mpc8544ds_machine_class_init(ObjectClass *oc, void *data)
mc->max_cpus = 15;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
mc->default_ram_id = "mpc8544ds.ram";
mc->default_nic = "virtio-net-pci";
}
#define TYPE_MPC8544DS_MACHINE MACHINE_TYPE_NAME("mpc8544ds")

View File

@ -161,6 +161,7 @@ static void bamboo_init(MachineState *machine)
{
const char *kernel_filename = machine->kernel_filename;
const char *initrd_filename = machine->initrd_filename;
MachineClass *mc = MACHINE_GET_CLASS(machine);
unsigned int pci_irq_nrs[4] = { 28, 27, 26, 25 };
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *isa = g_new(MemoryRegion, 1);
@ -246,7 +247,7 @@ static void bamboo_init(MachineState *machine)
* There are no PCI NICs on the Bamboo board, but there are
* PCI slots, so we can pick whatever default model we want.
*/
pci_nic_init_nofail(&nd_table[i], pcibus, "e1000", NULL);
pci_nic_init_nofail(&nd_table[i], pcibus, mc->default_nic, NULL);
}
}
@ -296,6 +297,7 @@ static void bamboo_machine_init(MachineClass *mc)
mc->init = bamboo_init;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440epb");
mc->default_ram_id = "ppc4xx.sdram";
mc->default_nic = "e1000";
}
DEFINE_MACHINE("bamboo", bamboo_machine_init)

View File

@ -229,6 +229,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque)
static void ibm_40p_init(MachineState *machine)
{
const char *bios_name = machine->firmware ?: "openbios-ppc";
MachineClass *mc = MACHINE_GET_CLASS(machine);
CPUPPCState *env = NULL;
uint16_t cmos_checksum;
PowerPCCPU *cpu;
@ -323,7 +324,7 @@ static void ibm_40p_init(MachineState *machine)
pci_vga_init(pci_bus);
for (i = 0; i < nb_nics; i++) {
pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet",
pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic,
i == 0 ? "3" : NULL);
}
}
@ -427,6 +428,7 @@ static void ibm_40p_machine_init(MachineClass *mc)
mc->default_boot_order = "c";
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("604");
mc->default_display = "std";
mc->default_nic = "pcnet";
}
DEFINE_MACHINE("40p", ibm_40p_machine_init)

View File

@ -245,6 +245,7 @@ static void s390_create_sclpconsole(const char *type, Chardev *chardev)
static void ccw_init(MachineState *machine)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
int ret;
VirtualCssBus *css_bus;
DeviceState *dev;
@ -292,7 +293,7 @@ static void ccw_init(MachineState *machine)
}
/* Create VirtIO network adapters */
s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
s390_create_virtio_net(BUS(css_bus), mc->default_nic);
/* init consoles */
if (serial_hd(0)) {
@ -746,6 +747,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
hc->unplug_request = s390_machine_device_unplug_request;
nc->nmi_monitor_handler = s390_nmi;
mc->default_ram_id = "s390.ram";
mc->default_nic = "virtio-net-ccw";
object_class_property_add_bool(oc, "aes-key-wrap",
machine_get_aes_key_wrap,

View File

@ -232,6 +232,7 @@ static void r2d_init(MachineState *machine)
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
MachineClass *mc = MACHINE_GET_CLASS(machine);
SuperHCPU *cpu;
CPUSH4State *env;
ResetData *reset_info;
@ -310,7 +311,7 @@ static void r2d_init(MachineState *machine)
/* NIC: rtl8139 on-board, and 2 slots. */
for (i = 0; i < nb_nics; i++)
pci_nic_init_nofail(&nd_table[i], pci_bus,
"rtl8139", i == 0 ? "2" : NULL);
mc->default_nic, i == 0 ? "2" : NULL);
/* USB keyboard */
usb_create_simple(usb_bus_find(-1), "usb-kbd");
@ -375,6 +376,7 @@ static void r2d_machine_init(MachineClass *mc)
mc->init = r2d_init;
mc->block_default_type = IF_IDE;
mc->default_cpu_type = TYPE_SH7751R_CPU;
mc->default_nic = "rtl8139";
}
DEFINE_MACHINE("r2d", r2d_machine_init)

View File

@ -553,6 +553,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
MachineState *machine,
const struct hwdef *hwdef)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
SPARCCPU *cpu;
Nvram *nvram;
unsigned int i;
@ -645,15 +646,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
PCIBus *bus;
nd = &nd_table[i];
if (!nd->model || strcmp(nd->model, "sunhme") == 0) {
if (!nd->model || strcmp(nd->model, mc->default_nic) == 0) {
if (!onboard_nic) {
pci_dev = pci_new_multifunction(PCI_DEVFN(1, 1),
true, "sunhme");
true, mc->default_nic);
bus = pci_busA;
memcpy(&macaddr, &nd->macaddr.a, sizeof(MACAddr));
onboard_nic = true;
} else {
pci_dev = pci_new(-1, "sunhme");
pci_dev = pci_new(-1, mc->default_nic);
bus = pci_busB;
}
} else {
@ -816,6 +817,8 @@ static void sun4u_class_init(ObjectClass *oc, void *data)
mc->default_cpu_type = SPARC_CPU_TYPE_NAME("TI-UltraSparc-IIi");
mc->ignore_boot_device_suffixes = true;
mc->default_display = "std";
mc->default_nic = "sunhme";
mc->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL);
fwc->get_dev_path = sun4u_fw_dev_path;
}
@ -840,6 +843,8 @@ static void sun4v_class_init(ObjectClass *oc, void *data)
mc->default_boot_order = "c";
mc->default_cpu_type = SPARC_CPU_TYPE_NAME("Sun-UltraSparc-T1");
mc->default_display = "std";
mc->default_nic = "sunhme";
mc->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL);
}
static const TypeInfo sun4v_type = {

View File

@ -253,6 +253,7 @@ struct MachineClass {
const char *default_machine_opts;
const char *default_boot_order;
const char *default_display;
const char *default_nic;
GPtrArray *compat_props;
const char *hw_version;
ram_addr_t default_ram_size;

View File

@ -4,6 +4,8 @@
#include "hw/isa/isa.h"
#include "chardev/char.h"
#define TYPE_ISA_PARALLEL "isa-parallel"
void parallel_hds_isa_init(ISABus *bus, int n);
bool parallel_mm_init(MemoryRegion *address_space,

View File

@ -93,7 +93,6 @@ struct PCMachineClass {
/* Device configuration: */
bool pci_enabled;
bool kvmclock_enabled;
const char *default_nic_model;
/* Compat options: */

View File

@ -534,6 +534,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,
unsigned access_size;
unsigned i;
MemTxResult r = MEMTX_OK;
bool reentrancy_guard_applied = false;
if (!access_size_min) {
access_size_min = 1;
@ -552,6 +553,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,
return MEMTX_ACCESS_ERROR;
}
mr->dev->mem_reentrancy_guard.engaged_in_io = true;
reentrancy_guard_applied = true;
}
/* FIXME: support unaligned access? */
@ -568,7 +570,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,
access_mask, attrs);
}
}
if (mr->dev) {
if (mr->dev && reentrancy_guard_applied) {
mr->dev->mem_reentrancy_guard.engaged_in_io = false;
}
return r;

View File

@ -957,7 +957,18 @@ static const char *
get_default_vga_model(const MachineClass *machine_class)
{
if (machine_class->default_display) {
for (int t = 0; t < VGA_TYPE_MAX; t++) {
const VGAInterfaceInfo *ti = &vga_interfaces[t];
if (ti->opt_name && vga_interface_available(t) &&
g_str_equal(ti->opt_name, machine_class->default_display)) {
return machine_class->default_display;
}
}
warn_report_once("Default display '%s' is not available in this binary",
machine_class->default_display);
return NULL;
} else if (vga_interface_available(VGA_CIRRUS)) {
return "cirrus";
} else if (vga_interface_available(VGA_STD)) {
@ -1283,6 +1294,13 @@ static void qemu_disable_default_devices(void)
default_monitor = 0;
default_net = 0;
default_vga = 0;
} else {
if (default_net && machine_class->default_nic &&
!module_object_class_by_name(machine_class->default_nic)) {
warn_report("Default NIC '%s' is not available in this binary",
machine_class->default_nic);
default_net = 0;
}
}
}

View File

@ -123,9 +123,9 @@ class QEMUBitsMachine(QEMUMachine): # pylint: disable=too-few-public-methods
"""return the base argument to QEMU binary"""
return self._base_args
@skipIf(not supported_platform() or missing_deps() or os.getenv('GITLAB_CI'),
'incorrect platform or dependencies (%s) not installed ' \
'or running on GitLab' % ','.join(deps))
@skipIf(not supported_platform() or missing_deps(),
'unsupported platform or dependencies (%s) not installed' \
% ','.join(deps))
class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
"""
ACPI and SMBIOS tests using biosbits.
@ -356,7 +356,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
"""
if self._vm:
self.assertFalse(not self._vm.is_running)
if not os.getenv('BITS_DEBUG'):
if not os.getenv('BITS_DEBUG') and self._workDir:
self.logger.info('removing the work directory %s', self._workDir)
shutil.rmtree(self._workDir)
else:

View File

@ -56,7 +56,7 @@ do_run_qemu()
done
fi
echo quit
) | $QEMU -accel qtest -nographic -monitor stdio -serial none "$@"
) | $QEMU -accel qtest -nographic -monitor stdio -serial none -vga none -nic none "$@"
echo
}

View File

@ -136,9 +136,12 @@ static void add_x86_tests(void)
}
qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot);
if (qtest_has_device("virtio-scsi-ccw")) {
qtest_add_data_func("cdrom/boot/virtio-scsi",
"-device virtio-scsi -device scsi-cd,drive=cdr "
"-blockdev file,node-name=cdr,filename=", test_cdboot);
"-blockdev file,node-name=cdr,filename=",
test_cdboot);
}
/*
* Unstable CI test under load
* See https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg05509.html
@ -183,10 +186,17 @@ static void add_s390x_tests(void)
{
if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
g_test_skip("No KVM or TCG accelerator available, skipping boot tests");
}
if (!qtest_has_device("virtio-blk-ccw")) {
return;
}
qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot);
if (!qtest_has_device("virtio-scsi-ccw")) {
return;
}
qtest_add_data_func("cdrom/boot/virtio-scsi",
"-device virtio-scsi -device scsi-cd,drive=cdr "
"-blockdev file,node-name=cdr,filename=", test_cdboot);

View File

@ -156,7 +156,14 @@ static void test_q35_pci_unplug_json_request(void)
static void test_ccw_unplug(void)
{
QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
QTestState *qtest;
if (!qtest_has_device("virtio-balloon-ccw")) {
g_test_skip("Device virtio-balloon-ccw not available");
return;
}
qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
qtest_qmp_device_del_send(qtest, "dev0");
wait_device_deleted_event(qtest, "dev0");

View File

@ -34,10 +34,12 @@ qtests_pci = \
qtests_cxl = \
(config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
# FIXME: Get rid of get_option('default_devices') here and check
# for the availability of the default NICs in the tests
qtests_filter = \
(slirp.found() ? ['test-netfilter'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
(get_option('default_devices') and slirp.found() ? ['test-netfilter'] : []) + \
(get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
(get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
qtests_i386 = \
(slirp.found() ? ['pxe-test'] : []) + \
@ -221,9 +223,7 @@ qtests_aarch64 = \
'migration-test']
qtests_s390x = \
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
qtests_filter + \
['boot-serial-test',
'drive_del-test',
'device-plug-test',

View File

@ -207,8 +207,11 @@ int main(int argc, char *argv[])
if (g_str_equal(arch, "i386") ||
g_str_equal(arch, "x86_64")) {
qtest_add_func("readconfig/x86/memdev", test_x86_memdev);
if (qtest_has_device("ich9-usb-ehci1") &&
qtest_has_device("ich9-usb-uhci1")) {
qtest_add_func("readconfig/x86/ich9-ehci-uhci", test_docs_config_ich9);
}
}
#if defined(CONFIG_SPICE) && !defined(__FreeBSD__)
qtest_add_func("readconfig/spice", test_spice);
#endif

View File

@ -66,6 +66,11 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
if (!qtest_has_device("piix3-usb-uhci")) {
g_debug("piix3-usb-uhci not available");
return 0;
}
qtest_add_func("/uhci/pci/init", test_uhci_init);
qtest_add_func("/uhci/pci/port1", test_port_1);
qtest_add_func("/uhci/pci/hotplug", test_uhci_hotplug);

View File

@ -17,12 +17,6 @@
#include "libqtest-single.h"
#include "libqos/virtio.h"
static void virtio_balloon_nop(void)
{
global_qtest = qtest_initf("-device virtio-balloon-ccw");
qtest_end();
}
static void virtconsole_nop(void)
{
global_qtest = qtest_initf("-device virtio-serial-ccw,id=vser0 "
@ -53,20 +47,6 @@ static void virtio_serial_hotplug(void)
qtest_quit(qts);
}
static void virtio_blk_nop(void)
{
global_qtest = qtest_initf("-drive if=none,id=drv0,file=null-co://,"
"file.read-zeroes=on,format=raw "
"-device virtio-blk-ccw,drive=drv0");
qtest_end();
}
static void virtio_net_nop(void)
{
global_qtest = qtest_initf("-device virtio-net-ccw");
qtest_end();
}
static void virtio_rng_nop(void)
{
global_qtest = qtest_initf("-device virtio-rng-ccw");
@ -96,16 +76,19 @@ static void virtio_scsi_hotplug(void)
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
qtest_add_func("/virtio/balloon/nop", virtio_balloon_nop);
if (qtest_has_device("virtio-serial-ccw")) {
qtest_add_func("/virtio/console/nop", virtconsole_nop);
qtest_add_func("/virtio/serialport/nop", virtserialport_nop);
qtest_add_func("/virtio/serial/nop", virtio_serial_nop);
qtest_add_func("/virtio/serial/hotplug", virtio_serial_hotplug);
qtest_add_func("/virtio/block/nop", virtio_blk_nop);
qtest_add_func("/virtio/net/nop", virtio_net_nop);
}
if (qtest_has_device("virtio-rng-ccw")) {
qtest_add_func("/virtio/rng/nop", virtio_rng_nop);
}
if (qtest_has_device("virtio-rng-ccw")) {
qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop);
qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug);
}
return g_test_run();
}