diff mbox series

[PATCH-for-9.1,5/7] hw/core: Restrict reset handlers API to system emulation

Message ID 20240404194757.9343-6-philmd@linaro.org
State New
Headers show
Series buildsys: Start shrinking qemu-user build process | expand

Commit Message

Philippe Mathieu-Daudé April 4, 2024, 7:47 p.m. UTC
Headers in include/sysemu/ are specific to system
emulation and should not be used in user emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/core/reset.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Paolo Bonzini April 8, 2024, 10:09 a.m. UTC | #1
On Thu, Apr 4, 2024 at 9:48 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Headers in include/sysemu/ are specific to system
> emulation and should not be used in user emulation.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/core/reset.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/hw/core/reset.c b/hw/core/reset.c
> index d50da7e304..167c8bf1a9 100644
> --- a/hw/core/reset.c
> +++ b/hw/core/reset.c
> @@ -24,7 +24,9 @@
>   */
>
>  #include "qemu/osdep.h"
> +#ifndef CONFIG_USER_ONLY
>  #include "sysemu/reset.h"
> +#endif
>  #include "hw/resettable.h"
>  #include "hw/core/resetcontainer.h"
>
> @@ -43,6 +45,7 @@ static ResettableContainer *get_root_reset_container(void)
>      return root_reset_container;
>  }
>
> +#ifndef CONFIG_USER_ONLY

Wait, this does not make sense. The only thing left in the file is a
single static function, which contradicts the other patch's commit
message "reset.c contains core code used by any CPU,".

Let me rework these two patches so that reset.c, qdev-hotplug.c and
hotplug.c can be moved to system_ss. I'll post a v2 shortly.

Paolo

>  /*
>   * Reason why the currently in-progress qemu_devices_reset() was called.
>   * If we made at least SHUTDOWN_CAUSE_SNAPSHOT_LOAD have a corresponding
> @@ -185,3 +188,4 @@ void qemu_devices_reset(ShutdownCause reason)
>      /* Reset the simulation */
>      resettable_reset(OBJECT(get_root_reset_container()), RESET_TYPE_COLD);
>  }
> +#endif
> --
> 2.41.0
>
diff mbox series

Patch

diff --git a/hw/core/reset.c b/hw/core/reset.c
index d50da7e304..167c8bf1a9 100644
--- a/hw/core/reset.c
+++ b/hw/core/reset.c
@@ -24,7 +24,9 @@ 
  */
 
 #include "qemu/osdep.h"
+#ifndef CONFIG_USER_ONLY
 #include "sysemu/reset.h"
+#endif
 #include "hw/resettable.h"
 #include "hw/core/resetcontainer.h"
 
@@ -43,6 +45,7 @@  static ResettableContainer *get_root_reset_container(void)
     return root_reset_container;
 }
 
+#ifndef CONFIG_USER_ONLY
 /*
  * Reason why the currently in-progress qemu_devices_reset() was called.
  * If we made at least SHUTDOWN_CAUSE_SNAPSHOT_LOAD have a corresponding
@@ -185,3 +188,4 @@  void qemu_devices_reset(ShutdownCause reason)
     /* Reset the simulation */
     resettable_reset(OBJECT(get_root_reset_container()), RESET_TYPE_COLD);
 }
+#endif