diff --git a/configure b/configure index 1c473ce95ba18bb1724739c071aa26442a00bb44..a898e21c68741a1c17884ca31dd0d13a61ae3c79 100755 --- a/configure +++ b/configure @@ -2151,23 +2151,6 @@ EOF fi fi -######################################### -# zlib check - -if test "$zlib" != "no" ; then - cat > $TMPC << EOF -#include -int main(void) { zlibVersion(); return 0; } -EOF - if compile_prog "" "-lz" ; then - : - else - error_exit "zlib check failed" \ - "Make sure to have the zlib libs and headers installed." - fi -fi -LIBS="$LIBS -lz" - ########################################## # lzo check @@ -3479,6 +3462,29 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then fi fi +######################################### +# zlib check + +if test "$zlib" != "no" ; then + if $pkg_config --exists zlib; then + zlib_cflags=$($pkg_config --cflags zlib) + zlib_libs=$($pkg_config --libs zlib) + QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS" + LIBS="$zlib_libs $LIBS" + else + cat > $TMPC << EOF +#include +int main(void) { zlibVersion(); return 0; } +EOF + if compile_prog "" "-lz" ; then + LIBS="$LIBS -lz" + else + error_exit "zlib check failed" \ + "Make sure to have the zlib libs and headers installed." + fi + fi +fi + ########################################## # SHA command probe for modules if test "$modules" = yes; then diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak index eb58b40254b97c9601cf086fcd893eba24021ea0..4d654eaa0b66553bc3374292eb1632f37205edc5 100644 --- a/default-configs/alpha-softmmu.mak +++ b/default-configs/alpha-softmmu.mak @@ -8,7 +8,6 @@ CONFIG_I82374=y CONFIG_I8254=y CONFIG_I8257=y CONFIG_PARALLEL=y -CONFIG_PARALLEL_ISA=y CONFIG_FDC=y CONFIG_PCKBD=y CONFIG_VGA_CIRRUS=y diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak index 3181bbf16317d4f32425ac9bd23deb63965315a8..23d871fb3e1ae7dcc3eddfcd3c1a7cc86da39d41 100644 --- a/default-configs/ppc-softmmu.mak +++ b/default-configs/ppc-softmmu.mak @@ -28,6 +28,7 @@ CONFIG_SM501=y CONFIG_DDC=y CONFIG_IDE_SII3112=y CONFIG_I2C=y +CONFIG_AT24C=y CONFIG_BITBANG_I2C=y CONFIG_M41T80=y CONFIG_VGA_CIRRUS=y diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index fcfad876142a4222eb35c6d896d54ae61a1e1764..a227754f867c230f8153f91e8a8174fa274fe9c4 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -59,6 +59,7 @@ variable (which affects memory reclamation and catches invalid pointers better) and gtester options. If necessary, you can run .. code:: + make check-unit V=1 and copy the actual command line which executes the unit test, then run @@ -116,6 +117,7 @@ and using gdb on the test is still simple to do: find out the actual command from the output of .. code:: + make check-qtest V=1 which you can run manually. diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 7ef1daee41ec7e93b9a1a10a1a36e6a36840112a..85c9fc0b65dd204ef0d138e05619e4454e251d42 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -30,6 +30,7 @@ #include "hw/sysbus.h" #include "trace.h" #include "net/net.h" +#include "qemu/log.h" #include "qemu/error-report.h" #include @@ -214,7 +215,8 @@ static size_t assemble_frame(uint8_t *buf, size_t size, uint32_t crc; if (size < payload_size + 12) { - error_report("milkymist_minimac2: received too big ethernet frame"); + qemu_log_mask(LOG_GUEST_ERROR, "milkymist_minimac2: frame too big " + "(%zd bytes)\n", payload_size); return 0; } @@ -347,8 +349,9 @@ minimac2_read(void *opaque, hwaddr addr, unsigned size) break; default: - error_report("milkymist_minimac2: read access to unknown register 0x" - TARGET_FMT_plx, addr << 2); + qemu_log_mask(LOG_GUEST_ERROR, + "milkymist_minimac2_rd%d: 0x%" HWADDR_PRIx "\n", + size, addr << 2); break; } @@ -413,8 +416,10 @@ minimac2_write(void *opaque, hwaddr addr, uint64_t value, break; default: - error_report("milkymist_minimac2: write access to unknown register 0x" - TARGET_FMT_plx, addr << 2); + qemu_log_mask(LOG_GUEST_ERROR, + "milkymist_minimac2_wr%d: 0x%" HWADDR_PRIx + " = 0x%" PRIx64 "\n", + size, addr << 2, value); break; } } diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs index a912d25391c516461d559470fdfeaafe084b1156..b318e53a43423a161a3b215a5f5e87e2a9543ee7 100644 --- a/hw/nvram/Makefile.objs +++ b/hw/nvram/Makefile.objs @@ -1,6 +1,6 @@ common-obj-$(CONFIG_DS1225Y) += ds1225y.o common-obj-y += eeprom93xx.o -common-obj-$(CONFIG_I2C) += eeprom_at24c.o +common-obj-$(CONFIG_AT24C) += eeprom_at24c.o common-obj-y += fw_cfg.o common-obj-y += chrp_nvram.o common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index da73743fa2ab1377a5a56c5d4e0ef5bb686c968a..47293a39157cb69acb3f090c89c4d9bfbc05c902 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -144,7 +144,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d) memory_region_transaction_begin(); for (i = 0; i < 13; i++) { pam_update(&d->pam_regions[i], i, - pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]); + pd->config[I440FX_PAM + DIV_ROUND_UP(i, 2)]); } memory_region_set_enabled(&d->smram_region, !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 8ce1e09932523ce090380f0d7e0669f72013ae7a..966a7cf92dfea20aae5a9ef8b3bf353e2ab2ad5c 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -356,7 +356,7 @@ static void mch_update_pam(MCHPCIState *mch) memory_region_transaction_begin(); for (i = 0; i < 13; i++) { pam_update(&mch->pam_regions[i], i, - pd->config[MCH_HOST_BRIDGE_PAM0 + (DIV_ROUND_UP(i, 2))]); + pd->config[MCH_HOST_BRIDGE_PAM0 + DIV_ROUND_UP(i, 2)]); } memory_region_transaction_commit(); } diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index aee31c62bb99a9e13a8bddff49ea4f0f0e94b015..47f9010c7594df58dba8988c43c3eb6a68831d5c 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -358,7 +358,7 @@ static uint64_t xen_pt_get_bar_size(PCIIORegion *r) static XenPTBarFlag xen_pt_bar_reg_parse(XenPCIPassthroughState *s, int index) { - PCIDevice *d = &s->dev; + PCIDevice *d = PCI_DEVICE(s); XenPTRegion *region = NULL; PCIIORegion *r; @@ -469,7 +469,7 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry, { XenPTRegInfo *reg = cfg_entry->reg; XenPTRegion *base = NULL; - PCIDevice *d = &s->dev; + PCIDevice *d = PCI_DEVICE(s); const PCIIORegion *r; uint32_t writable_mask = 0; uint32_t bar_emu_mask = 0; @@ -543,7 +543,7 @@ static int xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s, { XenPTRegInfo *reg = cfg_entry->reg; XenPTRegion *base = NULL; - PCIDevice *d = (PCIDevice *)&s->dev; + PCIDevice *d = PCI_DEVICE(s); uint32_t writable_mask = 0; uint32_t throughable_mask = get_throughable_mask(s, reg, valid_mask); pcibus_t r_size = 0; @@ -1587,7 +1587,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughState *s, const XenPTRegGroupInfo *grp_reg, uint32_t base_offset, uint8_t *size) { - PCIDevice *d = &s->dev; + PCIDevice *d = PCI_DEVICE(s); uint8_t version = get_capability_version(s, base_offset); uint8_t type = get_device_type(s, base_offset); uint8_t pcie_size = 0; diff --git a/include/exec/memory.h b/include/exec/memory.h index 667466b8f322f1347226e3f858fb5fc6776eb71b..d0c7f0d9e9fa55a4d33fab8b8f47ad8501135d55 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -935,7 +935,7 @@ uint64_t memory_region_size(MemoryRegion *mr); /** * memory_region_is_ram: check whether a memory region is random access * - * Returns %true is a memory region is random access. + * Returns %true if a memory region is random access. * * @mr: the memory region being queried */ @@ -947,7 +947,7 @@ static inline bool memory_region_is_ram(MemoryRegion *mr) /** * memory_region_is_ram_device: check whether a memory region is a ram device * - * Returns %true is a memory region is a device backed ram region + * Returns %true if a memory region is a device backed ram region * * @mr: the memory region being queried */ @@ -1161,7 +1161,7 @@ uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr); /** * memory_region_is_rom: check whether a memory region is ROM * - * Returns %true is a memory region is read-only memory. + * Returns %true if a memory region is read-only memory. * * @mr: the memory region being queried */ diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3_common.h index b798486ecf001ebbd45d1bafa69557a81ac4bf88..31ec9a1ae43c005f8fd5d955873dd7330690be70 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -62,7 +62,7 @@ * avoids bugs where we forget to subtract GIC_INTERNAL from an * interrupt number. */ -#define GICV3_BMP_SIZE (DIV_ROUND_UP(GICV3_MAXIRQ, 32)) +#define GICV3_BMP_SIZE DIV_ROUND_UP(GICV3_MAXIRQ, 32) #define GIC_DECLARE_BITMAP(name) \ uint32_t name[GICV3_BMP_SIZE] diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 4e238b0d9f8fde29fa601aceb55978f945d2a5ea..def0c64308d4c85d88f2cec0817912c3cb371afd 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -852,7 +852,7 @@ extern CPUInterruptHandler cpu_interrupt_handler; /** * cpu_interrupt: * @cpu: The CPU to set an interrupt on. - * @mask: The interupts to set. + * @mask: The interrupts to set. * * Invokes the interrupt handler. */ diff --git a/linux-user/qemu.h b/linux-user/qemu.h index a752c1c97a008726a6152ec27dc14ec5174452c3..dd5771ce0cbc140d8f797cce10ca7341d5e0498b 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -147,7 +147,7 @@ typedef struct TaskState { /* Nonzero if process_pending_signals() needs to do something (either * handle a pending signal or unblock signals). * This flag is written from a signal handler so should be accessed via - * the atomic_read() and atomic_write() functions. (It is not accessed + * the atomic_read() and atomic_set() functions. (It is not accessed * from multiple threads.) */ int signal_pending; diff --git a/qobject/block-qdict.c b/qobject/block-qdict.c index 42054cc2742f7a5b8add50d5aad0251890e5bb0b..1487cc5dd8b1cfbd50b9f354bcfa19a056484e43 100644 --- a/qobject/block-qdict.c +++ b/qobject/block-qdict.c @@ -577,7 +577,7 @@ static QObject *qdict_crumple_for_keyval_qiv(QDict *src, Error **errp) if (!tmp) { tmp = qdict_clone_shallow(src); } - qdict_put(tmp, ent->key, qstring_from_str(s)); + qdict_put_str(tmp, ent->key, s); g_free(buf); } diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 277f9a9bbaa19d6ea9e486a7fa953f512fb75236..457cffea90aff462debe7e36a6fb9e46d9f8a6a6 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -149,12 +149,10 @@ # trans_addl_i(ctx, &arg_opi, insn) # -import io import os import re import sys import getopt -import pdb insnwidth = 32 insnmask = 0xffffffff diff --git a/scripts/qemu.py b/scripts/qemu.py index bcd24aad82e4c3e5323e9597fa00af8b28d12162..fd4249f7a8763cb89a0ff298e54e0be750b8b026 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -93,7 +93,7 @@ class QEMUMachine(object): @param name: prefix for socket and log file names (default: qemu-PID) @param test_dir: where to create socket and log file @param monitor_address: address for QMP monitor - @param socket_scm_helper: helper program, required for send_fd_scm()" + @param socket_scm_helper: helper program, required for send_fd_scm() @note: Qemu process is not started until launch() is used. ''' if args is None: diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 4e24930c4bf949427ee0a5b7a5309d3d6438a496..02e77ec811b7028338de2f22d18e1ff9db0a5939 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -319,7 +319,7 @@ static bool load_asl(GArray *sdts, AcpiSdtTable *sdt) ret = g_spawn_command_line_sync(command_line->str, &out, &out_err, NULL, &error); g_assert_no_error(error); if (ret) { - ret = g_file_get_contents(sdt->asl_file, (gchar **)&sdt->asl, + ret = g_file_get_contents(sdt->asl_file, &sdt->asl, &sdt->asl_len, &error); g_assert(ret); g_assert_no_error(error); @@ -390,7 +390,7 @@ try_again: if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) { exp_sdt.aml_file = aml_file; } else if (*ext != '\0') { - /* try fallback to generic (extention less) expected file */ + /* try fallback to generic (extension less) expected file */ ext = ""; g_free(aml_file); goto try_again; diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 6e03235ab929486083c897f5489052bfe8bcdb87..9467e9d088971080a72f1239abce64ba5fd5ea05 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -41,7 +41,7 @@ docker-qemu-src: $(DOCKER_SRC_COPY) docker-image: ${DOCKER_TARGETS} # General rule for building docker images. If we are a sub-make -# invoked with SKIP_DOCKER_BUILD we still check the image is upto date +# invoked with SKIP_DOCKER_BUILD we still check the image is up to date # though ifdef SKIP_DOCKER_BUILD docker-image-%: $(DOCKER_FILES_DIR)/%.docker diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 44d5f7493b49776fb40fe0910cdebe8cecdc3849..02d8a838472f4c0da73a8060cf76d690dc8c0455 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -97,7 +97,7 @@ def _get_so_libs(executable): return libs def _copy_binary_with_libs(src, dest_dir): - """Copy a binary executable and all its dependant libraries. + """Copy a binary executable and all its dependent libraries. This does rely on the host file-system being fairly multi-arch aware so the file don't clash with the guests layout.""" @@ -284,7 +284,7 @@ class SubCommand(object): name = None # Subcommand name def shared_args(self, parser): parser.add_argument("--quiet", action="store_true", - help="Run quietly unless an error occured") + help="Run quietly unless an error occurred") def args(self, parser): """Setup argument parser""" diff --git a/tests/guest-debug/test-gdbstub.py b/tests/guest-debug/test-gdbstub.py index 474d2c5c655dfc98f1c728c2c3fc2faca2b59ce1..0e4ac0142608be4210483827590040fb20b3c02b 100644 --- a/tests/guest-debug/test-gdbstub.py +++ b/tests/guest-debug/test-gdbstub.py @@ -122,7 +122,7 @@ class CatchBreakpoint(gdb.Breakpoint): def run_test(): - "Run throught the tests one by one" + "Run through the tests one by one" print ("Checking we can step the first few instructions") step_ok = 0 diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218 old mode 100644 new mode 100755 diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index f2854849519c5bda15fb568af46b849f77bbb03b..dadde2a266c16e96bd4f2f611b0ee4264c9f077d 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -257,7 +257,7 @@ function _launch_qemu() } -# Silenty kills the QEMU process +# Silently kills the QEMU process # # If $wait is set to anything other than the empty string, the process will not # be killed but only waited for, and any output will be forwarded to stdout. If diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 44bee16a5e83695e7504881d4bb0da09c3ce7642..70ca65b49b3dee17f8ec39146ec14221ebf32a4e 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -170,7 +170,7 @@ if [ ! -e "$TEST_DIR" ]; then fi if [ ! -d "$TEST_DIR" ]; then - echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory" + echo "common.rc: Error: \$TEST_DIR ($TEST_DIR) is not a directory" exit 1 fi @@ -179,7 +179,7 @@ if [ -z "$REMOTE_TEST_DIR" ]; then fi if [ ! -d "$SAMPLE_IMG_DIR" ]; then - echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory" + echo "common.rc: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory" exit 1 fi diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include index 57470b2a2cbbb725609dece62326d149211247fb..c581bd6ffc95243ff3b8f3c482efa82b79447169 100644 --- a/tests/tcg/Makefile.include +++ b/tests/tcg/Makefile.include @@ -2,7 +2,7 @@ # # TCG tests (per-target rules) # -# This Makefile fragement is included from the per-target +# This Makefile fragment is included from the per-target # Makefile.target so will be invoked for each linux-user program we # build. We have two options for compiling, either using a configured # guest compiler or calling one of our docker images to do it for us. diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe index 15c0412657775b1ec741bb3f38ac0f173322da1b..9dc654663d67ab31a239c9a092667b657b155b6c 100644 --- a/tests/tcg/Makefile.probe +++ b/tests/tcg/Makefile.probe @@ -2,7 +2,7 @@ # # TCG Compiler Probe # -# This Makefile fragement is included multiple times in the main make +# This Makefile fragment is included multiple times in the main make # script to probe for available compilers. This is used to build up a # selection of required docker targets before we invoke a sub-make for # each target. diff --git a/tests/tcg/README b/tests/tcg/README index a5643d33e788858b58db9881f4eee10ba8012fb7..2a58f9a0581bce03a12910f23157db35c35894eb 100644 --- a/tests/tcg/README +++ b/tests/tcg/README @@ -10,6 +10,6 @@ with "make test-cris". LM32 ==== -The testsuite for LM32 is in tests/tcg/cris. You can run it +The testsuite for LM32 is in tests/tcg/lm32. You can run it with "make test-lm32". diff --git a/tests/tcg/mips/mips64-dsp/subq_s_pw.c b/tests/tcg/mips/mips64-dsp/subq_s_pw.c index e8e0b0567e4c385218f42622a063ca97fbb552fe..4c080b785ad20f4bfd2727f51b20e03b5b6e1145 100644 --- a/tests/tcg/mips/mips64-dsp/subq_s_pw.c +++ b/tests/tcg/mips/mips64-dsp/subq_s_pw.c @@ -24,7 +24,7 @@ int main(void) rt = 0x123456789ABCDEF1; rs = 0x123456789ABCDEF2; result = 0x0000000000000001; - /* This time we do not set dspctrl, but it setted in pre-action. */ + /* This time we do not set dspctrl, but set it in pre-action. */ dspresult = 0x1; __asm