diff mbox series

[RFC,PATCH-for-10.1,13/19] accel: Replace CPU_RESOLVING_TYPE -> target_cpu_type()

Message ID 20250403234914.9154-14-philmd@linaro.org
State New
Headers show
Series qemu: Introduce TargetInfo API (for single binary) | expand

Commit Message

Philippe Mathieu-Daudé April 3, 2025, 11:49 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/accel-target.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Pierrick Bouvier April 4, 2025, 4:52 p.m. UTC | #1
On 4/3/25 16:49, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/accel-target.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/accel/accel-target.c b/accel/accel-target.c
> index 33a539b4cbb..9e9e70be876 100644
> --- a/accel/accel-target.c
> +++ b/accel/accel-target.c
> @@ -25,6 +25,7 @@
>   
>   #include "qemu/osdep.h"
>   #include "qemu/accel.h"
> +#include "qemu/target_info.h"
>   
>   #include "cpu.h"
>   #include "accel/accel-cpu-target.h"
> @@ -88,17 +89,18 @@ static void accel_init_cpu_interfaces(AccelClass *ac)
>       const char *ac_name; /* AccelClass name */
>       char *acc_name;      /* AccelCPUClass name */
>       ObjectClass *acc;    /* AccelCPUClass */
> +    const char *cpu_resolving_type = target_cpu_type();
>   
>       ac_name = object_class_get_name(OBJECT_CLASS(ac));
>       g_assert(ac_name != NULL);
>   
> -    acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE);
> +    acc_name = g_strdup_printf("%s-%s", ac_name, cpu_resolving_type);
>       acc = object_class_by_name(acc_name);
>       g_free(acc_name);
>   
>       if (acc) {
>           object_class_foreach(accel_init_cpu_int_aux,
> -                             CPU_RESOLVING_TYPE, false, acc);
> +                             cpu_resolving_type, false, acc);
>       }
>   }
>   

Please squash with related commit.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/accel/accel-target.c b/accel/accel-target.c
index 33a539b4cbb..9e9e70be876 100644
--- a/accel/accel-target.c
+++ b/accel/accel-target.c
@@ -25,6 +25,7 @@ 
 
 #include "qemu/osdep.h"
 #include "qemu/accel.h"
+#include "qemu/target_info.h"
 
 #include "cpu.h"
 #include "accel/accel-cpu-target.h"
@@ -88,17 +89,18 @@  static void accel_init_cpu_interfaces(AccelClass *ac)
     const char *ac_name; /* AccelClass name */
     char *acc_name;      /* AccelCPUClass name */
     ObjectClass *acc;    /* AccelCPUClass */
+    const char *cpu_resolving_type = target_cpu_type();
 
     ac_name = object_class_get_name(OBJECT_CLASS(ac));
     g_assert(ac_name != NULL);
 
-    acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE);
+    acc_name = g_strdup_printf("%s-%s", ac_name, cpu_resolving_type);
     acc = object_class_by_name(acc_name);
     g_free(acc_name);
 
     if (acc) {
         object_class_foreach(accel_init_cpu_int_aux,
-                             CPU_RESOLVING_TYPE, false, acc);
+                             cpu_resolving_type, false, acc);
     }
 }