Commit e098ba351c for qemu.org

commit e098ba351c01e153776d92a1de6e71f47072dc7b
Author: Philippe Mathieu-Daudé <philmd@mailo.com>
Date:   Thu May 28 16:00:09 2026 +0200

    accel/common: Remove last bit of target-specific code

    Initialize the TypeInfo structure at runtime using the TargetInfo
    API to resolve TYPE_ACCEL_CPU, replacing CPU_RESOLVING_TYPE by
    target_cpu_type(). Since the code is no more target-specific, move
    it to accel-common.c, removing the need for accel-target.c.

    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Anton Johansson <anjo@rev.ng>
    Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
    Message-Id: <20260528140857.44130-1-philmd@linaro.org>

diff --git a/accel/accel-common.c b/accel/accel-common.c
index 9c5b4111c8..62590a7d9a 100644
--- a/accel/accel-common.c
+++ b/accel/accel-common.c
@@ -134,3 +134,18 @@ static const TypeInfo accel_types[] = {
 };

 DEFINE_TYPES(accel_types)
+
+static void register_accel_target_type(void)
+{
+    g_autofree char *name = g_strconcat("accel-", target_cpu_type(), NULL);
+    const TypeInfo accel_cpu_type = {
+        .name = name,
+        .parent = TYPE_OBJECT,
+        .abstract = true,
+        .class_size = sizeof(AccelCPUClass),
+    };
+
+    type_register_static(&accel_cpu_type);
+}
+
+type_init(register_accel_target_type);
diff --git a/accel/accel-target.c b/accel/accel-target.c
deleted file mode 100644
index 7fd392fbc4..0000000000
--- a/accel/accel-target.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * QEMU accel class, components common to system emulation and user mode
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (c) 2014 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "qemu/osdep.h"
-#include "accel/accel-cpu-target.h"
-
-static const TypeInfo accel_cpu_type = {
-    .name = TYPE_ACCEL_CPU,
-    .parent = TYPE_OBJECT,
-    .abstract = true,
-    .class_size = sizeof(AccelCPUClass),
-};
-
-static void register_accel_types(void)
-{
-    type_register_static(&accel_cpu_type);
-}
-
-type_init(register_accel_types);
diff --git a/accel/meson.build b/accel/meson.build
index 7da12b9741..1b5b37e309 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -1,5 +1,4 @@
 common_ss.add(files('accel-common.c'))
-specific_ss.add(files('accel-target.c'))
 system_ss.add(files('accel-system.c', 'accel-blocker.c', 'accel-qmp.c', 'accel-irq.c'))
 user_ss.add(files('accel-user.c'))