summaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-04-22 06:10:51 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-04-22 06:10:51 +0100
commit1cc6e1a20144c0ae360cbeb0e035fdee1bd80609 (patch)
treef2e873608f5e982206b52d4a3c8d6d0644abc56c /tests/qtest
parent45608654aa63ca2b311d6cb761e1522f2128e00e (diff)
parent5f9efbbcf6fc77e583254389124437d981ad76b9 (diff)
downloadqemu-1cc6e1a20144c0ae360cbeb0e035fdee1bd80609.tar.gz
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* Optional use of Meson wrap for slirp * Coverity fixes * Avoid -Werror=maybe-uninitialized * Mark coroutine QMP command functions as coroutine_fn * Mark functions that suspend as coroutine_mixed_fn * target/i386: Fix SGX CPUID leaf * First batch of qatomic_mb_read() removal * Small atomic.rst improvement * NBD cleanup * Update libvirt-ci submodule # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmRBAzwUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroP64gf+NzLW95tylCfhKuuLq/TjuOTQqHCD # KVLlA1I3pwJfk4SUuigrnaJtwfa/tBiWxfaivUdPAzPzeXyxcVSOps0neohrmFBh # 2e3ylBWWz22K0gkLtrFwJT99TVy6w6Xhj9SX8HPRfxl4k8yMPrUJNW78hh6APAwq # /etZY6+ieHC7cwG4xluhxsHnxnBYBYD+18hUd+b5LchD/yvCSCNNiursutpa0Ar/ # r/HtDwNFKlaApO3sU4R3yYgdS1Fvcas4tDZaumADsQlSG5z+UeJldc98LiRlFrAA # gnskBSaaly/NgWqY3hVCYaBGyjD4lWPkX/FEChi0XX6Fl1P0umQAv/7z3w== # =XSAs # -----END PGP SIGNATURE----- # gpg: Signature made Thu 20 Apr 2023 10:17:48 AM BST # 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: (25 commits) tests: lcitool: Switch to OpenSUSE Leap 15.4 tests: libvirt-ci: Update to commit '2fa24dce8bc' configure: Honour cross-prefix when finding ObjC compiler coverity: unify Fedora dockerfiles nbd: a BlockExport always has a BlockBackend docs: explain effect of smp_read_barrier_depends() on modern architectures qemu-coroutine: remove qatomic_mb_read() postcopy-ram: do not use qatomic_mb_read block-backend: remove qatomic_mb_read() target/i386: Change wrong XFRM value in SGX CPUID leaf monitor: mark mixed functions that can suspend migration: mark mixed functions that can suspend io: mark mixed functions that can suspend qapi-gen: mark coroutine QMP command functions as coroutine_fn target/mips: tcg: detect out-of-bounds accesses to cpu_gpr and cpu_gpr_hi coverity: update COMPONENTS.md lasi: fix RTC migration target/i386: Avoid unreachable variable declaration in mmu_translate() configure: Avoid -Werror=maybe-uninitialized tests: bios-tables-test: replace memset with initializer ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/bios-tables-test.c123
1 files changed, 43 insertions, 80 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 8733589437..464f87382e 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -438,10 +438,9 @@ static void test_acpi_asl(test_data *data)
{
int i;
AcpiSdtTable *sdt, *exp_sdt;
- test_data exp_data;
+ test_data exp_data = {};
gboolean exp_err, err, all_tables_match = true;
- memset(&exp_data, 0, sizeof(exp_data));
exp_data.tables = load_expected_aml(data);
dump_aml_files(data, false);
for (i = 0; i < data->tables->len; ++i) {
@@ -853,12 +852,11 @@ static uint8_t base_required_struct_types[] = {
static void test_acpi_piix4_tcg(void)
{
- test_data data;
+ test_data data = {};
/* Supplying -machine accel argument overrides the default (qtest).
* This is to make guest actually run.
*/
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
@@ -868,9 +866,8 @@ static void test_acpi_piix4_tcg(void)
static void test_acpi_piix4_tcg_bridge(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".bridge";
data.required_struct_types = base_required_struct_types;
@@ -906,9 +903,8 @@ static void test_acpi_piix4_tcg_bridge(void)
static void test_acpi_piix4_no_root_hotplug(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".roothp";
data.required_struct_types = base_required_struct_types;
@@ -923,9 +919,8 @@ static void test_acpi_piix4_no_root_hotplug(void)
static void test_acpi_piix4_no_bridge_hotplug(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".hpbridge";
data.required_struct_types = base_required_struct_types;
@@ -940,9 +935,8 @@ static void test_acpi_piix4_no_bridge_hotplug(void)
static void test_acpi_piix4_no_acpi_pci_hotplug(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".hpbrroot";
data.required_struct_types = base_required_struct_types;
@@ -962,9 +956,8 @@ static void test_acpi_piix4_no_acpi_pci_hotplug(void)
static void test_acpi_q35_tcg(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
@@ -994,9 +987,8 @@ static void test_acpi_q35_tcg_core_count2(void)
static void test_acpi_q35_tcg_bridge(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".bridge";
data.required_struct_types = base_required_struct_types;
@@ -1009,9 +1001,8 @@ static void test_acpi_q35_tcg_bridge(void)
static void test_acpi_q35_tcg_no_acpi_hotplug(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".noacpihp";
data.required_struct_types = base_required_struct_types;
@@ -1105,9 +1096,8 @@ static void test_acpi_q35_tcg_mmio64(void)
static void test_acpi_piix4_tcg_cphp(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".cphp";
test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6"
@@ -1121,9 +1111,8 @@ static void test_acpi_piix4_tcg_cphp(void)
static void test_acpi_q35_tcg_cphp(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".cphp";
test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6"
@@ -1141,9 +1130,8 @@ static uint8_t ipmi_required_struct_types[] = {
static void test_acpi_q35_tcg_ipmi(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".ipmibt";
data.required_struct_types = ipmi_required_struct_types;
@@ -1156,9 +1144,8 @@ static void test_acpi_q35_tcg_ipmi(void)
static void test_acpi_q35_tcg_smbus_ipmi(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".ipmismbus";
data.required_struct_types = ipmi_required_struct_types;
@@ -1171,12 +1158,11 @@ static void test_acpi_q35_tcg_smbus_ipmi(void)
static void test_acpi_piix4_tcg_ipmi(void)
{
- test_data data;
+ test_data data = {};
/* Supplying -machine accel argument overrides the default (qtest).
* This is to make guest actually run.
*/
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".ipmikcs";
data.required_struct_types = ipmi_required_struct_types;
@@ -1189,9 +1175,8 @@ static void test_acpi_piix4_tcg_ipmi(void)
static void test_acpi_q35_tcg_memhp(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".memhp";
test_acpi_one(" -m 128,slots=3,maxmem=1G"
@@ -1205,9 +1190,8 @@ static void test_acpi_q35_tcg_memhp(void)
static void test_acpi_piix4_tcg_memhp(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".memhp";
test_acpi_one(" -m 128,slots=3,maxmem=1G"
@@ -1221,9 +1205,8 @@ static void test_acpi_piix4_tcg_memhp(void)
static void test_acpi_piix4_tcg_nosmm(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".nosmm";
test_acpi_one("-machine smm=off", &data);
@@ -1232,9 +1215,8 @@ static void test_acpi_piix4_tcg_nosmm(void)
static void test_acpi_piix4_tcg_smm_compat(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".smm-compat";
test_acpi_one("-global PIIX4_PM.smm-compat=on", &data);
@@ -1243,9 +1225,8 @@ static void test_acpi_piix4_tcg_smm_compat(void)
static void test_acpi_piix4_tcg_smm_compat_nosmm(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".smm-compat-nosmm";
test_acpi_one("-global PIIX4_PM.smm-compat=on -machine smm=off", &data);
@@ -1254,9 +1235,8 @@ static void test_acpi_piix4_tcg_smm_compat_nosmm(void)
static void test_acpi_piix4_tcg_nohpet(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.machine_param = ",hpet=off";
data.variant = ".nohpet";
@@ -1266,9 +1246,8 @@ static void test_acpi_piix4_tcg_nohpet(void)
static void test_acpi_q35_tcg_numamem(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".numamem";
test_acpi_one(" -object memory-backend-ram,id=ram0,size=128M"
@@ -1278,9 +1257,8 @@ static void test_acpi_q35_tcg_numamem(void)
static void test_acpi_q35_kvm_xapic(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".xapic";
test_acpi_one(" -object memory-backend-ram,id=ram0,size=128M"
@@ -1291,9 +1269,8 @@ static void test_acpi_q35_kvm_xapic(void)
static void test_acpi_q35_tcg_nosmm(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".nosmm";
test_acpi_one("-machine smm=off", &data);
@@ -1302,9 +1279,8 @@ static void test_acpi_q35_tcg_nosmm(void)
static void test_acpi_q35_tcg_smm_compat(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".smm-compat";
test_acpi_one("-global ICH9-LPC.smm-compat=on", &data);
@@ -1313,9 +1289,8 @@ static void test_acpi_q35_tcg_smm_compat(void)
static void test_acpi_q35_tcg_smm_compat_nosmm(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".smm-compat-nosmm";
test_acpi_one("-global ICH9-LPC.smm-compat=on -machine smm=off", &data);
@@ -1324,9 +1299,8 @@ static void test_acpi_q35_tcg_smm_compat_nosmm(void)
static void test_acpi_q35_tcg_nohpet(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.machine_param = ",hpet=off";
data.variant = ".nohpet";
@@ -1336,9 +1310,8 @@ static void test_acpi_q35_tcg_nohpet(void)
static void test_acpi_q35_kvm_dmar(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".dmar";
test_acpi_one("-machine kernel-irqchip=split -accel kvm"
@@ -1348,9 +1321,8 @@ static void test_acpi_q35_kvm_dmar(void)
static void test_acpi_q35_tcg_ivrs(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".ivrs";
data.tcg_only = true,
@@ -1360,9 +1332,8 @@ static void test_acpi_q35_tcg_ivrs(void)
static void test_acpi_piix4_tcg_numamem(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".numamem";
test_acpi_one(" -object memory-backend-ram,id=ram0,size=128M"
@@ -1379,7 +1350,7 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
machine, tpm_if);
char *tmp_path = g_dir_make_tmp(tmp_dir_name, NULL);
TPMTestState test;
- test_data data;
+ test_data data = {};
GThread *thread;
const char *suffix = tpm_version == TPM_VERSION_2_0 ? "tpm2" : "tpm12";
char *args, *variant = g_strdup_printf(".%s.%s", tpm_if, suffix);
@@ -1399,7 +1370,6 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
thread = g_thread_new(NULL, tpm_emu_ctrl_thread, &test);
tpm_emu_test_wait_cond(&test);
- memset(&data, 0, sizeof(data));
data.machine = machine;
data.variant = variant;
@@ -1434,9 +1404,8 @@ static void test_acpi_q35_tcg_tpm12_tis(void)
static void test_acpi_tcg_dimm_pxm(const char *machine)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = machine;
data.variant = ".dimmpxm";
test_acpi_one(" -machine nvdimm=on,nvdimm-persistence=cpu"
@@ -1504,7 +1473,6 @@ static void test_acpi_virt_tcg_memhp(void)
static void test_acpi_microvm_prepare(test_data *data)
{
- memset(data, 0, sizeof(*data));
data->machine = "microvm";
data->required_struct_types = NULL; /* no smbios */
data->required_struct_types_len = 0;
@@ -1513,7 +1481,7 @@ static void test_acpi_microvm_prepare(test_data *data)
static void test_acpi_microvm_tcg(void)
{
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off",
@@ -1523,7 +1491,7 @@ static void test_acpi_microvm_tcg(void)
static void test_acpi_microvm_usb_tcg(void)
{
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
data.variant = ".usb";
@@ -1534,7 +1502,7 @@ static void test_acpi_microvm_usb_tcg(void)
static void test_acpi_microvm_rtc_tcg(void)
{
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
data.variant = ".rtc";
@@ -1545,7 +1513,7 @@ static void test_acpi_microvm_rtc_tcg(void)
static void test_acpi_microvm_pcie_tcg(void)
{
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
data.variant = ".pcie";
@@ -1557,7 +1525,7 @@ static void test_acpi_microvm_pcie_tcg(void)
static void test_acpi_microvm_ioapic2_tcg(void)
{
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
data.variant = ".ioapic2";
@@ -1622,9 +1590,8 @@ static void test_acpi_virt_tcg_pxb(void)
static void test_acpi_tcg_acpi_hmat(const char *machine)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = machine;
data.variant = ".acpihmat";
test_acpi_one(" -machine hmat=on"
@@ -1721,9 +1688,8 @@ static void test_acpi_virt_tcg_acpi_hmat(void)
static void test_acpi_q35_tcg_acpi_hmat_noinitiator(void)
{
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".acpihmat-noinitiator";
test_acpi_one(" -machine hmat=on"
@@ -1772,9 +1738,8 @@ static void test_acpi_erst(const char *machine)
{
gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
gchar *params;
- test_data data;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = machine;
data.variant = ".acpierst";
params = g_strdup_printf(
@@ -1802,7 +1767,7 @@ static void test_acpi_microvm_acpi_erst(void)
{
gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
gchar *params;
- test_data data;
+ test_data data = {};
test_acpi_microvm_prepare(&data);
data.variant = ".pcie";
@@ -2003,10 +1968,9 @@ static void test_oem_fields(test_data *data)
static void test_acpi_piix4_oem_fields(void)
{
- test_data data;
char *args;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
@@ -2022,10 +1986,9 @@ static void test_acpi_piix4_oem_fields(void)
static void test_acpi_q35_oem_fields(void)
{
- test_data data;
char *args;
+ test_data data = {};
- memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
@@ -2041,7 +2004,7 @@ static void test_acpi_q35_oem_fields(void)
static void test_acpi_microvm_oem_fields(void)
{
- test_data data;
+ test_data data = {};
char *args;
test_acpi_microvm_prepare(&data);