aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/bios-tables-test.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2023-01-12 15:02:38 +0100
committerMichael S. Tsirkin <mst@redhat.com>2023-01-28 06:21:29 -0500
commitc1a9ac9bdeea213162a76f7b9e2f876c89a50a94 (patch)
treee2efc4b07812998a5de01940811cac9e72170f88 /tests/qtest/bios-tables-test.c
parent48dde093d30dc6d09e832e478cb6661cf633a882 (diff)
tests: acpi: cleanup use_uefi argument usage
'use_uefi' is used for the flag is a part of 'test_data *data' argument that is passed to the same functions, which makes use_uefi argument redundant. Drop it and use 'data::uefi_*' directly, instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-7-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/qtest/bios-tables-test.c')
-rw-r--r--tests/qtest/bios-tables-test.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 6a99b10384..cb95f687fe 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -748,9 +748,9 @@ static void test_smbios_structs(test_data *data, SmbiosEntryPointType ep_type)
}
}
-static void test_acpi_load_tables(test_data *data, bool use_uefi)
+static void test_acpi_load_tables(test_data *data)
{
- if (use_uefi) {
+ if (data->uefi_fl1 && data->uefi_fl2) { /* use UEFI */
g_assert(data->scan_len);
data->rsdp_addr = acpi_find_rsdp_address_uefi(data->qts,
data->ram_start, data->scan_len);
@@ -766,12 +766,11 @@ static void test_acpi_load_tables(test_data *data, bool use_uefi)
test_acpi_fadt_table(data);
}
-static char *test_acpi_create_args(test_data *data, const char *params,
- bool use_uefi)
+static char *test_acpi_create_args(test_data *data, const char *params)
{
char *args;
- if (use_uefi) {
+ if (data->uefi_fl1 && data->uefi_fl2) { /* use UEFI */
/*
* TODO: convert '-drive if=pflash' to new syntax (see e33763be7cd3)
* when arm/virt boad starts to support it.
@@ -809,11 +808,10 @@ static char *test_acpi_create_args(test_data *data, const char *params,
static void test_acpi_one(const char *params, test_data *data)
{
char *args;
- bool use_uefi = data->uefi_fl1 && data->uefi_fl2;
- args = test_acpi_create_args(data, params, use_uefi);
+ args = test_acpi_create_args(data, params);
data->qts = qtest_init(args);
- test_acpi_load_tables(data, use_uefi);
+ test_acpi_load_tables(data);
if (getenv(ACPI_REBUILD_EXPECTED_AML)) {
dump_aml_files(data, true);
@@ -826,7 +824,7 @@ static void test_acpi_one(const char *params, test_data *data)
* Bug on uefi-test-tools to provide entry point:
* https://bugs.launchpad.net/qemu/+bug/1821884
*/
- if (!use_uefi) {
+ if (!(data->uefi_fl1 && data->uefi_fl2)) {
SmbiosEntryPointType ep_type = test_smbios_entry_point(data);
test_smbios_structs(data, ep_type);
}
@@ -1904,10 +1902,9 @@ static void test_acpi_piix4_oem_fields(void)
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- args = test_acpi_create_args(&data,
- OEM_TEST_ARGS, false);
+ args = test_acpi_create_args(&data, OEM_TEST_ARGS);
data.qts = qtest_init(args);
- test_acpi_load_tables(&data, false);
+ test_acpi_load_tables(&data);
test_oem_fields(&data);
qtest_quit(data.qts);
free_test_data(&data);
@@ -1924,10 +1921,9 @@ static void test_acpi_q35_oem_fields(void)
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- args = test_acpi_create_args(&data,
- OEM_TEST_ARGS, false);
+ args = test_acpi_create_args(&data, OEM_TEST_ARGS);
data.qts = qtest_init(args);
- test_acpi_load_tables(&data, false);
+ test_acpi_load_tables(&data);
test_oem_fields(&data);
qtest_quit(data.qts);
free_test_data(&data);
@@ -1942,9 +1938,9 @@ static void test_acpi_microvm_oem_fields(void)
test_acpi_microvm_prepare(&data);
args = test_acpi_create_args(&data,
- OEM_TEST_ARGS",acpi=on", false);
+ OEM_TEST_ARGS",acpi=on");
data.qts = qtest_init(args);
- test_acpi_load_tables(&data, false);
+ test_acpi_load_tables(&data);
test_oem_fields(&data);
qtest_quit(data.qts);
free_test_data(&data);
@@ -1964,10 +1960,9 @@ static void test_acpi_virt_oem_fields(void)
};
char *args;
- args = test_acpi_create_args(&data,
- "-cpu cortex-a57 "OEM_TEST_ARGS, true);
+ args = test_acpi_create_args(&data, "-cpu cortex-a57 "OEM_TEST_ARGS);
data.qts = qtest_init(args);
- test_acpi_load_tables(&data, true);
+ test_acpi_load_tables(&data);
test_oem_fields(&data);
qtest_quit(data.qts);
free_test_data(&data);