-#!/usr/bin/env python2.7
+#!/usr/bin/env python
#
# Copyright (c) 2017 Red Hat Inc
#
Run QEMU with all combinations of -machine and -device types,
check for crashes and unexpected errors.
"""
+from __future__ import print_function
import sys
import os
{'device':'ivshmem', 'expected':True}, # You must specify either 'shm' or 'chardev'
{'device':'ivshmem-doorbell', 'expected':True}, # You must specify a 'chardev'
{'device':'ivshmem-plain', 'expected':True}, # You must specify a 'memdev'
- {'device':'kvm-pci-assign', 'expected':True}, # no host device specified
{'device':'loader', 'expected':True}, # please include valid arguments
{'device':'nand', 'expected':True}, # Unsupported NAND block size 0x1
{'device':'nvdimm', 'expected':True}, # 'memdev' property is not set
{'device':'scsi-generic', 'expected':True}, # drive property not set
{'device':'scsi-hd', 'expected':True}, # drive property not set
{'device':'spapr-pci-host-bridge', 'expected':True}, # BUID not specified for PHB
- {'device':'spapr-pci-vfio-host-bridge', 'expected':True}, # BUID not specified for PHB
{'device':'spapr-rng', 'expected':True}, # spapr-rng needs an RNG backend!
{'device':'spapr-vty', 'expected':True}, # chardev property not set
{'device':'tpm-tis', 'expected':True}, # tpm_tis: backend driver with id (null) could not be found
{'machine':'q35|pc.*', 'device':'kvm-ioapic', 'expected':True}, # Only 1 ioapics allowed
{'machine':'q35|pc.*', 'device':'ioapic', 'expected':True}, # Only 1 ioapics allowed
+ # "spapr-cpu-core needs a pseries machine"
+ {'machine':'(?!pseries).*', 'device':'.*-spapr-cpu-core', 'expected':True},
+
# KVM-specific devices shouldn't be tried without accel=kvm:
{'accel':'(?!kvm).*', 'device':'kvmclock', 'expected':True},
- {'accel':'(?!kvm).*', 'device':'kvm-pci-assign', 'expected':True},
# xen-specific machines and devices:
{'accel':'(?!xen).*', 'machine':'xen.*', 'expected':True},
{'log':r"Device [\w.,-]+ can not be dynamically instantiated"},
{'log':r"Platform Bus: Can not fit MMIO region of size "},
# other more specific errors we will ignore:
- {'device':'allwinner-a10', 'log':"Unsupported NIC model:"},
{'device':'.*-spapr-cpu-core', 'log':r"CPU core type should be"},
{'log':r"MSI(-X)? is not supported by interrupt controller"},
{'log':r"pxb-pcie? devices cannot reside on a PCIe? bus"},
# 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"spapr_rtas_register: Assertion .*rtas_table\[token\]\.name.* failed", '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"puv3_load_kernel: Assertion `kernel_filename != NULL' 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 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},
- {'exitcode':-11, 'device':'stm32f205-soc', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'xlnx,zynqmp', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'mips-cps', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'gus', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'a9mpcore_priv', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'a15mpcore_priv', 'loglevel':logging.ERROR, 'expected':True},
{'exitcode':-11, 'device':'isa-serial', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'sb16', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'cs4231a', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'device':'arm-gicv3', 'loglevel':logging.ERROR, 'expected':True},
- {'exitcode':-11, 'machine':'isapc', 'device':'.*-iommu', 'loglevel':logging.ERROR, 'expected':True},
# everything else (including SIGABRT and SIGSEGV) will be a fatal error:
{'exitcode':None, 'fatal':True, 'loglevel':logging.FATAL},
tc[k] = v
if len(binariesToTest(args, tc)) == 0:
- print >>sys.stderr, "No QEMU binary found"
+ print("No QEMU binary found", file=sys.stderr)
parser.print_usage(sys.stderr)
return 1