diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-04-19 18:22:15 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2022-04-19 18:22:16 -0700 |
commit | 1be5a765c08cee3a9587c8a8d3fc2ea247b13f9c (patch) | |
tree | 30ace22866ea218524bf1a64818fc20a93a414e3 /tests | |
parent | 3202995c13a7484b7d69c43f148354c537bf87de (diff) | |
parent | c9e28ae7972a10fdf09b7ebd8046840d1101b8ce (diff) | |
download | qemu-1be5a765c08cee3a9587c8a8d3fc2ea247b13f9c.zip qemu-1be5a765c08cee3a9587c8a8d3fc2ea247b13f9c.tar.gz qemu-1be5a765c08cee3a9587c8a8d3fc2ea247b13f9c.tar.bz2 |
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* Add cpu0-id to query-sev-capabilities
* whpx support for breakpoints and stepping
* initial support for Hyper-V Synthetic Debugging
* use monotonic clock for QemuCond and QemuSemaphore
* Remove qemu-common.h include from most units and lots of other clenaups
* do not include headers for all virtio devices in virtio-ccw.h
# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmJXCQAUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNT6wf+NHDJUEdDiwaVGVTGXgHuiaycsymi
# FpNPiw/+XxSGN5xF3fkUGgqaDrcwIYwVfnXlghKSz8kp1cP3cjxa5CzNMLGTp5je
# N6BxFbD7yC6dhagGm3mj32jlsptv3M38OHqKc3t+RaUAotP5RF2VdCyfUBLG6vU0
# aMzvMfMtB5aG0D8Fr5EV63t1JMTceFU0YxsG73UCFs2Yx4Z0cGBbNxMbHweRhd1q
# tPeVDS46MFPM3/2cGGHpeeqxkoCTU7A9j1VuNQI3k+Kg+6W5YVxiK/UP7bw77E/a
# yAHsmIVTNro8ajMBch73weuHtGtdfFLvCKc6QX6aVjzK4dF1voQ01E7gPQ==
# =rMle
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 13 Apr 2022 10:31:44 AM PDT
# gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined]
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [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: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (53 commits)
target/i386: Remove unused XMMReg, YMMReg types and CPUState fields
target/i386: do not access beyond the low 128 bits of SSE registers
virtio-ccw: do not include headers for all virtio devices
virtio-ccw: move device type declarations to .c files
virtio-ccw: move vhost_ccw_scsi to a separate file
s390x: follow qdev tree to detect SCSI device on a CCW bus
hw: hyperv: Initial commit for Synthetic Debugging device
hyperv: Add support to process syndbg commands
hyperv: Add definitions for syndbg
hyperv: SControl is optional to enable SynIc
thread-posix: optimize qemu_sem_timedwait with zero timeout
thread-posix: implement Semaphore with QemuCond and QemuMutex
thread-posix: use monotonic clock for QemuCond and QemuSemaphore
thread-posix: remove the posix semaphore support
whpx: Added support for breakpoints and stepping
build-sys: simplify AF_VSOCK check
build-sys: drop ntddscsi.h check
Remove qemu-common.h include from most units
qga: remove explicit environ argument from exec/spawn
Move fcntl_setfl() to oslib-posix
...
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tests')
58 files changed, 51 insertions, 153 deletions
diff --git a/tests/fp/platform.h b/tests/fp/platform.h index c20ba70..6c72ad0 100644 --- a/tests/fp/platform.h +++ b/tests/fp/platform.h @@ -29,9 +29,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config-host.h" +#include "qemu/compiler.h" -#ifndef HOST_WORDS_BIGENDIAN +#if !HOST_BIG_ENDIAN #define LITTLEENDIAN 1 /* otherwise do not define it */ #endif diff --git a/tests/meson.build b/tests/meson.build index 1d05109..4f691e8 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,5 +1,3 @@ -py3 = import('python').find_installation() - subdir('bench') subdir('qemu-iotests') diff --git a/tests/qtest/acpi-utils.c b/tests/qtest/acpi-utils.c index 766c48e..673fc97 100644 --- a/tests/qtest/acpi-utils.c +++ b/tests/qtest/acpi-utils.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "qemu-common.h" #include "qemu/bitmap.h" #include "acpi-utils.h" #include "boot-sector.h" diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index 8073ccc..aff5f3f 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -30,7 +30,6 @@ #include "libqos/ahci.h" #include "libqos/pci-pc.h" -#include "qemu-common.h" #include "qapi/qmp/qdict.h" #include "qemu/host-utils.h" diff --git a/tests/qtest/aspeed_hace-test.c b/tests/qtest/aspeed_hace-test.c index 09ee315..58aa220 100644 --- a/tests/qtest/aspeed_hace-test.c +++ b/tests/qtest/aspeed_hace-test.c @@ -8,7 +8,6 @@ #include "qemu/osdep.h" #include "libqos/libqtest.h" -#include "qemu-common.h" #include "qemu/bitops.h" #define HACE_CMD 0x10 diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index c4a2d1e..5dddeda 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -57,7 +57,6 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "qemu-common.h" #include "hw/firmware/smbios.h" #include "qemu/bitmap.h" #include "acpi-utils.h" diff --git a/tests/qtest/boot-sector.c b/tests/qtest/boot-sector.c index ea8f264..9d9825b 100644 --- a/tests/qtest/boot-sector.c +++ b/tests/qtest/boot-sector.c @@ -12,7 +12,6 @@ */ #include "qemu/osdep.h" #include "boot-sector.h" -#include "qemu-common.h" #include "libqos/libqtest.h" #define LOW(x) ((x) & 0xff) diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c index a1c6894..7f5dd5f 100644 --- a/tests/qtest/cpu-plug-test.c +++ b/tests/qtest/cpu-plug-test.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqtest-single.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" diff --git a/tests/qtest/dbus-display-test.c b/tests/qtest/dbus-display-test.c index 43c77af..8104316 100644 --- a/tests/qtest/dbus-display-test.c +++ b/tests/qtest/dbus-display-test.c @@ -3,7 +3,6 @@ #include <gio/gio.h> #include <gio/gunixfdlist.h> #include "libqos/libqtest.h" -#include "qemu-common.h" #include "dbus-display1.h" static GDBusConnection* diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-test.c index aca9b98..a8acab7 100644 --- a/tests/qtest/dbus-vmstate-test.c +++ b/tests/qtest/dbus-vmstate-test.c @@ -2,7 +2,6 @@ #include <glib/gstdio.h> #include <gio/gio.h> #include "libqos/libqtest.h" -#include "qemu-common.h" #include "dbus-vmstate1.h" #include "migration-helpers.h" diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index bbec166..adf39b2 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index e648fdd..ddd6983 100644 --- a/tests/qtest/e1000e-test.c +++ b/tests/qtest/e1000e-test.c @@ -25,9 +25,7 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqtest-single.h" -#include "qemu-common.h" #include "libqos/pci-pc.h" #include "qemu/sockets.h" #include "qemu/iov.h" diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c index f94cd8d..a0adc35 100644 --- a/tests/qtest/erst-test.c +++ b/tests/qtest/erst-test.c @@ -11,7 +11,6 @@ #include <glib/gstdio.h> #include "libqos/libqos-pc.h" #include "libqos/libqtest.h" -#include "qemu-common.h" #include "hw/pci/pci.h" diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c index b0d4001..4aa72f3 100644 --- a/tests/qtest/fdc-test.c +++ b/tests/qtest/fdc-test.c @@ -27,7 +27,6 @@ #include "libqtest-single.h" #include "qapi/qmp/qdict.h" -#include "qemu-common.h" /* TODO actually test the results and get rid of this */ #define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__)) diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index 7a244c9..dc891d8 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -19,7 +19,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qapi/error.h" -#include "qemu-common.h" #include "exec/memory.h" #include "qemu/main-loop.h" diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 64023c0..da9c4c2 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -16,7 +16,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/bswap.h" #include "qapi/qmp/qlist.h" #include "libqos/libqtest.h" diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 19de3b4..b7243a1 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -30,7 +30,6 @@ #include "libqos/pci-pc.h" #include "libqos/malloc-pc.h" #include "qapi/qmp/qdict.h" -#include "qemu-common.h" #include "qemu/bswap.h" #include "hw/pci/pci_ids.h" #include "hw/pci/pci_regs.h" diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c index 19612e9..ed431e3 100644 --- a/tests/qtest/ipmi-bt-test.c +++ b/tests/qtest/ipmi-bt-test.c @@ -31,7 +31,6 @@ #include "libqtest-single.h" -#include "qemu-common.h" #define IPMI_IRQ 5 diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index 4e8af42..95628a4 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -14,7 +14,6 @@ #include "libqos/libqos-pc.h" #include "libqos/libqos-spapr.h" #include "libqos/libqtest.h" -#include "qemu-common.h" #define TMPSHMSIZE (1 << 20) static char *tmpshm; diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c index eaa2096..41c4be5 100644 --- a/tests/qtest/libqos/ahci.c +++ b/tests/qtest/libqos/ahci.c @@ -28,7 +28,6 @@ #include "ahci.h" #include "pci-pc.h" -#include "qemu-common.h" #include "qemu/host-utils.h" #include "hw/pci/pci_ids.h" diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c index f1e3b39..bbd1b48 100644 --- a/tests/qtest/libqos/malloc-pc.c +++ b/tests/qtest/libqos/malloc-pc.c @@ -16,8 +16,6 @@ #include "standard-headers/linux/qemu_fw_cfg.h" -#include "qemu-common.h" - #define ALLOC_PAGE_SIZE (4096) void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c index 05b306c..d90ed3c 100644 --- a/tests/qtest/libqos/malloc-spapr.c +++ b/tests/qtest/libqos/malloc-spapr.c @@ -8,8 +8,6 @@ #include "qemu/osdep.h" #include "malloc-spapr.h" -#include "qemu-common.h" - #define SPAPR_PAGE_SIZE 4096 /* Memory must be a multiple of 256 MB, diff --git a/tests/qtest/libqos/malloc.c b/tests/qtest/libqos/malloc.c index f708b01..f0c8f95 100644 --- a/tests/qtest/libqos/malloc.c +++ b/tests/qtest/libqos/malloc.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "malloc.h" -#include "qemu-common.h" #include "qemu/host-utils.h" typedef struct MemBlock { diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index dc5566c..7b5890d 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -21,7 +21,6 @@ #include <sys/un.h> #include "libqos/libqtest.h" -#include "qemu-common.h" #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qapi/error.h" diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c index 138101b..8ca1807 100644 --- a/tests/qtest/machine-none-test.c +++ b/tests/qtest/machine-none-test.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/cutils.h" #include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c index 7c435ac..a353fef 100644 --- a/tests/qtest/npcm7xx_emc-test.c +++ b/tests/qtest/npcm7xx_emc-test.c @@ -15,7 +15,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqos/libqos.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qnum.h" diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c index 797f832..35b1c1f 100644 --- a/tests/qtest/npcm7xx_rng-test.c +++ b/tests/qtest/npcm7xx_rng-test.c @@ -20,7 +20,7 @@ #include "libqtest-single.h" #include "qemu/bitops.h" -#include "qemu-common.h" +#include "qemu/cutils.h" #define RNG_BASE_ADDR 0xf000b000 diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 32bbae3..3cb47d2 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "qemu-common.h" #include "libqos/libqtest.h" #include "boot-sector.h" #include "libqos/libqos-spapr.h" diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index eb34af8..6b162e1 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" #include "qemu/cutils.h" diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c index 4506049..8fa3313 100644 --- a/tests/qtest/rtl8139-test.c +++ b/tests/qtest/rtl8139-test.c @@ -11,7 +11,6 @@ #include "libqtest-single.h" #include "libqos/pci-pc.h" #include "qemu/timer.h" -#include "qemu-common.h" /* Tests only initialization so far. TODO: Replace with functional tests */ static void nop(void) diff --git a/tests/qtest/test-filter-mirror.c b/tests/qtest/test-filter-mirror.c index da4f94d..fdf66ce 100644 --- a/tests/qtest/test-filter-mirror.c +++ b/tests/qtest/test-filter-mirror.c @@ -9,7 +9,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qemu/iov.h" diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter-redirector.c index fc16cf7..339d3c0 100644 --- a/tests/qtest/test-filter-redirector.c +++ b/tests/qtest/test-filter-redirector.c @@ -51,7 +51,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qemu/iov.h" diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86-cpuid-compat.c index 39138db..b39c905 100644 --- a/tests/qtest/test-x86-cpuid-compat.c +++ b/tests/qtest/test-x86-cpuid-compat.c @@ -1,5 +1,4 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qnum.h" diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c index 62e670f..659b505 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -37,7 +37,7 @@ typedef struct QVirtioBlkReq { uint8_t status; } QVirtioBlkReq; -#ifdef HOST_WORDS_BIGENDIAN +#if HOST_BIG_ENDIAN static const bool host_is_big_endian = true; #else static const bool host_is_big_endian; /* false */ diff --git a/tests/qtest/virtio-blk-test.c b/tests/qtest/virtio-blk-test.c index 2a23698..f22594a 100644 --- a/tests/qtest/virtio-blk-test.c +++ b/tests/qtest/virtio-blk-test.c @@ -33,7 +33,7 @@ typedef struct QVirtioBlkReq { } QVirtioBlkReq; -#ifdef HOST_WORDS_BIGENDIAN +#if HOST_BIG_ENDIAN const bool host_is_big_endian = true; #else const bool host_is_big_endian; /* false */ diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c index a713958..fc9f2b9 100644 --- a/tests/qtest/virtio-net-test.c +++ b/tests/qtest/virtio-net-test.c @@ -8,7 +8,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "libqtest-single.h" #include "qemu/iov.h" #include "qemu/module.h" diff --git a/tests/tcg/xtensa/Makefile.softmmu-target b/tests/tcg/xtensa/Makefile.softmmu-target index 9530cac..973e552 100644 --- a/tests/tcg/xtensa/Makefile.softmmu-target +++ b/tests/tcg/xtensa/Makefile.softmmu-target @@ -2,7 +2,7 @@ # Xtensa softmmu tests # -ifneq ($(TARGET_WORDS_BIGENDIAN),y) +ifneq ($(TARGET_BIG_ENDIAN),y) XTENSA_SRC = $(SRC_PATH)/tests/tcg/xtensa XTENSA_ALL = $(filter-out $(XTENSA_SRC)/linker.ld.S,$(wildcard $(XTENSA_SRC)/*.S)) diff --git a/tests/unit/check-qjson.c b/tests/unit/check-qjson.c index c845f91..c4e0f85 100644 --- a/tests/unit/check-qjson.c +++ b/tests/unit/check-qjson.c @@ -21,7 +21,6 @@ #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qemu/unicode.h" -#include "qemu-common.h" static QString *from_json_str(const char *jstr, bool single, Error **errp) { diff --git a/tests/unit/check-qnull.c b/tests/unit/check-qnull.c index ebf21db..5ceacc6 100644 --- a/tests/unit/check-qnull.c +++ b/tests/unit/check-qnull.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" #include "qapi/qmp/qnull.h" -#include "qemu-common.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qapi/error.h" diff --git a/tests/unit/check-qnum.c b/tests/unit/check-qnum.c index b85fca2..bf7fe45 100644 --- a/tests/unit/check-qnum.c +++ b/tests/unit/check-qnum.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" #include "qapi/qmp/qnum.h" -#include "qemu-common.h" /* * Public Interface test-cases diff --git a/tests/unit/check-qobject.c b/tests/unit/check-qobject.c index c3d50e9..0ed094e 100644 --- a/tests/unit/check-qobject.c +++ b/tests/unit/check-qobject.c @@ -15,7 +15,6 @@ #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" -#include "qemu-common.h" #include <math.h> @@ -74,21 +73,6 @@ static void do_test_equality(bool expected, int _, ...) #define check_unequal(...) \ do_test_equality(false, 0, __VA_ARGS__, &test_equality_end_of_arguments) -static void do_free_all(int _, ...) -{ - va_list ap; - QObject *obj; - - va_start(ap, _); - while ((obj = va_arg(ap, QObject *)) != NULL) { - qobject_unref(obj); - } - va_end(ap); -} - -#define free_all(...) \ - do_free_all(0, __VA_ARGS__, NULL) - static void qobject_is_equal_null_test(void) { check_unequal(qnull(), NULL); @@ -96,15 +80,14 @@ static void qobject_is_equal_null_test(void) static void qobject_is_equal_num_test(void) { - QNum *u0, *i0, *d0, *dnan, *um42, *im42, *dm42; + g_autoptr(QNum) u0 = qnum_from_uint(0u); + g_autoptr(QNum) i0 = qnum_from_int(0); + g_autoptr(QNum) d0 = qnum_from_double(0.0); + g_autoptr(QNum) dnan = qnum_from_double(NAN); + g_autoptr(QNum) um42 = qnum_from_uint((uint64_t)-42); + g_autoptr(QNum) im42 = qnum_from_int(-42); + g_autoptr(QNum) dm42 = qnum_from_double(-42.0); - u0 = qnum_from_uint(0u); - i0 = qnum_from_int(0); - d0 = qnum_from_double(0.0); - dnan = qnum_from_double(NAN); - um42 = qnum_from_uint((uint64_t)-42); - im42 = qnum_from_int(-42); - dm42 = qnum_from_double(-42.0); /* Integers representing a mathematically equal number should * compare equal */ @@ -121,60 +104,45 @@ static void qobject_is_equal_num_test(void) check_unequal(um42, im42); check_unequal(um42, dm42); check_unequal(im42, dm42); - - free_all(u0, i0, d0, dnan, um42, im42, dm42); } static void qobject_is_equal_bool_test(void) { - QBool *btrue_0, *btrue_1, *bfalse_0, *bfalse_1; - - btrue_0 = qbool_from_bool(true); - btrue_1 = qbool_from_bool(true); - bfalse_0 = qbool_from_bool(false); - bfalse_1 = qbool_from_bool(false); + g_autoptr(QBool) btrue_0 = qbool_from_bool(true); + g_autoptr(QBool) btrue_1 = qbool_from_bool(true); + g_autoptr(QBool) bfalse_0 = qbool_from_bool(false); + g_autoptr(QBool) bfalse_1 = qbool_from_bool(false); check_equal(btrue_0, btrue_1); check_equal(bfalse_0, bfalse_1); check_unequal(btrue_0, bfalse_0); - - free_all(btrue_0, btrue_1, bfalse_0, bfalse_1); } static void qobject_is_equal_string_test(void) { - QString *str_base, *str_whitespace_0, *str_whitespace_1, *str_whitespace_2; - QString *str_whitespace_3, *str_case, *str_built; - - str_base = qstring_from_str("foo"); - str_whitespace_0 = qstring_from_str(" foo"); - str_whitespace_1 = qstring_from_str("foo "); - str_whitespace_2 = qstring_from_str("foo\b"); - str_whitespace_3 = qstring_from_str("fooo\b"); - str_case = qstring_from_str("Foo"); - + g_autoptr(QString) str_base = qstring_from_str("foo"); + g_autoptr(QString) str_whitespace_0 = qstring_from_str(" foo"); + g_autoptr(QString) str_whitespace_1 = qstring_from_str("foo "); + g_autoptr(QString) str_whitespace_2 = qstring_from_str("foo\b"); + g_autoptr(QString) str_whitespace_3 = qstring_from_str("fooo\b"); + g_autoptr(QString) str_case = qstring_from_str("Foo"); /* Should yield "foo" */ - str_built = qstring_from_substr("buffoon", 3, 6); + g_autoptr(QString) str_built = qstring_from_substr("buffoon", 3, 6); check_unequal(str_base, str_whitespace_0, str_whitespace_1, str_whitespace_2, str_whitespace_3, str_case); check_equal(str_base, str_built); - - free_all(str_base, str_whitespace_0, str_whitespace_1, str_whitespace_2, - str_whitespace_3, str_case, str_built); } static void qobject_is_equal_list_test(void) { - QList *list_0, *list_1, *list_cloned; - QList *list_reordered, *list_longer, *list_shorter; - - list_0 = qlist_new(); - list_1 = qlist_new(); - list_reordered = qlist_new(); - list_longer = qlist_new(); - list_shorter = qlist_new(); + g_autoptr(QList) list_0 = qlist_new(); + g_autoptr(QList) list_1 = qlist_new(); + g_autoptr(QList) list_reordered = qlist_new(); + g_autoptr(QList) list_longer = qlist_new(); + g_autoptr(QList) list_shorter = qlist_new(); + g_autoptr(QList) list_cloned = NULL; qlist_append_int(list_0, 1); qlist_append_int(list_0, 2); @@ -205,26 +173,20 @@ static void qobject_is_equal_list_test(void) * itself */ qlist_append(list_0, qnum_from_double(NAN)); g_assert(qobject_is_equal(QOBJECT(list_0), QOBJECT(list_0)) == false); - - free_all(list_0, list_1, list_cloned, list_reordered, list_longer, - list_shorter); } static void qobject_is_equal_dict_test(void) { - QDict *dict_0, *dict_1, *dict_cloned; - QDict *dict_different_key, *dict_different_value, *dict_different_null_key; - QDict *dict_longer, *dict_shorter, *dict_nested; - QDict *dict_crumpled; - - dict_0 = qdict_new(); - dict_1 = qdict_new(); - dict_different_key = qdict_new(); - dict_different_value = qdict_new(); - dict_different_null_key = qdict_new(); - dict_longer = qdict_new(); - dict_shorter = qdict_new(); - dict_nested = qdict_new(); + g_autoptr(QDict) dict_cloned = NULL; + g_autoptr(QDict) dict_crumpled = NULL; + g_autoptr(QDict) dict_0 = qdict_new(); + g_autoptr(QDict) dict_1 = qdict_new(); + g_autoptr(QDict) dict_different_key = qdict_new(); + g_autoptr(QDict) dict_different_value = qdict_new(); + g_autoptr(QDict) dict_different_null_key = qdict_new(); + g_autoptr(QDict) dict_longer = qdict_new(); + g_autoptr(QDict) dict_shorter = qdict_new(); + g_autoptr(QDict) dict_nested = qdict_new(); qdict_put_int(dict_0, "f.o", 1); qdict_put_int(dict_0, "bar", 2); @@ -284,31 +246,21 @@ static void qobject_is_equal_dict_test(void) * itself */ qdict_put(dict_0, "NaN", qnum_from_double(NAN)); g_assert(qobject_is_equal(QOBJECT(dict_0), QOBJECT(dict_0)) == false); - - free_all(dict_0, dict_1, dict_cloned, dict_different_key, - dict_different_value, dict_different_null_key, dict_longer, - dict_shorter, dict_nested, dict_crumpled); } static void qobject_is_equal_conversion_test(void) { - QNum *u0, *i0, *d0; - QString *s0, *s_empty; - QBool *bfalse; - - u0 = qnum_from_uint(0u); - i0 = qnum_from_int(0); - d0 = qnum_from_double(0.0); - s0 = qstring_from_str("0"); - s_empty = qstring_new(); - bfalse = qbool_from_bool(false); + g_autoptr(QNum) u0 = qnum_from_uint(0u); + g_autoptr(QNum) i0 = qnum_from_int(0); + g_autoptr(QNum) d0 = qnum_from_double(0.0); + g_autoptr(QString) s0 = qstring_from_str("0"); + g_autoptr(QString) s_empty = qstring_new(); + g_autoptr(QBool) bfalse = qbool_from_bool(false); /* No automatic type conversion */ check_unequal(u0, s0, s_empty, bfalse, qnull(), NULL); check_unequal(i0, s0, s_empty, bfalse, qnull(), NULL); check_unequal(d0, s0, s_empty, bfalse, qnull(), NULL); - - free_all(u0, i0, d0, s0, s_empty, bfalse); } int main(int argc, char **argv) diff --git a/tests/unit/check-qstring.c b/tests/unit/check-qstring.c index 4bf9772..bd861f4 100644 --- a/tests/unit/check-qstring.c +++ b/tests/unit/check-qstring.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "qapi/qmp/qstring.h" -#include "qemu-common.h" /* * Public Interface test-cases diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 96b2952..026e39f 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -148,7 +148,7 @@ if have_system endif tests += { - 'test-qdev-global-props': [qom, hwcore, testqapi] + 'test-qdev-global-props': [qom, hwcore] } endif endif diff --git a/tests/unit/socket-helpers.c b/tests/unit/socket-helpers.c index ef31664..0a9e090 100644 --- a/tests/unit/socket-helpers.c +++ b/tests/unit/socket-helpers.c @@ -19,7 +19,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/sockets.h" #include "socket-helpers.h" diff --git a/tests/unit/test-clone-visitor.c b/tests/unit/test-clone-visitor.c index 5d48e12..ce67585 100644 --- a/tests/unit/test-clone-visitor.c +++ b/tests/unit/test-clone-visitor.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/clone-visitor.h" #include "test-qapi-visit.h" diff --git a/tests/unit/test-forward-visitor.c b/tests/unit/test-forward-visitor.c index 348f7e4..01de155 100644 --- a/tests/unit/test-forward-visitor.c +++ b/tests/unit/test-forward-visitor.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/forward-visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/error.h" diff --git a/tests/unit/test-iov.c b/tests/unit/test-iov.c index 5371066..0d2ba9b 100644 --- a/tests/unit/test-iov.c +++ b/tests/unit/test-iov.c @@ -1,5 +1,4 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/iov.h" #include "qemu/sockets.h" diff --git a/tests/unit/test-logging.c b/tests/unit/test-logging.c index ccb819f..05703a4 100644 --- a/tests/unit/test-logging.c +++ b/tests/unit/test-logging.c @@ -27,7 +27,6 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "qemu-common.h" #include "qapi/error.h" #include "qemu/log.h" diff --git a/tests/unit/test-qmp-event.c b/tests/unit/test-qmp-event.c index d58c3b7..7d961d7 100644 --- a/tests/unit/test-qmp-event.c +++ b/tests/unit/test-qmp-event.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/compat-policy.h" #include "qapi/error.h" #include "qapi/qmp/qbool.h" diff --git a/tests/unit/test-qobject-input-visitor.c b/tests/unit/test-qobject-input-visitor.c index 22538f8..aed08ea 100644 --- a/tests/unit/test-qobject-input-visitor.c +++ b/tests/unit/test-qobject-input-visitor.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/error.h" #include "qapi/qapi-visit-introspect.h" #include "qapi/qobject-input-visitor.h" diff --git a/tests/unit/test-qobject-output-visitor.c b/tests/unit/test-qobject-output-visitor.c index 6af4c33..66b27fa 100644 --- a/tests/unit/test-qobject-output-visitor.c +++ b/tests/unit/test-qobject-output-visitor.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/error.h" #include "qapi/qobject-output-visitor.h" #include "test-qapi-visit.h" diff --git a/tests/unit/test-string-input-visitor.c b/tests/unit/test-string-input-visitor.c index 249faaf..25094d3 100644 --- a/tests/unit/test-string-input-visitor.c +++ b/tests/unit/test-string-input-visitor.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/error.h" #include "qapi/string-input-visitor.h" #include "test-qapi-visit.h" diff --git a/tests/unit/test-string-output-visitor.c b/tests/unit/test-string-output-visitor.c index e2bedc5..7ef3053 100644 --- a/tests/unit/test-string-output-visitor.c +++ b/tests/unit/test-string-output-visitor.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qapi/error.h" #include "qapi/string-output-visitor.h" #include "test-qapi-visit.h" diff --git a/tests/unit/test-thread-pool.c b/tests/unit/test-thread-pool.c index 70dc631..6020e65 100644 --- a/tests/unit/test-thread-pool.c +++ b/tests/unit/test-thread-pool.c @@ -1,5 +1,4 @@ #include "qemu/osdep.h" -#include "qemu-common.h" #include "block/aio.h" #include "block/thread-pool.h" #include "block/block.h" diff --git a/tests/unit/test-util-sockets.c b/tests/unit/test-util-sockets.c index 896247e..63909cc 100644 --- a/tests/unit/test-util-sockets.c +++ b/tests/unit/test-util-sockets.c @@ -19,7 +19,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/sockets.h" #include "qapi/error.h" #include "socket-helpers.h" diff --git a/tests/unit/test-visitor-serialization.c b/tests/unit/test-visitor-serialization.c index 4629958..907263d 100644 --- a/tests/unit/test-visitor-serialization.c +++ b/tests/unit/test-visitor-serialization.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include <float.h> -#include "qemu-common.h" #include "test-qapi-visit.h" #include "qapi/error.h" #include "qapi/qmp/qjson.h" diff --git a/tests/unit/test-xbzrle.c b/tests/unit/test-xbzrle.c index 795d6f1..ef951b6 100644 --- a/tests/unit/test-xbzrle.c +++ b/tests/unit/test-xbzrle.c @@ -11,7 +11,6 @@ * */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "qemu/cutils.h" #include "../migration/xbzrle.h" diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 35088dd..9b1dab2 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -468,8 +468,8 @@ vubr_queue_set_started(VuDev *dev, int qidx, bool started) if (started && vubr->notifier.fd >= 0) { vu_set_queue_host_notifier(dev, vq, vubr->notifier.fd, - qemu_real_host_page_size, - qidx * qemu_real_host_page_size); + qemu_real_host_page_size(), + qidx * qemu_real_host_page_size()); } if (qidx % 2 == 1) { @@ -601,7 +601,7 @@ static void *notifier_thread(void *arg) { VuDev *dev = (VuDev *)arg; VubrDev *vubr = container_of(dev, VubrDev, vudev); - int pagesize = qemu_real_host_page_size; + int pagesize = qemu_real_host_page_size(); int qidx; while (true) { @@ -637,7 +637,7 @@ vubr_host_notifier_setup(VubrDev *dev) void *addr; int fd; - length = qemu_real_host_page_size * VHOST_USER_BRIDGE_MAX_QUEUES; + length = qemu_real_host_page_size() * VHOST_USER_BRIDGE_MAX_QUEUES; fd = mkstemp(template); if (fd < 0) { |