mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
48dde093d3
commit
c1a9ac9bde
1 changed files with 15 additions and 20 deletions
|
@ -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);
|
g_assert(data->scan_len);
|
||||||
data->rsdp_addr = acpi_find_rsdp_address_uefi(data->qts,
|
data->rsdp_addr = acpi_find_rsdp_address_uefi(data->qts,
|
||||||
data->ram_start, data->scan_len);
|
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);
|
test_acpi_fadt_table(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *test_acpi_create_args(test_data *data, const char *params,
|
static char *test_acpi_create_args(test_data *data, const char *params)
|
||||||
bool use_uefi)
|
|
||||||
{
|
{
|
||||||
char *args;
|
char *args;
|
||||||
|
|
||||||
if (use_uefi) {
|
if (data->uefi_fl1 && data->uefi_fl2) { /* use UEFI */
|
||||||
/*
|
/*
|
||||||
* TODO: convert '-drive if=pflash' to new syntax (see e33763be7cd3)
|
* TODO: convert '-drive if=pflash' to new syntax (see e33763be7cd3)
|
||||||
* when arm/virt boad starts to support it.
|
* 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)
|
static void test_acpi_one(const char *params, test_data *data)
|
||||||
{
|
{
|
||||||
char *args;
|
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);
|
data->qts = qtest_init(args);
|
||||||
test_acpi_load_tables(data, use_uefi);
|
test_acpi_load_tables(data);
|
||||||
|
|
||||||
if (getenv(ACPI_REBUILD_EXPECTED_AML)) {
|
if (getenv(ACPI_REBUILD_EXPECTED_AML)) {
|
||||||
dump_aml_files(data, true);
|
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:
|
* Bug on uefi-test-tools to provide entry point:
|
||||||
* https://bugs.launchpad.net/qemu/+bug/1821884
|
* 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);
|
SmbiosEntryPointType ep_type = test_smbios_entry_point(data);
|
||||||
test_smbios_structs(data, ep_type);
|
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 = base_required_struct_types;
|
||||||
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
|
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
|
||||||
|
|
||||||
args = test_acpi_create_args(&data,
|
args = test_acpi_create_args(&data, OEM_TEST_ARGS);
|
||||||
OEM_TEST_ARGS, false);
|
|
||||||
data.qts = qtest_init(args);
|
data.qts = qtest_init(args);
|
||||||
test_acpi_load_tables(&data, false);
|
test_acpi_load_tables(&data);
|
||||||
test_oem_fields(&data);
|
test_oem_fields(&data);
|
||||||
qtest_quit(data.qts);
|
qtest_quit(data.qts);
|
||||||
free_test_data(&data);
|
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 = base_required_struct_types;
|
||||||
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
|
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
|
||||||
|
|
||||||
args = test_acpi_create_args(&data,
|
args = test_acpi_create_args(&data, OEM_TEST_ARGS);
|
||||||
OEM_TEST_ARGS, false);
|
|
||||||
data.qts = qtest_init(args);
|
data.qts = qtest_init(args);
|
||||||
test_acpi_load_tables(&data, false);
|
test_acpi_load_tables(&data);
|
||||||
test_oem_fields(&data);
|
test_oem_fields(&data);
|
||||||
qtest_quit(data.qts);
|
qtest_quit(data.qts);
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
|
@ -1942,9 +1938,9 @@ static void test_acpi_microvm_oem_fields(void)
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
|
|
||||||
args = test_acpi_create_args(&data,
|
args = test_acpi_create_args(&data,
|
||||||
OEM_TEST_ARGS",acpi=on", false);
|
OEM_TEST_ARGS",acpi=on");
|
||||||
data.qts = qtest_init(args);
|
data.qts = qtest_init(args);
|
||||||
test_acpi_load_tables(&data, false);
|
test_acpi_load_tables(&data);
|
||||||
test_oem_fields(&data);
|
test_oem_fields(&data);
|
||||||
qtest_quit(data.qts);
|
qtest_quit(data.qts);
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
|
@ -1964,10 +1960,9 @@ static void test_acpi_virt_oem_fields(void)
|
||||||
};
|
};
|
||||||
char *args;
|
char *args;
|
||||||
|
|
||||||
args = test_acpi_create_args(&data,
|
args = test_acpi_create_args(&data, "-cpu cortex-a57 "OEM_TEST_ARGS);
|
||||||
"-cpu cortex-a57 "OEM_TEST_ARGS, true);
|
|
||||||
data.qts = qtest_init(args);
|
data.qts = qtest_init(args);
|
||||||
test_acpi_load_tables(&data, true);
|
test_acpi_load_tables(&data);
|
||||||
test_oem_fields(&data);
|
test_oem_fields(&data);
|
||||||
qtest_quit(data.qts);
|
qtest_quit(data.qts);
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue