diff mbox series

[35/37] include/qemu: Remove ifndef CONFIG_USER_ONLY from accel.h

Message ID 20250313034524.3069690-36-richard.henderson@linaro.org (mailing list archive)
State New
Headers show
Series accel/tcg, codebase: Build once patches | expand

Commit Message

Richard Henderson March 13, 2025, 3:45 a.m. UTC
While setup_post and has_memory will not be used for
CONFIG_USER_ONLY, let the struct have constant layout.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/qemu/accel.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Pierrick Bouvier March 13, 2025, 9:03 p.m. UTC | #1
On 3/12/25 20:45, Richard Henderson wrote:
> While setup_post and has_memory will not be used for
> CONFIG_USER_ONLY, let the struct have constant layout.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/qemu/accel.h | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/include/qemu/accel.h b/include/qemu/accel.h
> index 972a849a2b..fbd3d897fe 100644
> --- a/include/qemu/accel.h
> +++ b/include/qemu/accel.h
> @@ -38,13 +38,13 @@ typedef struct AccelClass {
>   
>       const char *name;
>       int (*init_machine)(MachineState *ms);
> -#ifndef CONFIG_USER_ONLY
> +    bool (*cpu_common_realize)(CPUState *cpu, Error **errp);
> +    void (*cpu_common_unrealize)(CPUState *cpu);
> +
> +    /* system related hooks */
>       void (*setup_post)(MachineState *ms, AccelState *accel);
>       bool (*has_memory)(MachineState *ms, AddressSpace *as,
>                          hwaddr start_addr, hwaddr size);
> -#endif
> -    bool (*cpu_common_realize)(CPUState *cpu, Error **errp);
> -    void (*cpu_common_unrealize)(CPUState *cpu);
>   
>       /* gdbstub related hooks */
>       int (*gdbstub_supported_sstep_flags)(void);
> @@ -78,12 +78,10 @@ const char *current_accel_name(void);
>   
>   void accel_init_interfaces(AccelClass *ac);
>   
> -#ifndef CONFIG_USER_ONLY
>   int accel_init_machine(AccelState *accel, MachineState *ms);
>   
>   /* Called just before os_setup_post (ie just before drop OS privs) */
>   void accel_setup_post(MachineState *ms);
> -#endif /* !CONFIG_USER_ONLY */
>   
>   /**
>    * accel_cpu_instance_init:

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

Patch

diff --git a/include/qemu/accel.h b/include/qemu/accel.h
index 972a849a2b..fbd3d897fe 100644
--- a/include/qemu/accel.h
+++ b/include/qemu/accel.h
@@ -38,13 +38,13 @@  typedef struct AccelClass {
 
     const char *name;
     int (*init_machine)(MachineState *ms);
-#ifndef CONFIG_USER_ONLY
+    bool (*cpu_common_realize)(CPUState *cpu, Error **errp);
+    void (*cpu_common_unrealize)(CPUState *cpu);
+
+    /* system related hooks */
     void (*setup_post)(MachineState *ms, AccelState *accel);
     bool (*has_memory)(MachineState *ms, AddressSpace *as,
                        hwaddr start_addr, hwaddr size);
-#endif
-    bool (*cpu_common_realize)(CPUState *cpu, Error **errp);
-    void (*cpu_common_unrealize)(CPUState *cpu);
 
     /* gdbstub related hooks */
     int (*gdbstub_supported_sstep_flags)(void);
@@ -78,12 +78,10 @@  const char *current_accel_name(void);
 
 void accel_init_interfaces(AccelClass *ac);
 
-#ifndef CONFIG_USER_ONLY
 int accel_init_machine(AccelState *accel, MachineState *ms);
 
 /* Called just before os_setup_post (ie just before drop OS privs) */
 void accel_setup_post(MachineState *ms);
-#endif /* !CONFIG_USER_ONLY */
 
 /**
  * accel_cpu_instance_init: