thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-tests-acpi-test-short-OEM_ID-OEM_TABLE_ID-values-in-.patch

0727d3
From 485bf2eb8edabd4553d995d5e32224df1e510aa2 Mon Sep 17 00:00:00 2001
0727d3
From: Jon Maloy <jmaloy@redhat.com>
0727d3
Date: Wed, 30 Mar 2022 14:52:34 -0400
0727d3
Subject: [PATCH 17/18] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in
0727d3
 test_oem_fields()
0727d3
0727d3
RH-Author: Jon Maloy <jmaloy@redhat.com>
0727d3
RH-MergeRequest: 141: acpi: fix QEMU crash when started with SLIC table
0727d3
RH-Commit: [9/10] 31339223fb6c6cc32185b9fdaac76f2709b17ad6 (jmaloy/qemu-kvm)
0727d3
RH-Bugzilla: 2062611
0727d3
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0727d3
0727d3
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062611
0727d3
Upstream: Merged
0727d3
0727d3
commit 408ca92634770de5eac7965ed97c6260e770f2e7
0727d3
Author: Igor Mammedov <imammedo@redhat.com>
0727d3
Date:   Fri Jan 14 09:26:41 2022 -0500
0727d3
0727d3
    tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields()
0727d3
0727d3
    Previous patch [1] added explicit whitespace padding to OEM_ID/OEM_TABLE_ID
0727d3
    values used in test_oem_fields() testcase to avoid false positive and
0727d3
    bisection issues when QEMU is switched to \0' padding. As result
0727d3
    testcase ceased to test values that were shorter than max possible
0727d3
    length values.
0727d3
0727d3
    Update testcase to make sure that it's testing shorter IDs like it
0727d3
    used to before [2].
0727d3
0727d3
    1) "tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for  test_oem_fields() test"
0727d3
    2) 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
0727d3
0727d3
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
0727d3
    Message-Id: <20220114142641.1727679-1-imammedo@redhat.com>
0727d3
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
0727d3
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
0727d3
0727d3
(cherry picked from commit 408ca92634770de5eac7965ed97c6260e770f2e7)
0727d3
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
0727d3
---
0727d3
 tests/qtest/bios-tables-test.c | 12 ++++++------
0727d3
 1 file changed, 6 insertions(+), 6 deletions(-)
0727d3
0727d3
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
0727d3
index 348fdbd202..515a647490 100644
0727d3
--- a/tests/qtest/bios-tables-test.c
0727d3
+++ b/tests/qtest/bios-tables-test.c
0727d3
@@ -71,10 +71,10 @@
0727d3
 
0727d3
 #define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML"
0727d3
 
0727d3
-#define OEM_ID             "TEST  "
0727d3
-#define OEM_TABLE_ID       "OEM     "
0727d3
-#define OEM_TEST_ARGS      "-machine x-oem-id='" OEM_ID "',x-oem-table-id='" \
0727d3
-                           OEM_TABLE_ID "'"
0727d3
+#define OEM_ID             "TEST"
0727d3
+#define OEM_TABLE_ID       "OEM"
0727d3
+#define OEM_TEST_ARGS      "-machine x-oem-id=" OEM_ID ",x-oem-table-id=" \
0727d3
+                           OEM_TABLE_ID
0727d3
 
0727d3
 typedef struct {
0727d3
     bool tcg_only;
0727d3
@@ -1495,8 +1495,8 @@ static void test_oem_fields(test_data *data)
0727d3
             continue;
0727d3
         }
0727d3
 
0727d3
-        g_assert(memcmp(sdt->aml + 10, OEM_ID, 6) == 0);
0727d3
-        g_assert(memcmp(sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
0727d3
+        g_assert(strncmp((char *)sdt->aml + 10, OEM_ID, 6) == 0);
0727d3
+        g_assert(strncmp((char *)sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
0727d3
     }
0727d3
 }
0727d3
 
0727d3
-- 
0727d3
2.27.0
0727d3