Blame SOURCES/kvm-tests-acpi-manually-pad-OEM_ID-OEM_TABLE_ID-for-test.patch

60061b
From 42554e549e4843f4611be3b48101985adb5f52de Mon Sep 17 00:00:00 2001
60061b
From: Igor Mammedov <imammedo@redhat.com>
60061b
Date: Wed, 12 Jan 2022 08:03:29 -0500
60061b
Subject: [PATCH 07/12] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for
60061b
 test_oem_fields() test
60061b
60061b
RH-Author: Igor Mammedov <imammedo@redhat.com>
60061b
RH-MergeRequest: 129: acpi: fix QEMU crash when started with SLIC table
60061b
RH-Commit: [5/10] eabc0211172d707e50564cc43060c3c383cdcac2
60061b
RH-Bugzilla: 2059311
60061b
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
60061b
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
60061b
RH-Acked-by: MST <None>
60061b
60061b
The next commit will revert OEM fields padding with whitespace to
60061b
padding with '\0' as it was before [1]. As result test_oem_fields() will
60061b
fail due to unexpectedly smaller ID sizes read from QEMU ACPI tables.
60061b
60061b
Pad OEM_ID/OEM_TABLE_ID manually with spaces so that values the test
60061b
puts on QEMU CLI and expected values match.
60061b
60061b
1) 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
60061b
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
60061b
Message-Id: <20220112130332.1648664-2-imammedo@redhat.com>
60061b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
60061b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
60061b
(cherry picked from commit a849522f726767022203ef2b6c395ea19facb866)
60061b
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
60061b
---
60061b
 tests/qtest/bios-tables-test.c | 15 ++++++---------
60061b
 1 file changed, 6 insertions(+), 9 deletions(-)
60061b
60061b
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
60061b
index e159b71136..348fdbd202 100644
60061b
--- a/tests/qtest/bios-tables-test.c
60061b
+++ b/tests/qtest/bios-tables-test.c
60061b
@@ -71,9 +71,10 @@
60061b
 
60061b
 #define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML"
60061b
 
60061b
-#define OEM_ID             "TEST"
60061b
-#define OEM_TABLE_ID       "OEM"
60061b
-#define OEM_TEST_ARGS      "-machine x-oem-id="OEM_ID",x-oem-table-id="OEM_TABLE_ID
60061b
+#define OEM_ID             "TEST  "
60061b
+#define OEM_TABLE_ID       "OEM     "
60061b
+#define OEM_TEST_ARGS      "-machine x-oem-id='" OEM_ID "',x-oem-table-id='" \
60061b
+                           OEM_TABLE_ID "'"
60061b
 
60061b
 typedef struct {
60061b
     bool tcg_only;
60061b
@@ -1484,11 +1485,7 @@ static void test_acpi_q35_slic(void)
60061b
 static void test_oem_fields(test_data *data)
60061b
 {
60061b
     int i;
60061b
-    char oem_id[6];
60061b
-    char oem_table_id[8];
60061b
 
60061b
-    strpadcpy(oem_id, sizeof oem_id, OEM_ID, ' ');
60061b
-    strpadcpy(oem_table_id, sizeof oem_table_id, OEM_TABLE_ID, ' ');
60061b
     for (i = 0; i < data->tables->len; ++i) {
60061b
         AcpiSdtTable *sdt;
60061b
 
60061b
@@ -1498,8 +1495,8 @@ static void test_oem_fields(test_data *data)
60061b
             continue;
60061b
         }
60061b
 
60061b
-        g_assert(memcmp(sdt->aml + 10, oem_id, 6) == 0);
60061b
-        g_assert(memcmp(sdt->aml + 16, oem_table_id, 8) == 0);
60061b
+        g_assert(memcmp(sdt->aml + 10, OEM_ID, 6) == 0);
60061b
+        g_assert(memcmp(sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
60061b
     }
60061b
 }
60061b
 
60061b
-- 
60061b
2.27.0
60061b