7fbe0e6b6e
- kvm-qtest-x86-numa-test-do-not-use-the-obsolete-pentium-.patch [RHEL-28972] - kvm-tests-qtest-libqtest-add-qtest_has_cpu_model-api.patch [RHEL-28972] - kvm-tests-qtest-x86-check-for-availability-of-older-cpu-.patch [RHEL-28972] - kvm-target-cpu-models-x86-Remove-the-existing-deprecated.patch [RHEL-28972] - kvm-x86-cpu-deprecate-cpu-models-that-do-not-support-x86.patch [RHEL-28971] - kvm-virtio-gpu-fix-v2-migration.patch [RHEL-36329] - kvm-rhel-9.4.0-machine-type-compat-for-virtio-gpu-migrat.patch [RHEL-36329] - kvm-s390x-remove-deprecated-rhel-machine-types.patch [RHEL-39898] - kvm-s390x-select-correct-components-for-no-board-build.patch [RHEL-39898] - kvm-target-s390x-Add-a-CONFIG-switch-to-disable-legacy-C.patch [RHEL-39898] - kvm-target-s390x-cpu_models-Disable-everything-up-to-the.patch [RHEL-39898] - kvm-target-s390x-Revert-the-old-s390x-CPU-model-disablem.patch [RHEL-39898] - kvm-Revert-monitor-use-aio_co_reschedule_self.patch [RHEL-43409 RHEL-43410] - kvm-aio-warn-about-iohandler_ctx-special-casing.patch [RHEL-43409 RHEL-43410] - Resolves: RHEL-28972 (x86: Remove the existing deprecated CPU models on RHEL10) - Resolves: RHEL-28971 (Consider deprecating CPU models like "Nehalem" / "IvyBridge" on RHEL 10) - Resolves: RHEL-36329 ([RHEL10.0.beta][stable_guest_abi]Failed to migrate VM with (qemu) qemu-kvm: Missing section footer for 0000:00:01.0/virtio-gpu qemu-kvm: load of migration failed: Invalid argument) - Resolves: RHEL-39898 (s390: Remove the legacy CPU models on RHEL10) - Resolves: RHEL-43409 (aio=io_uring: Assertion failure `luringcb->co->ctx == s->aio_context' with block_resize) - Resolves: RHEL-43410 (aio=native: Assertion failure `laiocb->co->ctx == laiocb->ctx->aio_context' with block_resize)
163 lines
4.7 KiB
Diff
163 lines
4.7 KiB
Diff
From 83bed1458ca3c0137658b53f0a1115d232091703 Mon Sep 17 00:00:00 2001
|
|
From: Ani Sinha <anisinha@redhat.com>
|
|
Date: Mon, 10 Jun 2024 21:22:59 +0530
|
|
Subject: [PATCH 02/14] tests/qtest/libqtest: add qtest_has_cpu_model() api
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
|
RH-MergeRequest: 243: target/cpu-models/x86: Remove the existing deprecated CPU models on c10s
|
|
RH-Jira: RHEL-28972
|
|
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
RH-Acked-by: MST <mst@redhat.com>
|
|
RH-Commit: [2/4] af128c3ae0a563ca5e2b50bdbdf44f6ce1404aad (anisinha/centos-qemu-kvm)
|
|
|
|
Added a new test api qtest_has_cpu_model() in order to check availability of
|
|
some cpu models in the current QEMU binary. The specific architecture of the
|
|
QEMU binary is selected using the QTEST_QEMU_BINARY environment variable.
|
|
This api would be useful to run tests against some older cpu models after
|
|
checking if QEMU actually supported these models.
|
|
|
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
Reviewed-by: Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
Message-ID: <20240610155303.7933-3-anisinha@redhat.com>
|
|
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|
(cherry picked from commit f43f8abe457a4aa32441bd190638e1118d291c42)
|
|
---
|
|
tests/qtest/libqtest.c | 83 ++++++++++++++++++++++++++++++++++++++++++
|
|
tests/qtest/libqtest.h | 8 ++++
|
|
2 files changed, 91 insertions(+)
|
|
|
|
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
|
|
index d8f80d335e..18e2f7f282 100644
|
|
--- a/tests/qtest/libqtest.c
|
|
+++ b/tests/qtest/libqtest.c
|
|
@@ -37,6 +37,7 @@
|
|
#include "qapi/qmp/qjson.h"
|
|
#include "qapi/qmp/qlist.h"
|
|
#include "qapi/qmp/qstring.h"
|
|
+#include "qapi/qmp/qbool.h"
|
|
|
|
#define MAX_IRQ 256
|
|
|
|
@@ -1471,6 +1472,12 @@ struct MachInfo {
|
|
char *alias;
|
|
};
|
|
|
|
+struct CpuModel {
|
|
+ char *name;
|
|
+ char *alias_of;
|
|
+ bool deprecated;
|
|
+};
|
|
+
|
|
static void qtest_free_machine_list(struct MachInfo *machines)
|
|
{
|
|
if (machines) {
|
|
@@ -1550,6 +1557,82 @@ static struct MachInfo *qtest_get_machines(const char *var)
|
|
return machines;
|
|
}
|
|
|
|
+static struct CpuModel *qtest_get_cpu_models(void)
|
|
+{
|
|
+ static struct CpuModel *cpus;
|
|
+ QDict *response, *minfo;
|
|
+ QList *list;
|
|
+ const QListEntry *p;
|
|
+ QObject *qobj;
|
|
+ QString *qstr;
|
|
+ QBool *qbool;
|
|
+ QTestState *qts;
|
|
+ int idx;
|
|
+
|
|
+ if (cpus) {
|
|
+ return cpus;
|
|
+ }
|
|
+
|
|
+ silence_spawn_log = !g_test_verbose();
|
|
+
|
|
+ qts = qtest_init_with_env(NULL, "-machine none");
|
|
+ response = qtest_qmp(qts, "{ 'execute': 'query-cpu-definitions' }");
|
|
+ g_assert(response);
|
|
+ list = qdict_get_qlist(response, "return");
|
|
+ g_assert(list);
|
|
+
|
|
+ cpus = g_new0(struct CpuModel, qlist_size(list) + 1);
|
|
+
|
|
+ for (p = qlist_first(list), idx = 0; p; p = qlist_next(p), idx++) {
|
|
+ minfo = qobject_to(QDict, qlist_entry_obj(p));
|
|
+ g_assert(minfo);
|
|
+
|
|
+ qobj = qdict_get(minfo, "name");
|
|
+ g_assert(qobj);
|
|
+ qstr = qobject_to(QString, qobj);
|
|
+ g_assert(qstr);
|
|
+ cpus[idx].name = g_strdup(qstring_get_str(qstr));
|
|
+
|
|
+ qobj = qdict_get(minfo, "alias_of");
|
|
+ if (qobj) { /* old machines do not report aliases */
|
|
+ qstr = qobject_to(QString, qobj);
|
|
+ g_assert(qstr);
|
|
+ cpus[idx].alias_of = g_strdup(qstring_get_str(qstr));
|
|
+ } else {
|
|
+ cpus[idx].alias_of = NULL;
|
|
+ }
|
|
+
|
|
+ qobj = qdict_get(minfo, "deprecated");
|
|
+ qbool = qobject_to(QBool, qobj);
|
|
+ g_assert(qbool);
|
|
+ cpus[idx].deprecated = qbool_get_bool(qbool);
|
|
+ }
|
|
+
|
|
+ qtest_quit(qts);
|
|
+ qobject_unref(response);
|
|
+
|
|
+ silence_spawn_log = false;
|
|
+
|
|
+ return cpus;
|
|
+}
|
|
+
|
|
+bool qtest_has_cpu_model(const char *cpu)
|
|
+{
|
|
+ struct CpuModel *cpus;
|
|
+ int i;
|
|
+
|
|
+ cpus = qtest_get_cpu_models();
|
|
+
|
|
+ for (i = 0; cpus[i].name != NULL; i++) {
|
|
+ if (g_str_equal(cpu, cpus[i].name) ||
|
|
+ (cpus[i].alias_of && g_str_equal(cpu, cpus[i].alias_of))) {
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return false;
|
|
+}
|
|
+
|
|
void qtest_cb_for_every_machine(void (*cb)(const char *machine),
|
|
bool skip_old_versioned)
|
|
{
|
|
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
|
|
index 6e3d3525bf..beb96b18eb 100644
|
|
--- a/tests/qtest/libqtest.h
|
|
+++ b/tests/qtest/libqtest.h
|
|
@@ -949,6 +949,14 @@ bool qtest_has_machine(const char *machine);
|
|
*/
|
|
bool qtest_has_machine_with_env(const char *var, const char *machine);
|
|
|
|
+/**
|
|
+ * qtest_has_cpu_model:
|
|
+ * @cpu: The cpu to look for
|
|
+ *
|
|
+ * Returns: true if the cpu is available in the target binary.
|
|
+ */
|
|
+bool qtest_has_cpu_model(const char *cpu);
|
|
+
|
|
/**
|
|
* qtest_has_device:
|
|
* @device: The device to look for
|
|
--
|
|
2.39.3
|
|
|